freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] Shiny New Subpixel Hinting Patch


From: Moony
Subject: [ft] Shiny New Subpixel Hinting Patch
Date: Tue, 07 Sep 2010 23:00:04 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Thunderbird/3.1.2

 Hi Werner,

I finally got around to properly implementing the subpixel hinting!  I
added some macros to ftoption.h to enable / disable it.  Currently the
patch enables it by default, but of course it can be turned off by
default eventually. 

I ended up taking a slightly different approach to coding this, using
flags and rules defined in ttgload.c.  Each glyph has the
sph_tweak_flags variable, that says which TT instructions to enable /
disable for each glyph.  These are then tested in ttinterp.c.  This
method allows for additional instructions and rules to easily be added,
if one desires to do so. 

There are two macros that I used throughout...
TT_CONFIG_OPTION_SUBPIXEL_HINTING will globally enable or disable
subpixel hinting.  The intent is that when this is off, the code will
compile as it does today.  When on, the basic rules for X-subpixel
hinting will be enabled.  In my efforts, I've also found that some
glyphs (which were instructed to render in monochrome) still don't look
right.  So, I added another macro- 
TT_CONFIG_OPTION_SUBPIXEL_HINTING_ADDITIONAL_TWEAKS, which will enable
tweaking of individual fonts, styles, sizes, and glyphs.  I decided it
needed to be a separate option because some people may not find this
appropriate, or may not want the overhead (which I think is minor). 

I tested this out with the flags enabled and disabled, and got the
results I expected, however, I won't claim that it is bug-free.  :)  I'd
like people to exercise it a bit first.  People on my site have been
using it and enjoying it, so I hope that it is getting to the point
where it could be added to the trunk. 

Once again, I am open to any constructive criticism and suggestions on
improvement in implementation or features.  I do have a few features I
still want to add, but I remember you saying that as long as it was
disabled by default via a macro, you would be more willing to include it.

Here is the patch, which should cleanly patch against freetype-2.4.2:
http://www.infinality.net/files/subpixel-hinting-20100907-1.patch

Thanks,
Erik

address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]