if (glyphUnicodes[i].length() == 1) { // not a ligature
Element glyphElement = glyphElements[i];
SVGGlyphElementBridge glyphBridge =
(SVGGlyphElementBridge)ctx.getBridge(glyphElement);
TextPaintInfo tpi = null;
if (aci != null) {
tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO);
}
Glyph glyph = glyphBridge.createGlyph
(ctx, glyphElement, textElement, i,
fontSize, fontFace, tpi);
glyphs.add(glyph);
foundMatchingGlyph = true;
break;
} else {
// glyphCodes[i] is a ligature so try and
// match the rest of the glyphCode chars
int current = ci.getIndex();
boolean matched = true;
for (int j = 1; j < glyphUnicodes[i].length(); j++) {
c = ci.next();
if (glyphUnicodes[i].charAt(j) != c) {
matched = false;
break;
}
}
if (matched) { // found a matching ligature!
Element glyphElement = glyphElements[i];
SVGGlyphElementBridge glyphBridge
= (SVGGlyphElementBridge)ctx.getBridge
(glyphElement);
TextPaintInfo tpi = null;
if (aci != null) {
aci.setIndex(ci.getIndex());
tpi = (TextPaintInfo)aci.getAttribute
(PAINT_INFO);
}
Glyph glyph = glyphBridge.createGlyph
(ctx, glyphElement, textElement, i,
fontSize, fontFace, tpi);
glyphs.add(glyph);
foundMatchingGlyph = true;
break;
} else {
// did not match ligature, keep looking
// for another glyph
c = ci.setIndex(current);
}
}
}
}
if (!foundMatchingGlyph) {
// add the missing glyph
SVGGlyphElementBridge glyphBridge =
(SVGGlyphElementBridge)ctx.getBridge(missingGlyphElement);
TextPaintInfo tpi = null;
if (aci != null) {
aci.setIndex(ci.getIndex());
tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO);
}
Glyph glyph = glyphBridge.createGlyph