You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FreeType rasterization doesn't work, and has been made mandatory #685
This is a priority issue for me because it's blocking the Tsukurimashou 0.8 release, planned for tomorrow. Encountered in the latest git master version of FontForge, under 64-bit Linux.
Same problem I reported two years ago to the mailing list (http://sourceforge.net/mailarchive/forum.php?thread_name=20111125.100615.444195158.wl%40gnu.org&forum_name=fontforge-devel ): when FontForge uses FreeType to generate bitmaps, it sometimes produces complete garbage. The bitmaps, if saved to BDF, are mostly empty, with just a few containing large irregular black areas. If I generate a bitmap strike in the GUI and then try to look at it in the bitmap window, it sometimes segfaults, suggesting in-memory data structures contain garbage.
In the GUI, there is an option during bitmap generation to use FreeType or not; but native scripting doesn't offer such a choice and will always attempt to use FreeType.
Werner Lemberg found and fixed an unrelated bug in FreeType in response to my report (see the mailing list thread) - apparently FreeType couldn't read BDF files with large indices. But FontForge does not use FreeType for BDF files; that bug is unrelated to mine and only happened to also be noticeable from the test case I provided. He disclaimed responsibility for my actual bug, which is specific to the case where FontForge generates a bitmap using FreeType.
In 2011, a workaround for me was to build FontForge without FreeType. But pull #157 made that impossible.
At this point it looks to me like my best option may be to dig into the FontForge source and modify the hardcoded "use FreeType" setting to "no," because I need this to work now. But in the longer term, we should figure out what's actually wrong with the FreeType rasterization and fix it, or convince Werner that it is his business to do so.
Same problem I reported two years ago to the mailing list
(http://sourceforge.net/mailarchive/forum.php?thread_name=20111125.100615.444195158.wl%40gnu.org&forum_name=fontforge-devel):
when FontForge uses FreeType to generate bitmaps, it sometimes
produces complete garbage. The bitmaps, if saved to BDF, are mostly
empty, with just a few containing large irregular black areas. If I
generate a bitmap strike in the GUI and then try to look at it in
the bitmap window, it sometimes segfaults, suggesting in-memory data
structures contain garbage.
If you can provide a backtrace, this would be very helpful, since it
helps identify a not directly related display bug in FontForge.
[...] But in the longer term, we should figure out what's actually
wrong with the FreeType rasterization and fix it, or convince Werner
that it is his business to do so.
If you can give me data related to FreeType to work on, I'm
certainly fixing any issue. However, I don't have time and enough
knowledge, unfortunately, to read FontForge's code in detail.
I still have doubts whether this is a FreeType issue: Currently, there
are no known FreeType rendering problems. I rather suspect that
FontForge's code to generate the BDF data from the rendered bitmaps is
buggy.
So the bitmaps are incorrect very soon after they come out of
FreeType, though it remains possible that they could be correct when they come out of FreeType, with FontForge corrupting them
very soon after that point.
It should be straightforward to immediately send the bitmaps created
by FreeType to a series of debugging log files (one glyph per file,
where image bits can be represented with `*' or something similar).
Doing so it can be checked easily whether FreeType produces buggy
output.
Perhaps the best fix is to check if there are more than 1000 glyphs being processed and if so, alert the user that only the first 1000 are processed, and just process them?
It's a non-issue in CFF because you don't need hint replacement subroutines at all. Instead, there is the hintmask operator (and cntrmask, for which there is no equivalent in Type 1 fonts).
The availability of large integers is another bonus but not important here, I guess.
I found Wikipedia article explained FreeType’s subpixel rendering implementation is currently disabled by default to avoid Microsoft's patent about a specific color filtering algorithm for use in LCD display subpixel rendering.
Activity
lemzwerg commentedon Aug 26, 2013
If you can provide a backtrace, this would be very helpful, since it
helps identify a not directly related display bug in FontForge.
If you can give me data related to FreeType to work on, I'm
certainly fixing any issue. However, I don't have time and enough
knowledge, unfortunately, to read FontForge's code in detail.
I still have doubts whether this is a FreeType issue: Currently, there
are no known FreeType rendering problems. I rather suspect that
FontForge's code to generate the BDF data from the rendered bitmaps is
buggy.
davelab6 commentedon Aug 26, 2013
Would a --configure flag be useful? So that you have to intentionally say you dont have FreeType, and if you don't say that, the build fails?
davelab6 commentedon Aug 26, 2013
So this issue is really two tasks?
davelab6 commentedon Aug 26, 2013
So, 4?
lemzwerg commentedon Aug 26, 2013
It should be straightforward to immediately send the bitmaps created
by FreeType to a series of debugging log files (one glyph per file,
where image bits can be represented with `*' or something similar).
Doing so it can be checked easily whether FreeType produces buggy
output.
Fixing crash with bitmap fonts from #685
davelab6 commentedon Sep 13, 2013
Perhaps the best fix is to check if there are more than 1000 glyphs being processed and if so, alert the user that only the first 1000 are processed, and just process them?
davelab6 commentedon Sep 14, 2013
Have you used a libre word processor? ;)
33 remaining items
lemzwerg commentedon Mar 4, 2015
Maybe FontForge can create an intermediate CFF instead of a PFB?
lemzwerg commentedon Mar 5, 2015
It's a non-issue in CFF because you don't need hint replacement subroutines at all. Instead, there is the
hintmaskoperator (andcntrmask, for which there is no equivalent in Type 1 fonts).The availability of large integers is another bonus but not important here, I guess.
KrasnayaPloshchad commentedon Mar 24, 2015
I found Wikipedia article explained FreeType’s subpixel rendering implementation is currently disabled by default to avoid Microsoft's patent about a specific color filtering algorithm for use in LCD display subpixel rendering.lemzwerg commentedon Mar 25, 2015
While the statement itself is true, it's not clear to me what the last comment wants to tell us...
ghlawrence2000 commentedon Jul 5, 2015
Sorry, was a freetype problem I just posted in great detail before i realised this was fontforge area
Use CFF over PFB as intermediary for FT Rasterisation. Fixes fontforg…
Use CFF over PFB as intermediary for FT Rasterisation. Fixes fontforg…
Merge pull request #2420 from jtanx/ftraster