float x0 = visualPositions[glyphIndex*2];
float y0 = visualPositions[glyphIndex*2+1];
float advanceX = glyph.getGlyphPointMetrics().getAdvanceX();
GeneralPath gp = new GeneralPath();
gp.moveTo(0, -ascent - leading);
gp.lineTo(advanceX ,-ascent - leading);
gp.lineTo(advanceX, descent);
gp.lineTo(0, descent);
gp.lineTo(0, -ascent - leading);
gp.closePath();
/* Applying GlyphVector font transform */
AffineTransform at = (AffineTransform)this.transform.clone();
/* Applying Glyph transform */
AffineTransform glyphTransform = getGlyphTransform(glyphIndex);
if (glyphTransform != null){
at.concatenate(glyphTransform);
}
/* Applying translation to actual visual bounds */
at.preConcatenate(AffineTransform.getTranslateInstance(x0, y0));
gp.transform(at);
return gp;
}