/** * Returns the amount of kerning that should be added between the given * glyphs. Returns 0 if the glyphs should not be kerned. * * @param glyphCode1 The id of the first glyph in the kerning pair * @param glyphCode2 The id of the second glyph in the kerning pair * @param glyphUnicode1 The unicode value of the first glyph in * the kerning pair * @param glyphUnicode2 The unicode vlaue of the second glyph in * the kerning pair * @return The amount of kerning to be added when laying out the glyphs */ public float getKerningValue(int glyphCode1, int glyphCode2, String glyphUnicode1, String glyphUnicode2) { for (Kern entry : entries) { if (entry.matchesFirstGlyph(glyphCode1, glyphUnicode1) && entry.matchesSecondGlyph(glyphCode2, glyphUnicode2)) { return entry.getAdjustValue(); } } return 0f; } }
return new Kern(firstGlyphs, secondGlyphs, firstRanges, secondRanges, kernValue);
return new Kern(firstGlyphs, secondGlyphs, firstRanges, secondRanges, kernValue);
/** * Returns the amount of kerning that should be added between the given * glyphs. Returns 0 if the glyphs should not be kerned. * * @param glyphCode1 The id of the first glyph in the kerning pair * @param glyphCode2 The id of the second glyph in the kerning pair * @param glyphUnicode1 The unicode value of the first glyph in * the kerning pair * @param glyphUnicode2 The unicode vlaue of the second glyph in * the kerning pair * @return The amount of kerning to be added when laying out the glyphs */ public float getKerningValue(int glyphCode1, int glyphCode2, String glyphUnicode1, String glyphUnicode2) { for (int i = 0; i < entries.length; i++) { if (entries[i].matchesFirstGlyph(glyphCode1, glyphUnicode1) && entries[i].matchesSecondGlyph(glyphCode2, glyphUnicode2)) { return entries[i].getAdjustValue(); } } return 0f; } }
return new Kern(firstGlyphs, secondGlyphs, firstRanges, secondRanges, kernValue);
/** * Returns the amount of kerning that should be added between the given * glyphs. Returns 0 if the glyphs should not be kerned. * * @param glyphCode1 The id of the first glyph in the kerning pair * @param glyphCode2 The id of the second glyph in the kerning pair * @param glyphUnicode1 The unicode value of the first glyph in * the kerning pair * @param glyphUnicode2 The unicode vlaue of the second glyph in * the kerning pair * @return The amount of kerning to be added when laying out the glyphs */ public float getKerningValue(int glyphCode1, int glyphCode2, String glyphUnicode1, String glyphUnicode2) { for (Kern entry : entries) { if (entry.matchesFirstGlyph(glyphCode1, glyphUnicode1) && entry.matchesSecondGlyph(glyphCode2, glyphUnicode2)) { return entry.getAdjustValue(); } } return 0f; } }