freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Tweak CJK Blue zone parameters


From: Just Fill Bugs
Subject: [ft-devel] Tweak CJK Blue zone parameters
Date: Mon, 09 May 2011 00:23:58 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Shredder/3.1.11pre

Now that the CJK blue zone code are in the freetype repository, further tweak on the parameters can be performed.

One thing that I can think of is that the threshold of best_dist0 used in the af_cjk_hints_compute_blue_edges(). best_dist0 is used to initialize the snap distant from edges to one of the blue zones.

It's initially set to 1/40 of EM, and scaled to the rendering size. That means any edge that is closer to 1/40 of the EM (1024 or something) points toward a blue zone will snap to the blue zone.

At smaller rendering size, we can have much less possible different edges in limited space. For example, at 16 pixel, we can only have 1/16 different edges, less than the 1/40. (more different edges when considering anti-alias rendering, but that's fuzzy.)

Therefore, we can force a bigger snap distance so that we can have more uneven edges aligned. Especially when we deliberately merge some glyph features at the smaller font size.

What's the suitable snap distance will vary over fonts. I wrote a patch to set the distance at 1/24 for 16px or smaller font size. Different numbers can be used to experiment with all kind of fonts.

More dynamic adjustment can be archived by linking the best_dist0 value to the delta between filled/unfilled blue zones.

Attachment: cjk-bluezone-tweak.patch
Description: Text Data


reply via email to

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