|From:||Collyer, Oliver, SI|
|Subject:||Re: [ft] Suggestion to improve auto hinter|
|Date:||Wed, 23 Feb 2011 09:46:09 +0000|
In case anyone is interested, I've been getting some good results with the following simple/brute-force algorithm.
It's inefficient, but perhaps the results are of use and suggest room for improvement in the auto hinter.
For a given typeface and requested pixel size P:
- pick some sample letters (for example ABCDEFabcdef)
- for each one create an unhinted outline, and measure yMax - yMin for the bbox.
- create hinted outlines at sizes of between minus half a pixel and plus half a pixel of P (we have 1/64th pixel resolution so the most extreme version of this would create 64 outlines per letter) and measure yMax - yMin for each bbox
- pick the outline variant whose cumulative/average height (of all the sample characters) is closest to that of the unhinted outline
- cache the height adjustment used for the best case and use this subsequently when drawing with this font in this size
Since the effect is most useful at lower font sizes, I skip all this for pixel sizes > 30 so its only very inefficient rather than horrendously inefficient :P
I find with the above in place, my font sizes in general Chrome browsing on Windows more closely resemble those when browsing on Mac in certain cases, but more to the point are closer to the unhinted/accurate size and thus more like what the web page designer intended.
I've attached an example; observe how by default the main body of text appears squashed in FreeType.
FreeType with height adjustment
Core Text default
On 22 Feb 2011, at 13:04, JustFillBug wrote:
|[Prev in Thread]||Current Thread||[Next in Thread]|