float _ascent, float _descent, float _maxCharWidth) {*/
// System.out.println("LineMetricsImpl");
LineMetricsImpl lm;
if (USE_CONSTANT_METRICS) {
float height = size;
float ascent = canDisplay('H') ?
getGlyph('H').getHeight() :
(height *3) /4;
float descent = canDisplay('p') ?
(float) getGlyph('p').getGlyphMetrics().getBounds2D().getMaxY() :
height / 4;
lm = new LineMetricsImpl(
str.length(), //_numChars number of chars
0, //_baseLineIndex index of the baseline offset
new float[]{0, (-ascent+descent)/2, -ascent}, //_baselineOffsets an array of baseline offsets
ascent/13, //_underlineThickness underline thickness
-descent/2, //_underlineOffset underline offset
ascent/13, //_strikethroughThickness strikethrough thickness
ascent/2, //_strikethroughOffset strinkethrough offset
height - ascent- descent, //_leading leading of the font
height, //_height font height
ascent, //_ascent ascent of the font
descent, //_descent descent of the font
canDisplay('W') ? getGlyph('W').getWidth() : getGlyph(' ').getWidth()); //_maxCharWidth max char width
} else {
float[] metrics = getLineMetrics(pFont);
lm = new LineMetricsImpl(
str.length(), //_numChars number of chars
0, //_baseLineIndex index of the baseline offset
new float[]{0, (-metrics[0]+metrics[1])*size/2, -metrics[0]*size}, //_baselineOffsets an array of baseline offsets
metrics[3]*size, //_underlineThickness underline thickness
metrics[4]*size, //_underlineOffset underline offset
metrics[5]*size, //_strikethroughThickness strikethrough thickness
metrics[6]*size, //_strikethroughOffset strinkethrough offset
metrics[2]*size, //_leading leading of the font
(metrics[0] + metrics[1] + metrics[2])*size, //_height font height
metrics[0]*size, //_ascent ascent of the font
metrics[1]*size, //_descent descent of the font
metrics[7]*size); //_maxCharWidth max char width
}
if ((at != null) && (!at.isIdentity())){
lm.scale((float)at.getScaleX(), (float)at.getScaleY());
}
return lm;
}