1 18 package org.apache.batik.gvt.font; 19 20 21 29 public class KerningTable { 30 31 private Kern[] entries; 32 33 39 public KerningTable(Kern[] entries) { 40 this.entries = entries; 41 } 42 43 55 public float getKerningValue(int glyphCode1, 56 int glyphCode2, 57 String glyphUnicode1, 58 String glyphUnicode2) { 59 for (int i = 0; i < entries.length; i++) { 60 if (entries[i].matchesFirstGlyph(glyphCode1, glyphUnicode1) && 61 entries[i].matchesSecondGlyph(glyphCode2, glyphUnicode2)) { 62 return entries[i].getAdjustValue(); 63 } 64 } 65 return 0f; 66 } 67 } 68 | Popular Tags |