TrueType fonts have a table called 'gasp' (Grid-fitting And Scan-conversion Procedure) which contains a list of font size ranges and some attributes that control how they should be rendered. One such attribute is whether or not glyphs at specific sizes should be antialiased. FreeType does not automatically apply the settings from the gasp table, instead the FreeType user must query the gasp table using FT_Get_Gasp() and then alter their behavior based on that result. If this is not done, some fonts will be misrendered. One such font is Verdana Bold. The hinting programs in Verdana Bold assume that sizes 9-16 will not be antialiased (as specified in the gasp table), thus when they query the global antialiasing boolean while being run on size 9-16 glyphs, the resulting hinting is incorrect and the K, N, V and W glyphs (among others) are misrendered. See http://www.freetype.org/freetype2/docs/reference/ft2-gasp_table.html for more information. (Note that the gasp table also controls whether or not the bytecode should be interpreted at all, which probably also results in rendering errors, but I haven't noticed any.)
Whether to honour the gasp suggestion and disable either antialiasing or the bytecode interpreter at any given sizes should not be cairo's choice but rather should be specified in the fontconfig settings, so that users can choose for themselves what they prefer. OTOH, on doze this suggestion makes some sense.
I'd rather FreeType do these by default, unless overriden by the user...
(In reply to comment #1) > Whether to honour the gasp suggestion and disable either antialiasing or > the bytecode interpreter at any given sizes should not be cairo's choice > but rather should be specified in the fontconfig settings, so that users > can choose for themselves what they prefer. > > OTOH, on doze this suggestion makes some sense. > The gasp table isn't a suggestion, it's a requirement. Fonts render incorrectly if the gasp table isn't followed. As an end user, I would prefer my fonts to render correctly instead of incorrectly. If you're suggesting that I should configure this manually in some fontconfig XML file for each font individually, I'm going to state right here that you are completely wrong.
(In reply to comment #3) > As an end user, I would prefer my fonts to render correctly instead of > incorrectly. In any case there should be a way to override the font's gasp table. I personally favour seeing the few badly antialiased glyphs than seeing them all as bitmapped.
(In reply to comment #4) > (In reply to comment #3) > > As an end user, I would prefer my fonts to render correctly instead of > > incorrectly. > > In any case there should be a way to override the font's gasp table. I > personally favour seeing the few badly antialiased glyphs than seeing them all > as bitmapped. > Antialiasing the font anyway but lying to the bytecode about whether the AA is being performed might be an interesting exercise. That can't be done at the cairo level, though.
Created attachment 48403 [details] Verdana Bold 15 pt, rendered correctly
Created attachment 48404 [details] Verdana Bold 15 pt, rendered incorrectly Pay attention to the extra-fat N, V and W glyphs, as well as the subtle changes to the K, %, and many others.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/262.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.