float (int codePoint, int fontStyle) { Editor editor = myView.getEditor(); if (editor.getSettings().isShowingSpecialChars()) { // This is a simplification - we don't account for special characters not rendered in certain circumstances(based on surrounding // characters), so a premature wrapping can occur sometimes (as the representation using Unicode name is most certainly wider than the // original character). SpecialCharacterFragment specialCharacterFragment = SpecialCharacterFragment.create(myView, codePoint, null, 0); if (specialCharacterFragment != null) { return specialCharacterFragment.visualColumnToX(0, 1); } } return ComplementaryFontsRegistry.getFontAbleToDisplay(codePoint, fontStyle, editor.getColorsScheme().getFontPreferences(), myView.getFontRenderContext()).charWidth2D(codePoint); }