/** * Constructs an SVGGVTGlyphVector. * * @param font The font that is creating this glyph vector. * @param glyphs An array containing the glyphs that form the basis for this * glyph vector. * @param frc The current font render context. */ public SVGGVTGlyphVector(GVTFont font, Glyph[] glyphs, FontRenderContext frc) { this.font = font; this.glyphs = glyphs; this.frc = frc; outline = null; bounds2D = null; logicalBounds = null; glyphLogicalBounds = new Shape[glyphs.length]; glyphVisible = new boolean[glyphs.length]; for (int i = 0; i < glyphs.length; i++) { glyphVisible[i] = true; } endPos = glyphs[glyphs.length-1].getPosition(); endPos = new Point2D.Float ((float)(endPos.getX()+glyphs[glyphs.length-1].getHorizAdvX()), (float)endPos.getY()); }
/** * 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; }
/** * Constructs an SVGGVTGlyphVector. * * @param font The font that is creating this glyph vector. * @param glyphs An array containing the glyphs that form the basis for this * glyph vector. * @param frc The current font render context. */ public SVGGVTGlyphVector(GVTFont font, Glyph[] glyphs, FontRenderContext frc) { this.font = font; this.glyphs = glyphs; this.frc = frc; outline = null; bounds2D = null; logicalBounds = null; glyphLogicalBounds = new Shape[glyphs.length]; glyphVisible = new boolean[glyphs.length]; for (int i = 0; i < glyphs.length; i++) { glyphVisible[i] = true; } endPos = glyphs[glyphs.length-1].getPosition(); endPos = new Point2D.Float ((float)(endPos.getX()+glyphs[glyphs.length-1].getHorizAdvX()), (float)endPos.getY()); }
/** * Constructs an SVGGVTGlyphVector. * * @param font The font that is creating this glyph vector. * @param glyphs An array containing the glyphs that form the basis for this * glyph vector. * @param frc The current font render context. */ public SVGGVTGlyphVector(GVTFont font, Glyph[] glyphs, FontRenderContext frc) { this.font = font; this.glyphs = glyphs; this.frc = frc; outline = null; bounds2D = null; logicalBounds = null; glyphLogicalBounds = new Shape[glyphs.length]; glyphVisible = new boolean[glyphs.length]; for (int i = 0; i < glyphs.length; i++) { glyphVisible[i] = true; } endPos = glyphs[glyphs.length-1].getPosition(); endPos = new Point2D.Float ((float)(endPos.getX()+glyphs[glyphs.length-1].getHorizAdvX()), (float)endPos.getY()); }
/** * 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 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); }
/** * 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); }
float rEdge = currentX + bg.getHorizAdvX(); for (int k=i; k<j; k++) { g = glyphs[k]; g.setTransform(null); glyphLogicalBounds[i] = null; g.setPosition(new Point2D.Float(rEdge-g.getHorizAdvX(), currentY)); currentX += g.getHorizAdvX();
float rEdge = currentX + bg.getHorizAdvX(); for (int k=i; k<j; k++) { g = glyphs[k]; g.setTransform(null); glyphLogicalBounds[i] = null; g.setPosition(new Point2D.Float(rEdge-g.getHorizAdvX(), currentY)); currentX += g.getHorizAdvX();
float rEdge = currentX + bg.getHorizAdvX(); for (int k=i; k<j; k++) { g = glyphs[k]; g.setTransform(null); glyphLogicalBounds[i] = null; g.setPosition(new Point2D.Float(rEdge-g.getHorizAdvX(), currentY)); currentX += g.getHorizAdvX();