private GlyfCompositeComp getCompositeComp(int i) { for (GlyfCompositeComp c : components) { GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (c.getFirstIndex() <= i && gd != null && i < (c.getFirstIndex() + gd.getPointCount())) { return c; } } return null; }
/** * {@inheritDoc} */ @Override public int getPointCount() { if (!resolved) { LOG.error("getPointCount called on unresolved GlyfCompositeDescript"); } if (pointCount < 0) { GlyfCompositeComp c = components.get(components.size() - 1); GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (gd == null) { LOG.error("getGlypDescription(" + c.getGlyphIndex() + ") is null, returning 0"); pointCount = 0; } else { pointCount = c.getFirstIndex() + gd.getPointCount(); } } return pointCount; }
/** * Set the points of a glyph from the GlyphDescription. */ private Point[] describe(GlyphDescription gd) { int endPtIndex = 0; int endPtOfContourIndex = -1; Point[] points = new Point[gd.getPointCount()]; for (int i = 0; i < gd.getPointCount(); i++) { if (endPtOfContourIndex == -1) { endPtOfContourIndex = gd.getEndPtOfContours(endPtIndex); } boolean endPt = endPtOfContourIndex == i; if (endPt) { endPtIndex++; endPtOfContourIndex = -1; } points[i] = new Point(gd.getXCoordinate(i), gd.getYCoordinate(i), (gd.getFlags(i) & GlyfDescript.ON_CURVE) != 0, endPt); } return points; }
firstIndex += desc.getPointCount(); firstContour += desc.getContourCount();
private GlyfCompositeComp getCompositeComp(int i) { for (GlyfCompositeComp c : components) { GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (c.getFirstIndex() <= i && gd != null && i < (c.getFirstIndex() + gd.getPointCount())) { return c; } } return null; }
/** * {@inheritDoc} */ @Override public int getPointCount() { if (!resolved) { LOG.error("getPointCount called on unresolved GlyfCompositeDescript"); } if (pointCount < 0) { GlyfCompositeComp c = components.get(components.size() - 1); GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (gd == null) { LOG.error("getGlypDescription(" + c.getGlyphIndex() + ") is null, returning 0"); pointCount = 0; } else { pointCount = c.getFirstIndex() + gd.getPointCount(); } } return pointCount; }
private GlyfCompositeComp getCompositeComp(int i) { for (GlyfCompositeComp c : components) { GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (c.getFirstIndex() <= i && gd != null && i < (c.getFirstIndex() + gd.getPointCount())) { return c; } } return null; }
/** * {@inheritDoc} */ @Override public int getPointCount() { if (!resolved) { LOG.error("getPointCount called on unresolved GlyfCompositeDescript"); } if (pointCount < 0) { GlyfCompositeComp c = components.get(components.size() - 1); GlyphDescription gd = descriptions.get(c.getGlyphIndex()); if (gd == null) { LOG.error("getGlypDescription(" + c.getGlyphIndex() + ") is null, returning 0"); pointCount = 0; } else { pointCount = c.getFirstIndex() + gd.getPointCount(); } } return pointCount; }
/** * Set the points of a glyph from the GlyphDescription. */ private Point[] describe(GlyphDescription gd) { int endPtIndex = 0; int endPtOfContourIndex = -1; Point[] points = new Point[gd.getPointCount()]; for (int i = 0; i < gd.getPointCount(); i++) { if (endPtOfContourIndex == -1) { endPtOfContourIndex = gd.getEndPtOfContours(endPtIndex); } boolean endPt = endPtOfContourIndex == i; if (endPt) { endPtIndex++; endPtOfContourIndex = -1; } points[i] = new Point(gd.getXCoordinate(i), gd.getYCoordinate(i), (gd.getFlags(i) & GlyfDescript.ON_CURVE) != 0, endPt); } return points; }
/** * Set the points of a glyph from the GlyphDescription. */ private Point[] describe(GlyphDescription gd) { int endPtIndex = 0; int endPtOfContourIndex = -1; Point[] points = new Point[gd.getPointCount()]; for (int i = 0; i < gd.getPointCount(); i++) { if (endPtOfContourIndex == -1) { endPtOfContourIndex = gd.getEndPtOfContours(endPtIndex); } boolean endPt = endPtOfContourIndex == i; if (endPt) { endPtIndex++; endPtOfContourIndex = -1; } points[i] = new Point(gd.getXCoordinate(i), gd.getYCoordinate(i), (gd.getFlags(i) & GlyfDescript.ON_CURVE) != 0, endPt); } return points; }
firstIndex += desc.getPointCount(); firstContour += desc.getContourCount();
firstIndex += desc.getPointCount(); firstContour += desc.getContourCount();