/** * Determine whether args 1 and 2 are words or bytes */ public boolean argsAreWords(int index) { return ((getFlag(index) & ARG_1_AND_2_ARE_WORDS) != 0); }
/** * Render a compound glyf */ 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); // transform the path path.transform (new AffineTransform (matrix)); // add it to the global path gp.append (path, false); } return gp; }
setComponents(componentArray); instr = new byte[0]; setInstructions(instr);
} else if (numContours == -1) { g = new GlyfCompound(); } else if (numContours > 0) {
/** * Render a compound glyf */ 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); // transform the path path.transform (new AffineTransform (matrix)); // add it to the global path gp.append (path, false); } return gp; }
setComponents(componentArray); instr = new byte[0]; setInstructions(instr);
} else if (numContours == -1) { g = new GlyfCompound(); } else if (numContours > 0) {
/** * Determine whether to round XY values to the grid */ public boolean roundXYToGrid(int index) { return ((getFlag(index) & ROUND_XY_TO_GRID) != 0); }
/** * Render a compound glyf */ 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); // transform the path path.transform (new AffineTransform (matrix)); // add it to the global path gp.append (path, false); } return gp; }
setComponents(componentArray); instr = new byte[0]; setInstructions(instr);
} else if (numContours == -1) { g = new GlyfCompound(); } else if (numContours > 0) {
/** * Use the metrics of this component for the compound */ public boolean useMetrics(int index) { return ((getFlag(index) & USE_MY_METRICS) != 0); }
/** * Determine whether args 1 and 2 are xy values or point indices */ public boolean argsAreXYValues(int index) { return ((getFlag(index) & ARGS_ARE_XY_VALUES) != 0); }
/** * Determine whether there are separate scales on X and Y */ protected boolean hasXYScale(int index) { return ((getFlag(index) & WE_HAVE_AN_X_AND_Y_SCALE) != 0); }
/** * Determine whether there are instructions */ protected boolean hasInstructions(int index) { return ((getFlag(index) & WE_HAVE_INSTRUCTIONS) != 0); }
/** * Determine whether args 1 and 2 are xy values or point indices */ public boolean argsAreXYValues(int index) { return ((getFlag(index) & ARGS_ARE_XY_VALUES) != 0); }
/** * Determine whether to round XY values to the grid */ public boolean roundXYToGrid(int index) { return ((getFlag(index) & ROUND_XY_TO_GRID) != 0); }
/** * Determine whether there is a simple scale */ public boolean hasAScale(int index) { return ((getFlag(index) & WE_HAVE_A_SCALE) != 0); }
/** * Determine whether there are instructions */ protected boolean hasInstructions(int index) { return ((getFlag(index) & WE_HAVE_INSTRUCTIONS) != 0); }
/** * This component overlaps the existing compound */ public boolean overlapCompound(int index) { return ((getFlag(index) & OVERLAP_COMPOUND) != 0); }