private int getGlyphCode (Font font, int codePoint) { char[] chars = Character.toChars(codePoint); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); return vector.getGlyphCode(0); } }
private int getGlyphCode (Font font, int codePoint) { char[] chars = Character.toChars(codePoint); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); return vector.getGlyphCode(0); } }
/** Queues the glyphs in the specified text to be loaded. Note that the glyphs are not actually loaded until * {@link #loadGlyphs()} is called. */ public void addGlyphs (String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); char[] chars = text.toCharArray(); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); for (int i = 0, n = vector.getNumGlyphs(); i < n; i++) { int codePoint = text.codePointAt(vector.getGlyphCharIndex(i)); Rectangle bounds = getGlyphBounds(vector, i, codePoint); getGlyph(vector.getGlyphCode(i), codePoint, bounds, vector, i); } }
/** Queues the glyphs in the specified text to be loaded. Note that the glyphs are not actually loaded until * {@link #loadGlyphs()} is called. */ public void addGlyphs (String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); char[] chars = text.toCharArray(); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); for (int i = 0, n = vector.getNumGlyphs(); i < n; i++) { int codePoint = text.codePointAt(vector.getGlyphCharIndex(i)); Rectangle bounds = getGlyphBounds(vector, i, codePoint); getGlyph(vector.getGlyphCode(i), codePoint, bounds, vector, i); } }
/** @return May be null. */ private Glyph getGlyph (char c) { char[] chars = {c}; GlyphVector vector = unicodeFont.getFont().layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); Rectangle bounds = vector.getGlyphPixelBounds(0, GlyphPage.renderContext, 0, 0); return unicodeFont.getGlyph(vector.getGlyphCode(0), c, bounds, vector, 0); }
/** @return May be null. */ private Glyph getGlyph (char c) { char[] chars = {c}; GlyphVector vector = unicodeFont.getFont().layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); Rectangle bounds = vector.getGlyphPixelBounds(0, GlyphPage.renderContext, 0, 0); return unicodeFont.getGlyph(vector.getGlyphCode(0), c, bounds, vector, 0); }
Glyph glyph = getGlyph(vector.getGlyphCode(glyphIndex), codePoint, bounds, vector, glyphIndex);
Glyph glyph = getGlyph(vector.getGlyphCode(glyphIndex), codePoint, bounds, vector, glyphIndex);
@Override public int getGlyphCode(int idx) { return this.vec.getGlyphCode(idx); }
/** * Returns the glyphcode of the specified glyph. */ public int getGlyphCode(int glyphIndex) { return awtGlyphVector.getGlyphCode(glyphIndex); }
/** * Returns the glyphcode of the specified glyph. */ public int getGlyphCode(int glyphIndex) { return awtGlyphVector.getGlyphCode(glyphIndex); }
/** * Returns the glyphcode of the specified glyph. */ public int getGlyphCode(int glyphIndex) { return awtGlyphVector.getGlyphCode(glyphIndex); }
public int getGlyphCode(int i) { return javaGV.getGlyphCode(i); }
private int getGlyphCode (Font font, int codePoint) { char[] chars = Character.toChars(codePoint); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); return vector.getGlyphCode(0); } }
@SuppressWarnings({"CovariantEquals"}) @Override public boolean equals(GlyphVector that) { for (int i = 0, n = getNumGlyphs(); i < n; i++) { if (getGlyphCode(i) != that.getGlyphCode(i)) { return false; } } return true; }
/** Queues the glyphs in the specified text to be loaded. Note that the glyphs are not actually loaded until * {@link #loadGlyphs()} is called. */ public void addGlyphs (String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); char[] chars = text.toCharArray(); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); for (int i = 0, n = vector.getNumGlyphs(); i < n; i++) { int codePoint = text.codePointAt(vector.getGlyphCharIndex(i)); Rectangle bounds = getGlyphBounds(vector, i, codePoint); getGlyph(vector.getGlyphCode(i), codePoint, bounds, vector, i); } }
int glyphCount = 0; for (int i = 0; i < glyphs.length; i++) { int code = glyphVector.getGlyphCode(i); if (code == 0xFFFE || code == 0xFFFF) {// considered non-glyphs by
/** * Queues the glyphs in the specified text to be loaded. Note that the glyphs are not actually loaded until * {@link #loadGlyphs()} is called. * * @param text The text containing the glyphs to be added */ public void addGlyphs(String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); char[] chars = text.toCharArray(); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); for (int i = 0, n = vector.getNumGlyphs(); i < n; i++) { int codePoint = text.codePointAt(vector.getGlyphCharIndex(i)); Rectangle bounds = getGlyphBounds(vector, i, codePoint); getGlyph(vector.getGlyphCode(i), codePoint, bounds, vector, i); } }
private Glyph getGlyph(final int unicodeID, final GlyphVector singleUnicodeGlyphVector, final GlyphMetrics metrics) { final int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0); // Have seen huge glyph codes (65536) coming out of some fonts in some Unicode situations if (glyphCode >= glyphCache.length) { return null; } final Glyph glyph = new Glyph(unicodeID, glyphCode, metrics.getAdvance(), singleUnicodeGlyphVector, this); register(glyph); return glyph; } }
/** @return May be null. */ private Glyph getGlyph (char c) { char[] chars = {c}; GlyphVector vector = unicodeFont.getFont().layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); Rectangle bounds = vector.getGlyphPixelBounds(0, GlyphPage.renderContext, 0, 0); return unicodeFont.getGlyph(vector.getGlyphCode(0), c, bounds, vector, 0); }