Tue 28 Nov 2017 02:59:18 PM UTC, comment #5:
In current git, Type 1 fonts are now hinted with Adobe's CFF engine; this means that this problem no longer exists (at least theoretically).
I'm not going to fix the old, deprecated hinting engine, thus closing the report. Please reopen in case you are still experiencing problems!
|
Wed 28 Oct 2015 12:33:22 PM UTC, comment #4:
Thanks a lot for the sample code!
I can confirm the problem, and it is indeed a serious bug that nobody has noticed previously: For Type 1 fonts, only the first FT_Face object (after initializing the parent FT_Library object) gets the right hints if hinted natively! Note that neither the auto-hinter, nor the TrueType or CFF hinter are affected.
Failing to recognize this issue probably explains why the FreeType hinting of PS fonts is sometimes horribly bad...
Right now, I don't have the time to fix this issue. In case you urgently need a solution, please use separate FT_Library objects for all Type 1 faces.
For the record: A solution to the problem is very similar to Behdad's fixes to make the auto-hinter thread-safe.
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=89bc8d4de7bf93336e182bd42507851f5b46f66f
|
Thu 15 Oct 2015 06:19:21 AM UTC, comment #1:
Thanks for the report. However, never attach copyrighted files like the two Helvetica fonts to a bug tracker! I had to delete them (after saving them for future investigation). Additionally, the `BMP' format wastes an extreme amount of disk space and internet bandwidth. The next time, please convert such images to the PNG format.
It would help a lot and speed up the handling of this report if you could provide a small, stand-alone C code snippet (with TTY output, not using platform-specific code) that I can compile on my GNU/Linux box, and which demonstrates the problem you have. Have a look at
http://freetype.org/freetype2/docs/tutorial/example1.c
to see what I mean.
|
Mon 12 Oct 2015 02:26:34 PM UTC, original submission:
Character "g" from the font Helvetica Regular is rendered differently when only it is used or Helvetica Bold is rendered before.
Steps:
Without Helvetica Bold
1. Initialize FreeType
2. Load Helvetic Regular.pfb
3. Render character "g" (please see below)
Result is in the g.bmp
With Helvetica Bold
1. Initialize FreeType
2. Load Helvetic Bold.pfb
3. Render character "a"
4. Load Helvetic Regular.pfb
5. Render character "g"
Result is in the ag.bmp
Received bitmaps for character "g" are a little bit different in these cases
Character "g" is rendered like below:
FT_Set_Char_Size(pRegularFace, 608, 608, 300, 300);
FT_Set_Transform(pRegularFace, NULL, NULL);
FT_Load_Glyph(pRegularFace, 87, 8);
FT_Get_Glyph(pRegularFace->glyph, &pGlyphFill);
FT_Glyph_To_Bitmap(&pGlyphFill, FT_RENDER_TO_MONO(2), NULL, 1);
Character "a" is rendered like below:
FT_Set_Char_Size(pBoldFace, 704, 704, 300, 300);
FT_Set_Transform(pBoldFace, NULL, NULL);
FT_Load_Glyph(pBoldFace, 80, 8);
FT_Get_Glyph(pBoldFace->glyph, &pGlyphFill);
FT_Glyph_To_Bitmap(&pBoldFace, FT_RENDER_TO_MONO(2), NULL, 1);
|