in src/main/java/com/intellij/util/ui/UIUtilities.java [998:1024]
public int getLeftSideBearing(char aChar) {
int index = aChar - MIN_CHAR_INDEX;
assert (index >= 0 && index < (MAX_CHAR_INDEX - MIN_CHAR_INDEX));
byte lsb = lsbCache[index];
if (lsb == UNSET) {
oneChar[0] = aChar;
GlyphVector gv = font.createGlyphVector(frc, oneChar);
lsb = (byte) gv.getGlyphPixelBounds(0, frc, 0f, 0f).x;
if (lsb < 0) {
/* HRGB/HBGR LCD glyph images will always have a pixel
* on the left used in colour fringe reduction.
* Text rendering positions this correctly but here
* we are using the glyph image to adjust that position
* so must account for it.
*/
Object aaHint = frc.getAntiAliasingHint();
if (aaHint == VALUE_TEXT_ANTIALIAS_LCD_HRGB ||
aaHint == VALUE_TEXT_ANTIALIAS_LCD_HBGR) {
lsb++;
}
}
lsbCache[index] = lsb;
}
return lsb;
}