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; }
/** * Returns the metrics of the glyph at the specified index into this * GlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int idx) { if (idx < 0 || (idx > glyphs.length-1)) throw new IndexOutOfBoundsException ("idx: " + idx + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + '.' ); // check to see if we should kern this glyph // I return the kerning information in the glyph metrics // as a first pass at implementation (I don't want to // fiddle with layout too much right now). if (idx < glyphs.length - 1) { // check for kerning if (font != null) { float hkern = font.getHKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); float vkern = font.getVKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); return glyphs[idx].getGlyphMetrics(hkern, vkern); } } // get a normal metrics return glyphs[idx].getGlyphMetrics(); }
this.charMap = charMap; this.metrics = font.getLineMetrics (aci, aci.getBeginIndex(), aci.getEndIndex(), frc); (frc, this.font.getSize(), this.aci); if ( this.gv != null ){ this.isAltGlyph = true; this.gv = font.createGlyphVector(frc, this.aci);
prevWI = theWI; } else if (prevWI != theWI) { GVTLineMetrics lm = gvtFont.getLineMetrics (aci, aciWordStart, aciIdx, frc); prevWI.addLineMetrics(gvtFont, lm); hideLast[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); advAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); break; space[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); lastAdvAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); default: GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm); GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm);
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; } }
int displayUpToIndex = font.canDisplayUpTo (aci, currentIndex, end);
String gvtFontFamily = gvtFont.getFamilyName(); if (gvtFont instanceof FOPGVTFont) { Font font = ((FOPGVTFont) gvtFont).getFont();
this.charMap = charMap; this.metrics = font.getLineMetrics (aci, aci.getBeginIndex(), aci.getEndIndex(), frc); (frc, this.font.getSize(), this.aci); if ( this.gv != null ){ this.isAltGlyph = true; this.gv = font.createGlyphVector(frc, this.aci);
prevWI = theWI; } else if (prevWI != theWI) { GVTLineMetrics lm = gvtFont.getLineMetrics (aci, aciWordStart, aciIdx, frc); prevWI.addLineMetrics(gvtFont, lm); hideLast[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); advAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); break; space[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); lastAdvAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); default: GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm); GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm);
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; } }
int displayUpToIndex = font.canDisplayUpTo (aci, currentIndex, end);
this.charMap = charMap; this.metrics = font.getLineMetrics (aci, aci.getBeginIndex(), aci.getEndIndex(), frc); (frc, this.font.getSize(), this.aci); if ( this.gv != null ){ this.isAltGlyph = true; this.gv = font.createGlyphVector(frc, this.aci);
/** * Returns the metrics of the glyph at the specified index into this * GlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int idx) { if (idx < 0 || (idx > glyphs.length-1)) throw new IndexOutOfBoundsException ("idx: " + idx + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + '.' ); // check to see if we should kern this glyph // I return the kerning information in the glyph metrics // as a first pass at implementation (I don't want to // fiddle with layout too much right now). if (idx < glyphs.length - 1) { // check for kerning if (font != null) { float hkern = font.getHKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); float vkern = font.getVKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); return glyphs[idx].getGlyphMetrics(hkern, vkern); } } // get a normal metrics return glyphs[idx].getGlyphMetrics(); }
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; }
prevWI = theWI; } else if (prevWI != theWI) { GVTLineMetrics lm = gvtFont.getLineMetrics (aci, aciWordStart, aciIdx, frc); prevWI.addLineMetrics(gvtFont, lm); hideLast[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); advAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); break; space[i] = true; nch = aci.next(); aci.previous(); kern = gvtFont.getHKern(pch, nch); lastAdvAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern); default: GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm); GVTLineMetrics lm = gvtFont.getLineMetrics (aci,aciWordStart, runLimit, frc); prevWI.addLineMetrics(gvtFont, lm);
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; } }
int displayUpToIndex = font.canDisplayUpTo (aci, currentIndex, end);
/** * Returns the metrics of the glyph at the specified index into this * GlyphVector. */ public GVTGlyphMetrics getGlyphMetrics(int idx) { if (idx < 0 || (idx > glyphs.length-1)) throw new IndexOutOfBoundsException ("idx: " + idx + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + '.' ); // check to see if we should kern this glyph // I return the kerning information in the glyph metrics // as a first pass at implementation (I don't want to // fiddle with layout too much right now). if (idx < glyphs.length - 1) { // check for kerning if (font != null) { float hkern = font.getHKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); float vkern = font.getVKern(glyphs[idx].getGlyphCode(), glyphs[idx+1].getGlyphCode()); return glyphs[idx].getGlyphMetrics(hkern, vkern); } } // get a normal metrics return glyphs[idx].getGlyphMetrics(); }
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; }
if (font != null) { GVTLineMetrics lineMetrics = font.getLineMetrics("By", frc); ascent = lineMetrics.getAscent(); descent = lineMetrics.getDescent();