/** * Returns the horizontal kerning value for the specified glyph pair. * This will be zero if there is no explicit horizontal kerning value * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The horizontal kerning value. */ public float getHKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = hKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }
/** * Creates the kerning tables for this font. Two tables are created, * horizontal and vertical. If there are not children vkern or hkern * elements these tables will be empty. */ private void createKerningTables() { Kern[] hEntries = new Kern[hkernElements.length]; for (int i = 0; i < hkernElements.length; i++) { Element hkernElement = hkernElements[i]; SVGHKernElementBridge hkernBridge = (SVGHKernElementBridge)ctx.getBridge(hkernElement); Kern hkern = hkernBridge.createKern(ctx, hkernElement, this); hEntries[i] = hkern; } hKerningTable = new KerningTable(hEntries); Kern[] vEntries = new Kern[vkernElements.length]; for (int i = 0; i < vkernElements.length; i++) { Element vkernElement = vkernElements[i]; SVGVKernElementBridge vkernBridge = (SVGVKernElementBridge)ctx.getBridge(vkernElement); Kern vkern = vkernBridge.createKern(ctx, vkernElement, this); vEntries[i] = vkern; } vKerningTable = new KerningTable(vEntries); }
/** * Creates the kerning tables for this font. Two tables are created, * horizontal and vertical. If there are not children vkern or hkern * elements these tables will be empty. */ private void createKerningTables() { Kern[] hEntries = new Kern[hkernElements.length]; for (int i = 0; i < hkernElements.length; i++) { Element hkernElement = hkernElements[i]; SVGHKernElementBridge hkernBridge = (SVGHKernElementBridge)ctx.getBridge(hkernElement); Kern hkern = hkernBridge.createKern(ctx, hkernElement, this); hEntries[i] = hkern; } hKerningTable = new KerningTable(hEntries); Kern[] vEntries = new Kern[vkernElements.length]; for (int i = 0; i < vkernElements.length; i++) { Element vkernElement = vkernElements[i]; SVGVKernElementBridge vkernBridge = (SVGVKernElementBridge)ctx.getBridge(vkernElement); Kern vkern = vkernBridge.createKern(ctx, vkernElement, this); vEntries[i] = vkern; } vKerningTable = new KerningTable(vEntries); }
/** * Returns the horizontal kerning value for the specified glyph pair. * This will be zero if there is no explicit horizontal kerning value * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The horizontal kerning value. */ public float getHKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = hKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }
/** * Creates the kerning tables for this font. Two tables are created, * horizontal and vertical. If there are not children vkern or hkern * elements these tables will be empty. */ private void createKerningTables() { Kern[] hEntries = new Kern[hkernElements.length]; for (int i = 0; i < hkernElements.length; i++) { Element hkernElement = hkernElements[i]; SVGHKernElementBridge hkernBridge = (SVGHKernElementBridge)ctx.getBridge(hkernElement); Kern hkern = hkernBridge.createKern(ctx, hkernElement, this); hEntries[i] = hkern; } hKerningTable = new KerningTable(hEntries); Kern[] vEntries = new Kern[vkernElements.length]; for (int i = 0; i < vkernElements.length; i++) { Element vkernElement = vkernElements[i]; SVGVKernElementBridge vkernBridge = (SVGVKernElementBridge)ctx.getBridge(vkernElement); Kern vkern = vkernBridge.createKern(ctx, vkernElement, this); vEntries[i] = vkern; } vKerningTable = new KerningTable(vEntries); }
/** * Returns the vertical kerning value for the specified glyph pair. * This will be zero if there is no explicit vertical kerning value for * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The vertical kerning value. */ public float getVKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = vKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }
/** * Returns the vertical kerning value for the specified glyph pair. * This will be zero if there is no explicit vertical kerning value for * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The vertical kerning value. */ public float getVKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = vKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }
/** * Returns the vertical kerning value for the specified glyph pair. * This will be zero if there is no explicit vertical kerning value for * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The vertical kerning value. */ public float getVKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = vKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }
/** * Returns the horizontal kerning value for the specified glyph pair. * This will be zero if there is no explicit horizontal kerning value * for this particular glyph pair. * * @param glyphCode1 The id of the first glyph. * @param glyphCode2 The id of the second glyph. * * @return The horizontal kerning value. */ public float getHKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = hKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; }