Point2D (int glyphIndex) { double x = 0; if (myCharWidthFunction == null) { x = glyphIndex * myCharWidth; } else { for (int i = 0; i < glyphIndex; i++) { x += myCharWidthFunction.applyAsDouble(myChars[getGlyphCharIndex(i)]); } } return new Point2D.Double(x, 0); }