/** * Returns the index of the last glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getLastGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=charMap.length-1; for (int i = numGlyphs-1; i >= 0; --i) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j--]; if (charIndex == glyphCharIndex) return i; if (j < 0) return -1; } } return -1; }
/** * Returns the index of the first glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=0; for (int i = 0; i < numGlyphs; i++) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j++]; if (charIndex == glyphCharIndex) return i; if (j >= charMap.length) return -1; } } return -1; }
/** * Returns the index of the last glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getLastGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=charMap.length-1; for (int i = numGlyphs-1; i >= 0; --i) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j--]; if (charIndex == glyphCharIndex) return i; if (j < 0) return -1; } } return -1; }
/** * Returns the index of the last glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getLastGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=charMap.length-1; for (int i = numGlyphs-1; i >= 0; --i) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j--]; if (charIndex == glyphCharIndex) return i; if (j < 0) return -1; } } return -1; }
/** * Returns the index of the first glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=0; for (int i = 0; i < numGlyphs; i++) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j++]; if (charIndex == glyphCharIndex) return i; if (j >= charMap.length) return -1; } } return -1; }
/** * Returns the index of the first glyph that has the specified char index. * * @param charIndex The original index of the character in the text node's * text string. * @return The index of the matching glyph in this layout's glyph vector, * or -1 if a matching glyph could not be found. */ public int getGlyphIndex(int charIndex) { int numGlyphs = getGlyphCount(); int j=0; for (int i = 0; i < numGlyphs; i++) { int count = getCharacterCount(i, i); for (int n=0; n<count; n++) { int glyphCharIndex = charMap[j++]; if (charIndex == glyphCharIndex) return i; if (j >= charMap.length) return -1; } } return -1; }
int numGlyphs = getGlyphCount();
int numGlyphs = getGlyphCount();
int numGlyphs = getGlyphCount();