-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Error when using bitmap font embedded inside truetype font. #891
Comments
Replicated here on Ubuntu 12.04 with Freetype 2.4.8. I'd like to find something that renders fonts using Freetype (other than Pillow) to see if it's a problem at the font/freetype layer, or something in how we're driving freetype. |
I have a project in PHP, which is actually an image generator with this font at 14px using php5-gd library, and it works really great (using embedded bitmap font). According package dependency information of debian package php5-gd, it depends on libfreetype6. So I think it's not an issue with freetype library :) |
After some test, this bug exists since at least Pillow 2.2.2(earlier versions do not support freetype 6). All versions since 2.2.2 produced same image. |
Found a dirty work around, adding Found the solution at http://www.freetype.org/freetype2/docs/tutorial/step1.html |
Since embedded bitmap font works incorrectly, we should avoid using them, until a final patch is available and tested. I've added `FT_LOAD_NO_BITMAP` to ALL(3) places in `_imagingft.c`, which did (not much) actually fixed the issue. A notice has also been added to `_imagingft.c`.
Truetype font has a feature which allows you to embed bitmap font for specific font size, to optimize the rendering results on screens. But using such fonts in Pillow will generate some strange result.
Example:
In this case I'm using a modified version of SimSun, which contains embedded bitmap fonts, for all size between 8px and 24px. In the image, first line is using 24px font and the second line is 28px.
TestCase is available (Contains SimSun font, testcode and the result above).
This test can be reproduced on both windows and linux.
The text was updated successfully, but these errors were encountered: