void () { // We use dummy component here in order to be able to work with font metrics. JLabel component = new JLabel(); myCanUse = true; for (Map.Entry<SoftWrapDrawingType, char[]> entry : mySymbols.entrySet()) { SoftWrapDrawingType type = entry.getKey(); char c = entry.getValue()[0]; FontInfo fontInfo = EditorUtil.fontForChar(c, Font.PLAIN, myEditor); if (!fontInfo.canDisplay(c)) { myCanUse = false; myFonts.put(type, null); myVGaps.put(type, null); myWidths[type.ordinal()] = 0; } else { myFonts.put(type, fontInfo); FontMetrics metrics = component.getFontMetrics(fontInfo.getFont()); myWidths[type.ordinal()] = metrics.charWidth(c); int vGap = metrics.getDescent(); myVGaps.put(type, vGap); } } }