[cairo-bugs] [Bug 11838] hintstyle specified in fontconfig is ignored while rgba is respected sometimes

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Sep 7 16:36:55 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=11838


Karl Tomlinson <bugs.freedesktop at karlt.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sunmoon1997 at gmail.com,
                   |                            |bugs.freedesktop at karlt.net
            Summary|hintstyle specified in      |hintstyle specified in
                   |fontconfig is ignored while |fontconfig is ignored while
                   |rgba is respected           |rgba is respected sometimes




--- Comment #2 from Karl Tomlinson <bugs.freedesktop at karlt.net>  2008-09-07 16:36:49 PST ---
The rgba behavior is actually more complicated:
With "echo Xft.rgba: rgb | xrdb -merge"
and <edit name="rgba" mode="assign" ><const>none</const></edit>,

"pango-view -t 'fcgray antialias' --backend=cairo"

renders with rgb subpixel antialiasing.

"--backend=ft2" and "--backend=xft" render with gray antialiasing as expected.

_cairo_ft_options_merge has some complex logic to decide which options
on the scaled_font or on the cairo_ft_font_face (from the FcPattern)
take priority in the way the font behaves.

Assuming that surface options have already been set on the FcPattern with
cairo_ft_font_options_substitute, it is not clear to me why options on the
scaled_font should ever take priority over those from the pattern.  If
fontconfig has changed any options on the pattern then that is what the user
(or distribution) wants.

Is the logic in _cairo_ft_options_merge meant to protect against broken
fontconfig settings?

Some surfaces may be pretty keen to have CAIRO_HINT_STYLE_NONE.  Also, maybe
surfaces with depth 1 would like CAIRO_ANTIALIAS_NONE and gray surfaces don't
need rgba antialiasing, but maybe changing the load flags based on the color
support of the surface would produce some surprises with glyph outline changes.

I wouldn't really see a problem with fontconfig settings always having the
last say (bug 4792 comment 5).  fontconfig settings should be able to achieve
their goals without unconditionally setting hinting to true (as true is the
default).

Even if there are some special cases where surface options should take
priority, I can't think why the surface should care what hintstyle is used
once hinting is on.  Similarly, I can't think why a color surface should care
if the user asks for gray antialiasing on a font that doesn't hint well to
reduce color fringing.

I wonder whether a cairo_ft_scaled_font_create_for_pattern or
cairo_font_options_merge_from_pattern API might be good so that the
scaled_font can be created with the font_options that will be used, which
would be useful in _cairo_scaled_font_keys_equal.

But merely modifying _cairo_ft_options_merge could enable fontconfig settings
even with the existing API.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list