-
Notifications
You must be signed in to change notification settings - Fork 787
Support for font kerning #297
Comments
Unfortunately, gofpdf (like FPDF from which it is derived) does not currently support font kerning. This feature would be valuable so I will tag this as an enhancement. I imagine a solution would involve a font-specific table that associates letter pairs with spacing amount. Thanks for your post. |
Nice work, @beta! If your solution if generally applicable, please consider sharing. |
I have added this feature to another PDF generator library in the past, so I may be able to provide some insight. Basically, you just need to parse the kern move amount for each letter pair from the font file. Then, when writing text, if there is a kern move amount defined for a letter pair, you embed that amount in between parentheses. For example, within a More information is in the PDF specification under "Text-Showing Operators". |
It seems gofpdf does not support font kerning at the moment. For example, when outputting "Tourist" with Arial font:
Result of gofpdf:
Expected:
Note the difference of the spacing between "T" and "o". Is there any way to apply font kerning?
The text was updated successfully, but these errors were encountered: