* leading edge.
*/
public TextHit hitTestChar(float x, float y) {
syncLayout();
TextHit textHit = null;
int currentChar = 0;
for (int i = 0; i < gv.getNumGlyphs(); i++) {
Shape gbounds = gv.getGlyphLogicalBounds(i);
if (gbounds != null) {
Rectangle2D gbounds2d = gbounds.getBounds2D();
// System.out.println("Hit Test: [" + x + ", " + y + "] - " +
// gbounds2d);
if (gbounds.contains(x, y)) {
boolean isRightHalf =
(x > (gbounds2d.getX()+(gbounds2d.getWidth()/2d)));
boolean isLeadingEdge = !isRightHalf;
int charIndex = charMap[currentChar];
textHit = new TextHit(charIndex, isLeadingEdge);
return textHit;
}
}
currentChar += getCharacterCount(i, i);
if (currentChar >= charMap.length)