/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { return gv.getCharacterCount(startGlyphIndex, endGlyphIndex); }
/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { return gv.getCharacterCount(startGlyphIndex, endGlyphIndex); }
/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { return gv.getCharacterCount(startGlyphIndex, endGlyphIndex); }
/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { int idx1 = getGVIdx(startGlyphIndex); int idx2 = getGVIdx(endGlyphIndex); int ret=0; for (int idx=idx1; idx<=idx2; idx++) { int gi1 = startGlyphIndex-off[idx]; int gi2 = endGlyphIndex-off[idx]; if (gi2 >= nGlyphs[idx]) { gi2 = nGlyphs[idx]-1; } ret += gvs[idx].getCharacterCount(gi1, gi2); startGlyphIndex += (gi2-gi1+1); } return ret; }
/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { int idx1 = getGVIdx(startGlyphIndex); int idx2 = getGVIdx(endGlyphIndex); int ret=0; for (int idx=idx1; idx<=idx2; idx++) { int gi1 = startGlyphIndex-off[idx]; int gi2 = endGlyphIndex-off[idx]; if (gi2 >= nGlyphs[idx]) { gi2 = nGlyphs[idx]-1; } ret += gvs[idx].getCharacterCount(gi1, gi2); startGlyphIndex += (gi2-gi1+1); } return ret; }
/** * Returns the number of chars represented by the glyphs within the * specified range. * * @param startGlyphIndex The index of the first glyph in the range. * @param endGlyphIndex The index of the last glyph in the range. * @return The number of chars. */ public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) { int idx1 = getGVIdx(startGlyphIndex); int idx2 = getGVIdx(endGlyphIndex); int ret=0; for (int idx=idx1; idx<=idx2; idx++) { int gi1 = startGlyphIndex-off[idx]; int gi2 = endGlyphIndex-off[idx]; if (gi2 >= nGlyphs[idx]) { gi2 = nGlyphs[idx]-1; } ret += gvs[idx].getCharacterCount(gi1, gi2); startGlyphIndex += (gi2-gi1+1); } return ret; }
/** * Draws the glyph vector. */ public void draw(Graphics2D g2d, AttributedCharacterIterator aci) { int begin = aci.getBeginIndex(); for (GVTGlyphVector gv : gvs) { int end = gv.getCharacterCount(0, gv.getNumGlyphs()) + 1; gv.draw(g2d, new AttributedCharacterSpanIterator(aci, begin, end)); begin = end; } }
/** * Draws the glyph vector. */ public void draw(Graphics2D g2d, AttributedCharacterIterator aci) { int begin = aci.getBeginIndex(); for (GVTGlyphVector gv : gvs) { int end = gv.getCharacterCount(0, gv.getNumGlyphs()) + 1; gv.draw(g2d, new AttributedCharacterSpanIterator(aci, begin, end)); begin = end; } }
/** * Draws the glyph vector. */ public void draw(Graphics2D g2d, AttributedCharacterIterator aci) { int begin = aci.getBeginIndex(); for (int idx=0; idx<gvs.length; idx++) { GVTGlyphVector gv = gvs[idx]; int end = gv.getCharacterCount(0, gv.getNumGlyphs())+1; gv.draw(g2d, new AttributedCharacterSpanIterator(aci, begin, end)); begin = end; } }
/** * Returns the bounds of this GlyphVector. This includes * stroking effects. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { Rectangle2D ret = null; int begin = aci.getBeginIndex(); for (int idx=0; idx<gvs.length; idx++) { GVTGlyphVector gv = gvs[idx]; int end = gv.getCharacterCount(0, gv.getNumGlyphs())+1; Rectangle2D b = gvs[idx].getBounds2D (new AttributedCharacterSpanIterator(aci, begin, end)); if (ret == null) ret = b; //else ret = ret.createUnion(b); else ret.add(b); begin = end; } return ret; }
currentChar += gv.getCharacterCount(i,i); if (currentChar >= charMap.length) currentChar = charMap.length-1;
/** * Returns the bounds of this GlyphVector. This includes * stroking effects. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { Rectangle2D ret = null; int begin = aci.getBeginIndex(); for (GVTGlyphVector gv : gvs) { int end = gv.getCharacterCount(0, gv.getNumGlyphs()) + 1; Rectangle2D b = gv.getBounds2D (new AttributedCharacterSpanIterator(aci, begin, end)); if (ret == null) ret = b; //else ret = ret.createUnion(b); else ret.add(b); begin = end; } return ret; }
/** * Returns the bounds of this GlyphVector. This includes * stroking effects. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { Rectangle2D ret = null; int begin = aci.getBeginIndex(); for (GVTGlyphVector gv : gvs) { int end = gv.getCharacterCount(0, gv.getNumGlyphs()) + 1; Rectangle2D b = gv.getBounds2D (new AttributedCharacterSpanIterator(aci, begin, end)); if (ret == null) ret = b; //else ret = ret.createUnion(b); else ret.add(b); begin = end; } return ret; }
ch = aci.setIndex(aciIdx); idx++; charCount = gv.getCharacterCount(idx,idx); if (idx == numGlyphs) return;
ch = aci.setIndex(aciIdx); idx++; charCount = gv.getCharacterCount(idx,idx); if (idx == numGlyphs) return;
ch = aci.setIndex(aciIdx); idx++; charCount = gv.getCharacterCount(idx,idx); if (idx == numGlyphs) return;
public GlyphIterator(AttributedCharacterIterator aci, GVTGlyphVector gv) { this.aci = aci; this.gv = gv; this.idx = 0; this.chIdx = 0; this.lineIdx = 0; this.aciIdx = aci.getBeginIndex(); this.charCount = gv.getCharacterCount(idx, idx); this.ch = aci.first(); this.frc = gv.getFontRenderContext(); this.font = (GVTFont)aci.getAttribute(GVT_FONT); if (font == null) { font = new AWTGVTFont(aci.getAttributes()); } fontStart = aciIdx; this.maxFontSize = -Float.MAX_VALUE; this.maxAscent = -Float.MAX_VALUE; this.maxDescent = -Float.MAX_VALUE; // Figure out where the font size might change again... this.runLimit = aci.getRunLimit(TEXT_COMPOUND_ID); this.lineBreakRunLimit = aci.getRunLimit(FLOW_LINE_BREAK); Object o = aci.getAttribute(FLOW_LINE_BREAK); this.lineBreakCount = (o == null)?0:1; this.numGlyphs = gv.getNumGlyphs(); this.gp = gv.getGlyphPositions(0, this.numGlyphs+1, null); this.gvBase = new Point2D.Float(gp[0], gp[1]); this.adv = getCharWidth(); this.adj = getCharAdvance(); }
public GlyphIterator(AttributedCharacterIterator aci, GVTGlyphVector gv) { this.aci = aci; this.gv = gv; this.idx = 0; this.chIdx = 0; this.lineIdx = 0; this.aciIdx = aci.getBeginIndex(); this.charCount = gv.getCharacterCount(idx, idx); this.ch = aci.first(); this.frc = gv.getFontRenderContext(); this.font = (GVTFont)aci.getAttribute(GVT_FONT); if (font == null) { font = new AWTGVTFont(aci.getAttributes()); } fontStart = aciIdx; this.maxFontSize = -Float.MAX_VALUE; this.maxAscent = -Float.MAX_VALUE; this.maxDescent = -Float.MAX_VALUE; // Figure out where the font size might change again... this.runLimit = aci.getRunLimit(TEXT_COMPOUND_ID); this.lineBreakRunLimit = aci.getRunLimit(FLOW_LINE_BREAK); Object o = aci.getAttribute(FLOW_LINE_BREAK); this.lineBreakCount = (o == null)?0:1; this.numGlyphs = gv.getNumGlyphs(); this.gp = gv.getGlyphPositions(0, this.numGlyphs+1, null); this.gvBase = new Point2D.Float(gp[0], gp[1]); this.adv = getCharWidth(); this.adj = getCharAdvance(); }
public GlyphIterator(AttributedCharacterIterator aci, GVTGlyphVector gv) { this.aci = aci; this.gv = gv; this.idx = 0; this.chIdx = 0; this.lineIdx = 0; this.aciIdx = aci.getBeginIndex(); this.charCount = gv.getCharacterCount(idx, idx); this.ch = aci.first(); this.frc = gv.getFontRenderContext(); this.font = (GVTFont)aci.getAttribute(GVT_FONT); if (font == null) { font = new AWTGVTFont(aci.getAttributes()); } fontStart = aciIdx; this.maxFontSize = -Float.MAX_VALUE; this.maxAscent = -Float.MAX_VALUE; this.maxDescent = -Float.MAX_VALUE; // Figure out where the font size might change again... this.runLimit = aci.getRunLimit(TEXT_COMPOUND_ID); this.lineBreakRunLimit = aci.getRunLimit(FLOW_LINE_BREAK); Object o = aci.getAttribute(FLOW_LINE_BREAK); this.lineBreakCount = (o == null)?0:1; this.numGlyphs = gv.getNumGlyphs(); this.gp = gv.getGlyphPositions(0, this.numGlyphs+1, null); this.gvBase = new Point2D.Float(gp[0], gp[1]); this.adv = getCharWidth(); this.adj = getCharAdvance(); }
int cnt = gv.getCharacterCount(i,i); aci.setIndex(aciIdx); Integer integer = (Integer)aci.getAttribute(WORD_LIMIT); int chCnt = gv.getCharacterCount(i,i); if (chCnt == 1) { char nch;