/** * Returns the logical bounds of the specified glyph within this * GlyphVector. */ public Shape getGlyphLogicalBounds(int glyphIndex) { if (glyphLogicalBounds[glyphIndex] == null && glyphVisible[glyphIndex]) { computeGlyphLogicalBounds(); } return glyphLogicalBounds[glyphIndex]; }
/** * Returns the bounding box of the specified glyph, considering only the * glyph's metrics (ascent, descent, advance) rather than the actual glyph * shape. */ public Rectangle2D getGlyphCellBounds(int glyphIndex) { return getGlyphLogicalBounds(glyphIndex).getBounds2D(); }
/** * Returns the geometric bounds of this GlyphVector. The geometric * bounds is the tightest rectangle enclosing the geometry of the * glyph vector (not including stroke). */ public Rectangle2D getGeometricBounds() { return getOutline().getBounds2D(); }
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { AffineTransform glyphTransform = getGlyphTransform(i); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), Point2D p3 = new Point2D.Double(glyphBounds.getMinX(), glyphBounds.getMaxY()); Point2D gpos = getGlyphPosition(i); AffineTransform tr = AffineTransform.getTranslateInstance (gpos.getX(), gpos.getY()); for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) {
/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
(ctx, textElement, fontSize, aci); if (glyphArray != null) { return new SVGGVTGlyphVector(null, glyphArray, frc);
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { AffineTransform glyphTransform = getGlyphTransform(i); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), Point2D p3 = new Point2D.Double(glyphBounds.getMinX(), glyphBounds.getMaxY()); Point2D gpos = getGlyphPosition(i); AffineTransform tr = AffineTransform.getTranslateInstance (gpos.getX(), gpos.getY()); for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) {
/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
(ctx, textElement, fontSize, aci); if (glyphArray != null) { return new SVGGVTGlyphVector(null, glyphArray, frc);
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { AffineTransform glyphTransform = getGlyphTransform(i); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), Point2D p3 = new Point2D.Double(glyphBounds.getMinX(), glyphBounds.getMaxY()); Point2D gpos = getGlyphPosition(i); AffineTransform tr = AffineTransform.getTranslateInstance (gpos.getX(), gpos.getY()); for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) {
/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
/** * Returns the geometric bounds of this GlyphVector. The geometric * bounds is the tightest rectangle enclosing the geometry of the * glyph vector (not including stroke). */ public Rectangle2D getGeometricBounds() { return getOutline().getBounds2D(); }
(ctx, textElement, fontSize, aci); if (glyphArray != null) { return new SVGGVTGlyphVector(null, glyphArray, frc);
/** * Returns the logical bounds of the specified glyph within this * GlyphVector. */ public Shape getGlyphLogicalBounds(int glyphIndex) { if (glyphLogicalBounds[glyphIndex] == null && glyphVisible[glyphIndex]) { computeGlyphLogicalBounds(); } return glyphLogicalBounds[glyphIndex]; }
/** * Returns the bounding box of the specified glyph, considering only the * glyph's metrics (ascent, descent, advance) rather than the actual glyph * shape. */ public Rectangle2D getGlyphCellBounds(int glyphIndex) { return getGlyphLogicalBounds(glyphIndex).getBounds2D(); }
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }
/** * Returns the geometric bounds of this GlyphVector. The geometric * bounds is the tightest rectangle enclosing the geometry of the * glyph vector (not including stroke). */ public Rectangle2D getGeometricBounds() { return getOutline().getBounds2D(); }
return new SVGGVTGlyphVector(this, glyphArray, frc);