@Override public GVTGlyphMetrics getGlyphMetrics(int arg0) { return new GVTGlyphMetrics(this.vec.getGlyphMetrics(arg0), 100000); }
public Shape getGlyphLogicalBounds(int glyphIndex) { GVTGlyphMetrics metrics = getGlyphMetrics(glyphIndex); Point2D pos = getGlyphPosition(glyphIndex); GVTLineMetrics fontMetrics = font.getLineMetrics(0); Rectangle2D bounds = new Rectangle2D.Float(0, -fontMetrics.getDescent(), metrics.getHorizontalAdvance(), fontMetrics.getAscent() + fontMetrics.getDescent()); AffineTransform t = AffineTransform.getTranslateInstance(pos.getX(), pos.getY()); AffineTransform transf = getGlyphTransform(glyphIndex); if (transf != null) { t.concatenate(transf); } t.scale(1, -1); // Translate from glyph coordinate system to user return t.createTransformedShape(bounds); }
layout.getGlyphMetrics(layout.getGlyphCount()-1); GVTLineMetrics lastLineMetrics = layout.getLineMetrics(); Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; visualAdvance = new Point2D.Float( (float) (chunk.advance.getX()), (float) (chunk.advance.getY() + lastH - lastMetrics.getVerticalAdvance())); } else { Point2D advance = chunk.advance; yScale = (float) ((length.floatValue() - lastH) / (advance.getY() - lastMetrics.getVerticalAdvance())); } else { double adv =(advance.getY() + lastH - lastMetrics.getVerticalAdvance()); yScale = (float)(length.floatValue()/adv); xScale = (float) ((length.floatValue() - lastW) / (advance.getX() - lastMetrics.getHorizontalAdvance())); } else { double adv = (advance.getX() + lastW - lastMetrics.getHorizontalAdvance()); xScale = (float)(length.floatValue()/adv);
float glyphWidth = (float)(glyphMetrics.getHorizontalAdvance()/ scaleFactor); float glyphHeight = (float)(glyphMetrics.getVerticalAdvance()/ scaleFactor); Rectangle2D glyphBounds = new Rectangle2D.Double(glyphX,
if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); descent = (float)(glyphBounds.getHeight()-ascent); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), ascent+descent);
while ((gm.getBounds2D().getWidth()<0.01d) || gm.isWhitespace()) { if (!inWS) inWS = true; if (i == numGlyphs-1) {
layout.getGlyphMetrics(layout.getGlyphCount()-1); GVTLineMetrics lastLineMetrics = layout.getLineMetrics(); Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; visualAdvance = new Point2D.Float( (float) (chunk.advance.getX()), (float) (chunk.advance.getY() + lastH - lastMetrics.getVerticalAdvance())); } else { Point2D advance = chunk.advance; yScale = (float) ((length - lastH) / (advance.getY() - lastMetrics.getVerticalAdvance())); } else { double adv =(advance.getY() + lastH - lastMetrics.getVerticalAdvance()); yScale = (float)(length /adv); xScale = (float) ((length - lastW) / (advance.getX() - lastMetrics.getHorizontalAdvance())); } else { double adv = (advance.getX() + lastW - lastMetrics.getHorizontalAdvance()); xScale = (float)(length /adv);
float glyphWidth = (float)(glyphMetrics.getHorizontalAdvance()/ scaleFactor); float glyphHeight = (float)(glyphMetrics.getVerticalAdvance()/ scaleFactor); Rectangle2D glyphBounds = new Rectangle2D.Double(glyphX,
if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); descent = (float)(glyphBounds.getHeight()-ascent); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), ascent+descent);
while ((gm.getBounds2D().getWidth()<0.01d) || gm.isWhitespace()) { if (!inWS) inWS = true; if (i == numGlyphs-1) {
float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); if ((glyphOrientationAngle == 270)) { horizontalFirstOffset = (float)gm.getBounds2D().getHeight(); } else { if (glyphOrientationAuto && (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); ox += horizontalFirstOffset; if (glyphOrientationAngle == 90) { oy -= gm.getHorizontalAdvance(); } else if (glyphOrientationAngle == 180) { oy -= metrics.getAscent(); if (glyphOrientationAuto) { if (isLatinChar(ch)) { advanceY = gm.getHorizontalAdvance(); } else {
/** * 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; }
float glyphWidth = (float)(glyphMetrics.getHorizontalAdvance()/ scaleFactor); float glyphHeight = (float)(glyphMetrics.getVerticalAdvance()/ scaleFactor); Rectangle2D glyphBounds = new Rectangle2D.Double(glyphX,
if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = glyphMetrics.getBounds2D(); ascent = (float)(-glyphBounds.getMinY()); descent = (float)(glyphBounds.getHeight()-ascent); GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Rectangle2D glyphBounds = new Rectangle2D.Double (0, -ascent, glyphMetrics.getHorizontalAdvance(), ascent+descent);
while ((gm.getBounds2D().getWidth()<0.01d) || gm.isWhitespace()) { if (!inWS) inWS = true; if (i == numGlyphs-1) {
protected Point2D getEndPoint(CharacterInformation info){ GVTGlyphVector it = info.layout.getGlyphVector(); if (!it.isGlyphVisible(info.glyphIndexEnd)) return null; Point2D b = it.getGlyphPosition(info.glyphIndexEnd); AffineTransform glyphTransform; glyphTransform = it.getGlyphTransform(info.glyphIndexEnd); GVTGlyphMetrics metrics = it.getGlyphMetrics(info.glyphIndexEnd); Point2D.Float result = new Point2D.Float (metrics.getHorizontalAdvance(), 0); if ( glyphTransform != null ) glyphTransform.transform(result,result); result.x += b.getX(); result.y += b.getY(); return result; }
float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); if ((glyphOrientationAngle == 270)) { horizontalFirstOffset = (float)gm.getBounds2D().getHeight(); } else { if (glyphOrientationAuto && (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); ox += horizontalFirstOffset; if (glyphOrientationAngle == 90) { oy -= gm.getHorizontalAdvance(); } else if (glyphOrientationAngle == 180) { oy -= metrics.getAscent(); if (glyphOrientationAuto) { if (isLatinChar(ch)) { advanceY = gm.getHorizontalAdvance(); } else {
/** * 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; }
protected Point2D getEndPoint(CharacterInformation info){ GVTGlyphVector it = info.layout.getGlyphVector(); if (!it.isGlyphVisible(info.glyphIndexEnd)) return null; Point2D b = it.getGlyphPosition(info.glyphIndexEnd); AffineTransform glyphTransform; glyphTransform = it.getGlyphTransform(info.glyphIndexEnd); GVTGlyphMetrics metrics = it.getGlyphMetrics(info.glyphIndexEnd); Point2D.Float result = new Point2D.Float (metrics.getHorizontalAdvance(), 0); if ( glyphTransform != null ) glyphTransform.transform(result,result); result.x += b.getX(); result.y += b.getY(); return result; }
layout.getGlyphMetrics(layout.getGlyphCount()-1); GVTLineMetrics lastLineMetrics = layout.getLineMetrics(); Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; visualAdvance = new Point2D.Float( (float) (chunk.advance.getX()), (float) (chunk.advance.getY() + lastH - lastMetrics.getVerticalAdvance())); } else { Point2D advance = chunk.advance; yScale = (float) ((length - lastH) / (advance.getY() - lastMetrics.getVerticalAdvance())); } else { double adv =(advance.getY() + lastH - lastMetrics.getVerticalAdvance()); yScale = (float)(length /adv); xScale = (float) ((length - lastW) / (advance.getX() - lastMetrics.getHorizontalAdvance())); } else { double adv = (advance.getX() + lastW - lastMetrics.getHorizontalAdvance()); xScale = (float)(length /adv);