@Override
    public void setFont(Font font)
    {
        // bugfix: HexText's raw array overflows when font is very small and window very big
        // very small sizes would compromise responsiveness in large windows, and they are too small
        // to see anyway
        if (font != null) {
            int newSize = UIUtils.getFontHeight(font);
            if (newSize == 1 || newSize == 2)
                throw new IllegalArgumentException("Font size is " + newSize + ", too small");
        }

        fontCurrent = font;
        if (fontCurrent == null) {
            fontCurrent = fontDefault;
        }
        super.setFont(fontCurrent);
        hexHeaderText.setFont(fontCurrent);
        hexHeaderText.pack(true);
        GC gc = new GC(hexHeaderText);
        fontCharWidth = gc.getFontMetrics().getAverageCharWidth();
        gc.dispose();
        makeFirstRowSameHeight();
        linesText.setFont(fontCurrent);
        setAddressesGridDataWidthHint();
        linesText.pack(true);
        hexText.setFont(fontCurrent);
        hexText.pack(true);
        previewText.setFont(fontCurrent);
        previewText.pack(true);
        updateTextsMetrics();
        layout();
        setCaretsSize(isInserting);
    }
@throws IllegalArgumentException if font height is 1 or 2
@see Control#setFont(org.eclipse.swt.graphics.Font)
     Font height must not be 1 or 2.
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java