FontMetrics (int fontType) { if (myPlainFontMetrics == null) { ThreadingAssertions.assertEventDispatchThread(); myPlainFontMetrics = myEditorComponent.getFontMetrics(myScheme.getFont(EditorFontType.PLAIN)); myBoldFontMetrics = myEditorComponent.getFontMetrics(myScheme.getFont(EditorFontType.BOLD)); myItalicFontMetrics = myEditorComponent.getFontMetrics(myScheme.getFont(EditorFontType.ITALIC)); myBoldItalicFontMetrics = myEditorComponent.getFontMetrics(myScheme.getFont(EditorFontType.BOLD_ITALIC)); } if (fontType == Font.PLAIN) return myPlainFontMetrics; if (fontType == Font.BOLD) return myBoldFontMetrics; if (fontType == Font.ITALIC) return myItalicFontMetrics; if (fontType == Font.BOLD + Font.ITALIC) return myBoldItalicFontMetrics; LOG.assertTrue(false, "Unknown font type: " + fontType); return myPlainFontMetrics; }