[Fontconfig] FreeType now includes Infinality subpixel support

Infinality infinality at infinality.net
Wed Jun 20 13:11:03 PDT 2012


On 06/20/2012 02:19 AM, Akira TAGOH wrote:
> Hi,
>
> One concern on this matter is how it affects to the visibility when
> mixing up the fonts with/without ClearType bytecode. I may be wrong
> because I'm not checking that myself. but just heard one get tired
> easily to keep looking in that situation. dunno.

As far as I know, there really isn't bytecode that is specific to 
Cleartype.  Bytecode is bytecode.  The Cleartype flag (or the phrase 
"designed for Cleartype") generally means that the font doesn't contain 
the legacy hacks used in fonts like Arial, Courier New, etc., which are 
problematic when being displayed with antialiasing on a TT rasterizer 
that is following specs.  The subpixel hinting functionality works 
around the issues with the legacy fonts, while allowing modern fonts to 
render as though they are "designed for Cleartype".   Or am I not 
understanding what you mean here?

>
> Other than that, it may be useful for buggy fonts.
>
> As Windows still has an option to turn off (right?),

The choices you get in Windows (as far as I know) are to have Cleartype 
on or off.  In fontconfig this would correspond to the below 
configurations.  A link to a corresponding image is above each 
configuration.  (Don't pay attention to the text in it, because it's the 
same across all images):

http://www.infinality.net/images/cleartype-on.png
<!-- cleartype on -->
         <match target="font">
                 <edit name="rgba" mode="assign">
                         <const>rgb</const>
                 </edit>
                 <edit name="hinting" mode="assign">
                         <bool>true</bool>
                 </edit>
                 <edit name="autohint" mode="assign">
                         <bool>false</bool>
                 </edit>
                 <edit name="antialias" mode="assign">
                         <bool>true</bool>
                 </edit>
                 <edit name="hintstyle" mode="assign">
                         <const>hintfull</const>
                 </edit>
         </match>

http://www.infinality.net/images/cleartype-off.png
<!-- cleartype off -->
         <match target="font">
                 <edit name="rgba" mode="assign">
                         <const>none</const>
                 </edit>
                 <edit name="hinting" mode="assign">
                         <bool>true</bool>
                 </edit>
                 <edit name="autohint" mode="assign">
                         <bool>false</bool>
                 </edit>
                 <edit name="antialias" mode="assign">
                         <bool>false</bool>
                 </edit>
                 <edit name="hintstyle" mode="assign">
                         <const>hintfull</const>
                 </edit>
         </match>

Since the subpixel hinting is automatically set to be off whenever 
FT_RENDER_MODE_MONO (i.e. antialias=false) is requested, no additional 
fontconfig configuration would be required to turn "Cleartype" off.  
That way you can still get the default Windows XP look, where Cleartype 
is off, and it renders MONO, but still uses the native TT hinter.  If 
you want Cleartype on, you just set antialias=true.  What you don't get 
anymore is antialiasing with the native TT rendering:

http://www.infinality.net/images/aa-native-tt.png

If you look at the Times New Roman "2, 3", Arial  "r, g, b, e, O" (12px 
to 17px) and others, you can see artifacts ranging from vanishing stems 
to dents in the outline.  This is because these particular fonts were 
never designed to render with both antialiasing and TT hinting.  So, my 
argument is that this form of rendering is wrong, was never intended, 
and shouldn't be accommodated into fontconfig rules.  But, like I said, 
some people may have gotten used to this rendering, as incorrect and 
wrong as it is, and will be upset if it isn't possible to do this 
anymore.  Of course, it is possible if you don't compile Freetype with 
subpixel hinting enabled.  So, I figure that minority of people can 
still have their way if they want to.

Sorry for the long explanation, but as you know, stuff related to fonts 
is always more complex than you'd link at first glance.  ;)

Erik





More information about the Fontconfig mailing list