[cairo] cairo_hint_style_t and FreeType

Freddie Witherden freddie at witherden.org
Tue Dec 22 13:19:06 PST 2009

Hi all,

While reading the release notes for a 1.7.x release some months back I noticed 
that support was added for configuring the LCD filter used for filtering sub-
pixel rendered text. This was later removed on account that the API and 
associated enum was FreeType specific -- a decision which I agree with.

I am hence wondering if it is also worth, in a future release, deprecating the 
current constants in the cairo_hint_style_t enum. These are equally FreeType 
specific and have no counterparts in either the Windows or Mac OS X font 
engines. (Although, if you poke it hard enough, Mac OS X does allow you to 
control the degree of anti-aliasing.)

From an application standpoint most which are concerned about hinting are so 
because they require freely scalable text. If text is freely scalable depends 
on what direction(s), if any, hinting is applied in. For Western text 
disabling X-axis hinting is sufficient to ensure freely scalable text. Y-axis 
hinting, however, is harmless and actually beneficial. These semantics are not 
conveyed by the current constants.

Hence, I am proposing that rather than the arbitrary, FreeType specific 
constants SLIGHT (y-axis), MEDIUM (x- & y-axes) and FULL  (more aggressive x- 
& y-axes, often the same as MEDIUM) that a series of new constants are added 
to the enum, being CAIRO_HINT_STYLE_Y, CAIRO_HINT_STYLE_X_AND_Y. This will be 
clearer for developers (who often are unsure about the meanings of SLIGHT, 
MEDIUM and FULL) and have a physical significance.

While the constants I am proposing do not allow for one to differentiate 
between MEDIUM and FULL hinting the few applications which care about this 
distinction are probably better served by a FreeType-specific API rather than a 
general cross-engine one.

I'd be really interested to get others take on the issue (or if it is even an 
issue at all).

Regards, Freddie.

More information about the cairo mailing list