[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Hinting metrics
From: |
David Chester |
Subject: |
[Devel] Hinting metrics |
Date: |
Thu, 3 Jul 2003 05:13:49 +0200 |
User-agent: |
KMail/1.5.1 |
Hello,
In the grand scheme of things, I think uniformly increasing kerning values
would do more harm than good.
A better way to improve kerning would be to keep track of errors due to
rounding, pass them to the next level up (e.g. Xft), and then make
adjustments at that time if necessary. For instance, if the right boundary
of a character is rounded left, and the left boundary of the subsequent
character is rounded right, and further, if the magnitude of the errors taken
together exceeds half a pixel, then this should be corrected. Under the
conditions just described, glyphs would be kerned too closely, and a pixel's
worth of white space should added between them.
Here's a graphic showing three examples: the output from an unmodified
freetype, the previously proposed solution which would increasing kerning
values across the board, and finally, my solution as described above:
http://www.cs.mcgill.ca/~dchest/kern.png
It seems to me that since freetype doesn't deal with layout, corrections like
this must be left to a higher-level library or application. Is this correct?
As it is now though, the rounding errors are not recorded, so they cannot be
passed on. I've attached a patch to the autohinter which implements one
possible way to pass along the information; and a second patch to ftstring
(from the ft2demos package) which puts the information to use, making the
necessary corrections during the layout process. Of course for this to be
used in real applications, a similar patch would be needed for Xft.
I'd be interested to hear thoughts on the implementation.
David Chester
freetype-kern.diff
Description: Text Data
ft2demos-kern.diff
Description: Text Data