Open miere43 opened 2 years ago
@ILOVEPIE this is fixed within https://github.com/opentypejs/opentype.js/pull/557 I tested this using test code snippet
describe('Arial fonts test', () => {
it('should have a correct kerning value', () => {
const font = loadSync('./fonts/arial.ttf');
const kerning = font.getKerningValue(font.charToGlyph('T'), font.charToGlyph('e'));
assert.strictEqual(kerning, -227);
});
});
unfortunately I cannot commit this because of arial font's License.
Expected Behavior
Font.getKerningValue
returns kerning value from KERN table if GPOS table is empty.Current Behavior
Font.getKerningValue
returns 0 if GPOS table is empty, even if there are values in KERN table.Possible Solution
font.position.defaultKerningTables.length === 0
is zero inFont.getKerningValue
. See: https://github.com/miere43/opentype.js/commit/6acfd4e41b7aa2901f84cfd49433a6e63bf60cbeSteps to Reproduce (for bugs)
Output:
Expected:
Context
Drawing text.
Your Environment