Heyo,
I've been attempting to load a custom font into Jimp and get this error. The TrueType font is attached with the issue along with the BMfont conversion done using Littera.
Anyone have any suggestions as to next steps? I'm not sure how to find the exact cause
Cheers,
Nelly
I'm getting this error as well
(node:74513) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cannot parse font file Cannot read property '0' of undefined
After some more testing, I think it just depends on the font. Maybe if the font is missing certain characters?
This is still happening.
In fact, Bitmap fonts xml have a kernings xml tag that seems to be required by Jimp.
I've solved the problem supra adding the following code to the end of your font file:
<kernings count="0">
</kernings>
I merged in those two PRs for the bmfont modules. Let me know if there's anything else!
@mattdesl I just tested it and it works! Thanks for the quick response.
Most helpful comment
In fact, Bitmap fonts xml have a
kerningsxml tag that seems to be required by Jimp.I've solved the problem supra adding the following code to the end of your font file: