-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
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
Some fonts render with the wrong font face #39
Comments
an example of the sort of output i'm getting with those fonts above |
It's like the first font is cached and any subsequent calls for similar fonts within the same family are using the first font instead of their own file.
the values for these options are different for each file so I would think there would be no relation between the files. |
I believe I found the issue. Opening these fonts in FontForge, their Preferred Family Name is 'SignPainter' and their Style values are 'Regular'. I believe node-canvas is caching these fonts based on their preferred family name and style. The fonts started rendering correctly once I changed the preferred family name to a unique value. This seems to be related to this comment here.. and possibly this section of code here ... just need to figure out a way to make it work without using FontForge to modify the values.... |
@schester44 I had a similar case and I can confirm your suggestion worked for me. |
yeah apparently this isn't currently fixable at the node-canvas level (see the referenced issue). Modifying fonts via FontForge isn't really an option for me... open to ideas/suggestions for a fix if anyone comes across this. |
Its hit or miss but it seems like fonts that are more "stylish" or complex are the ones that don't render correctly. A group of fonts within the same family will all render using, what appears to be, the exact same font.
This is occurring on OSX and Freebsd.
Example fonts:
https://drive.google.com/drive/folders/1tBD2RnuEpLHofEdS4Eeg7VvSgk6nt7S1?usp=sharing
The code i'm using:
I'll continue my research upstream but wanted to drop an issue on this project in case someone has some info related to this.
The text was updated successfully, but these errors were encountered: