@Override public GVTGlyphMetrics getGlyphMetrics(int arg0) { return new GVTGlyphMetrics(this.vec.getGlyphMetrics(arg0), 100000); }
/** * Returns the metrics of this Glyph if it is used in a horizontal layout. * * @return The glyph metrics. */ public GVTGlyphMetrics getGlyphMetrics() { if (metrics == null) { Rectangle2D gb = getGeometryBounds(); metrics = new GVTGlyphMetrics (getHorizAdvX(), getVertAdvY(), new Rectangle2D.Double(gb.getX()-position.getX(), gb.getY()-position.getY(), gb.getWidth(),gb.getHeight()), GlyphMetrics.COMPONENT); } return metrics; }
/** * Returns the metrics of this Glyph if it is used in a horizontal layout. * * @return The glyph metrics. */ public GVTGlyphMetrics getGlyphMetrics() { if (metrics == null) { Rectangle2D gb = getGeometryBounds(); metrics = new GVTGlyphMetrics (getHorizAdvX(), getVertAdvY(), new Rectangle2D.Double(gb.getX()-position.getX(), gb.getY()-position.getY(), gb.getWidth(),gb.getHeight()), GlyphMetrics.COMPONENT); } return metrics; }
/** * Returns the metrics of this Glyph if it is used in a horizontal layout. * * @return The glyph metrics. */ public GVTGlyphMetrics getGlyphMetrics() { if (metrics == null) { Rectangle2D gb = getGeometryBounds(); metrics = new GVTGlyphMetrics (getHorizAdvX(), getVertAdvY(), new Rectangle2D.Double(gb.getX()-position.getX(), gb.getY()-position.getY(), gb.getWidth(),gb.getHeight()), GlyphMetrics.COMPONENT); } return metrics; }
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) { Rectangle2D bbox = getBoundingBoxes()[glyphIndex]; return new GVTGlyphMetrics(positions[2 * (glyphIndex + 1)] - positions[2 * glyphIndex], (fontMetrics.getAscender(fontSize) - fontMetrics.getDescender(fontSize)) / 1000000f, bbox, GlyphMetrics.STANDARD); }
/** * Returns the metrics of this Glyph with the specified kerning value * applied. * * @param hkern The horizontal kerning value to apply when calculating * the glyph metrics. * @param vkern The horizontal vertical value to apply when calculating * the glyph metrics. * @return The kerned glyph metics */ public GVTGlyphMetrics getGlyphMetrics(float hkern, float vkern) { return new GVTGlyphMetrics(getHorizAdvX() - hkern, getVertAdvY() - vkern, getGeometryBounds(), GlyphMetrics.COMPONENT); }
/** * Returns the metrics of the glyph at the specified index into this * GVTGlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) { if (glyphMetrics[glyphIndex] != null) return glyphMetrics[glyphIndex]; // -- start glyph cache code -- Point2D glyphPos = defaultGlyphPositions[glyphIndex]; char c = ci.setIndex(ci.getBeginIndex()+glyphIndex); ci.setIndex(ci.getBeginIndex()); AWTGlyphGeometryCache.Value v = AWTGVTFont.getGlyphGeometry (gvtFont, c, awtGlyphVector, glyphIndex, glyphPos); Rectangle2D gmB = v.getBounds2D(); // -- end glyph cache code -- Rectangle2D bounds = new Rectangle2D.Double (gmB.getX() * scaleFactor, gmB.getY() * scaleFactor, gmB.getWidth() * scaleFactor, gmB.getHeight() * scaleFactor); // defaultGlyphPositions has one more entry than glyphs // the last entry stores the total advance for the // glyphVector. float adv = (float)(defaultGlyphPositions[glyphIndex+1].getX()- defaultGlyphPositions[glyphIndex] .getX()); glyphMetrics[glyphIndex] = new GVTGlyphMetrics ((float)(adv*scaleFactor), (ascent+descent), bounds, GlyphMetrics.STANDARD); return glyphMetrics[glyphIndex]; }
/** * Returns the metrics of the glyph at the specified index into this * GVTGlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) { if (glyphMetrics[glyphIndex] != null) return glyphMetrics[glyphIndex]; // -- start glyph cache code -- Point2D glyphPos = defaultGlyphPositions[glyphIndex]; char c = ci.setIndex(ci.getBeginIndex()+glyphIndex); ci.setIndex(ci.getBeginIndex()); AWTGlyphGeometryCache.Value v = AWTGVTFont.getGlyphGeometry (gvtFont, c, awtGlyphVector, glyphIndex, glyphPos); Rectangle2D gmB = v.getBounds2D(); // -- end glyph cache code -- Rectangle2D bounds = new Rectangle2D.Double (gmB.getX() * scaleFactor, gmB.getY() * scaleFactor, gmB.getWidth() * scaleFactor, gmB.getHeight() * scaleFactor); // defaultGlyphPositions has one more entry than glyphs // the last entry stores the total advance for the // glyphVector. float adv = (float)(defaultGlyphPositions[glyphIndex+1].getX()- defaultGlyphPositions[glyphIndex] .getX()); glyphMetrics[glyphIndex] = new GVTGlyphMetrics ((float)(adv*scaleFactor), (ascent+descent), bounds, GlyphMetrics.STANDARD); return glyphMetrics[glyphIndex]; }
/** * Returns the metrics of the glyph at the specified index into this * GVTGlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) { if (glyphMetrics[glyphIndex] != null) return glyphMetrics[glyphIndex]; // -- start glyph cache code -- Point2D glyphPos = defaultGlyphPositions[glyphIndex]; char c = ci.setIndex(ci.getBeginIndex()+glyphIndex); ci.setIndex(ci.getBeginIndex()); AWTGlyphGeometryCache.Value v = AWTGVTFont.getGlyphGeometry (gvtFont, c, awtGlyphVector, glyphIndex, glyphPos); Rectangle2D gmB = v.getBounds2D(); // -- end glyph cache code -- Rectangle2D bounds = new Rectangle2D.Double (gmB.getX() * scaleFactor, gmB.getY() * scaleFactor, gmB.getWidth() * scaleFactor, gmB.getHeight() * scaleFactor); // defaultGlyphPositions has one more entry than glyphs // the last entry stores the total advance for the // glyphVector. float adv = (float)(defaultGlyphPositions[glyphIndex+1].getX()- defaultGlyphPositions[glyphIndex] .getX()); glyphMetrics[glyphIndex] = new GVTGlyphMetrics ((float)(adv*scaleFactor), (ascent+descent), bounds, GlyphMetrics.STANDARD); return glyphMetrics[glyphIndex]; }
/** * Returns the metrics of this Glyph with the specified kerning value * applied. * * @param hkern The horizontal kerning value to apply when calculating * the glyph metrics. * @param vkern The horizontal vertical value to apply when calculating * the glyph metrics. * @return The kerned glyph metics */ public GVTGlyphMetrics getGlyphMetrics(float hkern, float vkern) { return new GVTGlyphMetrics(getHorizAdvX() - hkern, getVertAdvY() - vkern, getGeometryBounds(), GlyphMetrics.COMPONENT); }
/** * Returns the metrics of this Glyph with the specified kerning value * applied. * * @param hkern The horizontal kerning value to apply when calculating * the glyph metrics. * @param vkern The horizontal vertical value to apply when calculating * the glyph metrics. * @return The kerned glyph metics */ public GVTGlyphMetrics getGlyphMetrics(float hkern, float vkern) { return new GVTGlyphMetrics(getHorizAdvX() - hkern, getVertAdvY() - vkern, getGeometryBounds(), GlyphMetrics.COMPONENT); }