protected GeneralPath renderCompoundGlyph (GlyfTable glyf, GlyfCompound g) {
GeneralPath gp = new GeneralPath ();
for (int i = 0; i < g.getNumComponents (); i++) {
// find and render the component glyf
Glyf gl = glyf.getGlyph (g.getGlyphIndex (i));
GeneralPath path = null;
if (gl instanceof GlyfSimple) {
path = renderSimpleGlyph ((GlyfSimple) gl);
} else if (gl instanceof GlyfCompound) {
path = renderCompoundGlyph (glyf, (GlyfCompound) gl);
} else {
throw new RuntimeException (
"Unsupported glyph type " + gl.getClass ().getCanonicalName ());
}
// multiply the translations by units per em
double[] matrix = g.getTransform (i);