public void initLineInfo(FontRenderContext frc) { float fontSize = 12; Float fsFloat = (Float)fontAttrs.get(TextAttribute.SIZE); if (fsFloat != null) fontSize = fsFloat.floatValue(); Iterator i = fontList.iterator(); while (i.hasNext()) { GVTFont font = (GVTFont)i.next(); GVTLineMetrics lm = font.getLineMetrics("", frc); this.ascent = lm.getAscent(); this.descent = lm.getDescent(); break; } if (ascent == -1) { ascent = fontSize * 0.8f; descent = fontSize * 0.2f; } }
public void initLineInfo(FontRenderContext frc) { float fontSize = 12; Float fsFloat = (Float)fontAttrs.get(TextAttribute.SIZE); if (fsFloat != null) fontSize = fsFloat; for (Object aFontList : fontList) { GVTFont font = (GVTFont) aFontList; GVTLineMetrics lm = font.getLineMetrics("", frc); this.ascent = lm.getAscent(); this.descent = lm.getDescent(); break; } if (ascent == -1) { ascent = fontSize * 0.8f; descent = fontSize * 0.2f; } }
public void initLineInfo(FontRenderContext frc) { float fontSize = 12; Float fsFloat = (Float)fontAttrs.get(TextAttribute.SIZE); if (fsFloat != null) fontSize = fsFloat; for (Object aFontList : fontList) { GVTFont font = (GVTFont) aFontList; GVTLineMetrics lm = font.getLineMetrics("", frc); this.ascent = lm.getAscent(); this.descent = lm.getDescent(); break; } if (ascent == -1) { ascent = fontSize * 0.8f; descent = fontSize * 0.2f; } }
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); }
protected void updateLineMetrics(int end) { GVTLineMetrics glm = font.getLineMetrics (aci, fontStart, end, frc); float ascent = glm.getAscent(); float descent = glm.getDescent(); float fontSz = font.getSize(); if (ascent > maxAscent) maxAscent = ascent; if (descent > maxDescent) maxDescent = descent; if (fontSz > maxFontSize) maxFontSize = fontSz; }
protected void updateLineMetrics(int end) { GVTLineMetrics glm = font.getLineMetrics (aci, fontStart, end, frc); float ascent = glm.getAscent(); float descent = glm.getDescent(); float fontSz = font.getSize(); if (ascent > maxAscent) maxAscent = ascent; if (descent > maxDescent) maxDescent = descent; if (fontSz > maxFontSize) maxFontSize = fontSz; }
protected void updateLineMetrics(int end) { GVTLineMetrics glm = font.getLineMetrics (aci, fontStart, end, frc); float ascent = glm.getAscent(); float descent = glm.getDescent(); float fontSz = font.getSize(); if (ascent > maxAscent) maxAscent = ascent; if (descent > maxDescent) maxDescent = descent; if (fontSz > maxFontSize) maxFontSize = fontSz; }
ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent(); if (descent < 0) {
ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent(); if (descent < 0) {
ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent(); if (descent < 0) {
("By", awtGlyphVector.getFontRenderContext()); ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent();
("By", awtGlyphVector.getFontRenderContext()); ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent();
("By", awtGlyphVector.getFontRenderContext()); ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent();
Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; float lastW = (float)(lastBounds.getWidth() + lastBounds.getX()); float lastH = (float)(halfLeading + lastLineMetrics.getAscent() + (lastBounds.getHeight() + lastBounds.getY())); Point2D visualAdvance;
Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; float lastW = (float)(lastBounds.getWidth() + lastBounds.getX()); float lastH = (float)(halfLeading + lastLineMetrics.getAscent() + (lastBounds.getHeight() + lastBounds.getY())); Point2D visualAdvance;
Rectangle2D lastBounds = lastMetrics.getBounds2D(); float halfLeading = (lastMetrics.getVerticalAdvance()- (lastLineMetrics.getAscent() + lastLineMetrics.getDescent()))/2; float lastW = (float)(lastBounds.getWidth() + lastBounds.getX()); float lastH = (float)(halfLeading + lastLineMetrics.getAscent() + (lastBounds.getHeight() + lastBounds.getY())); Point2D visualAdvance;
= vertical ? (float) gv.getLogicalBounds().getWidth() : (metrics.getAscent() + Math.abs(metrics.getDescent())); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; if (glyphOrientationAngle == 0) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc + (advY - (asc+dsc))/2; oy -= gm.getHorizontalAdvance(); } else if (glyphOrientationAngle == 180) { oy -= metrics.getAscent();