[cairo] On the behaviour of cairo_scaled_font_create with regards to font options

David Turner david at freetype.org
Fri Feb 23 03:51:39 PST 2007


> This behaviour is intented. The font options comes from FcPattern are
> recorded internally and some of them can't be overriden later.
> The font options from scale font are awlays a hint for font backend, font
> backend may choose to respect them or even completely ignore them.
> FcPattern contains all options from user configurations, if we ignore them or
> overide them then we can't disable anitialiasing, set subpixel order etc by
> tuning fonts.conf..., this is obviously not what we want.

I don't have a problem with recording the FcPattern's rendering options
internally, that's exactly what I do.

However: A newly created font_options only contains "default" values
(i.e. CAIRO_ANTIALIAS_DEFAULT, CAIRO_HINTSTYLE_DEFAULT, etc...)

if such font_options are used, the font backend should be free to use sane rendering
defaults that come from fonts.conf. But if the user selects CAIRO_ANTIALIAS_NONE, or
CAIRO_ANTIALIAS_GRAY explicitely, the font backend would probably better use these
settings if it supports them.

That's currently what my reworked font backend does, and this seems to work very well.
Except for the ft-text-antialias-none test suite, which sets FC_ANTIALIAS to false,
then calls scaled_font_create with font options containing CAIRO_ANTIALIAS_GRAY.

I still don't understand the reasons for the current behaviour. It breaks
abstraction and is confusing. 

- David


More information about the cairo mailing list