We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font.getKerningValue
Font.getKerningValue returns kerning value from KERN table if GPOS table is empty.
Font.getKerningValue returns 0 if GPOS table is empty, even if there are values in KERN table.
font.position.defaultKerningTables.length === 0
const arial = opentype.loadSync('C:\\Windows\\Fonts\\arial.ttf'); const kerning = arial.getKerningValue(arial.charToGlyph('T'), arial.charToGlyph('e')); console.log('kerning is', kerning);
Output:
kerning is 0
Expected:
kerning is -227
Drawing text.
The text was updated successfully, but these errors were encountered:
@ILOVEPIE this is fixed within #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.
Sorry, something went wrong.
No branches or pull requests
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/6acfd4e41b7aa2901f84cfd49433a6e63bf60cbe
Steps to Reproduce (for bugs)
Output:
Expected:
Context
Drawing text.
Your Environment
The text was updated successfully, but these errors were encountered: