/** * 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(); }
/** * 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(); }
/** * 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(); }