LineMetrics lm = firstFont.getLineMetrics(breaker.text, 0, 1, breaker.frc);
baselineOffsets = lm.getBaselineOffsets();
baselineIndex = lm.getBaselineIndex();
} else if (val instanceof GraphicAttribute) {
// Get first graphic attribute and use it
GraphicAttribute ga = (GraphicAttribute) val;
int align = ga.getAlignment();
if (
align == GraphicAttribute.TOP_ALIGNMENT ||
align == GraphicAttribute.BOTTOM_ALIGNMENT
) {
baselineIndex = GraphicAttribute.ROMAN_BASELINE;
} else {
baselineIndex = align;
}
baselineOffsets = new float[3];
baselineOffsets[0] = 0;
baselineOffsets[1] = (ga.getDescent() - ga.getAscent()) / 2.f;
baselineOffsets[2] = -ga.getAscent();
} else { // Use defaults - Roman baseline and zero offsets
baselineIndex = GraphicAttribute.ROMAN_BASELINE;
baselineOffsets = new float[3];
}