← Back to team overview

registry team mailing list archive

[Bug 200707] Re: fontconfig does not honor hintslight, hintmedium, hintfull

 

Launchpad has imported 12 comments from the remote bug at
http://bugs.freedesktop.org/show_bug.cgi?id=11838.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2007-08-03T17:44:33+00:00 B. Lin wrote:

cairo behaves inconsistently on hintstyle and rgba settings. If
specified in fonts.conf something like this:

<edit name="rgba" mode="assign" ><const>rgb</const><edit>
<edit name="hintstyle" mode="assign" ><const>hintfull</const></edit>

cairo would respond to rgba but not to hintstyle; hintstyle can only be
set via gtk( through gnome-settings-daemon).

Although i don't know how to code, but after looking at the code
(several times), i commented this out in cairo-ft-font.c (in function
_cairo_ft_options_merge):

if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)

and everything goes fine.
Is this the right solution?

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/0

------------------------------------------------------------------------
On 2008-07-18T05:45:31+00:00 B. Lin wrote:

Recently I've found a better fix.  Set default hintstyle to
"CAIRO_HINT_STYLE_DEFAULT"(which is new), and in the function
_cairo_ft_options_merge, change

     if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)
         options->base.hint_style = other->base.hint_style;
to
     if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
         options->base.hint_style = other->base.hint_style;

This should give fair result, i.e., only if hintstyle is specified with
fontconfig would the value configured with gnome-settings-daemon be
overriden.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/7

------------------------------------------------------------------------
On 2008-09-07T16:36:49+00:00 Bugs-freedesktop wrote:

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.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/8

------------------------------------------------------------------------
On 2008-09-15T15:35:19+00:00 Freedesktop wrote:

I know I've been surprised by the logic in _cairo_ft_options_merge()
before, but decided not to change it without fully understanding it.

I'll look into this after 1.8.  Feel free to ping.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/9

------------------------------------------------------------------------
On 2008-10-10T14:55:53+00:00 Chris Wilson wrote:

*** Bug 13335 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/10

------------------------------------------------------------------------
On 2008-10-10T15:20:01+00:00 Chris Wilson wrote:

*** Bug 4792 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/11

------------------------------------------------------------------------
On 2008-12-26T00:29:19+00:00 Doublebacks wrote:

I don't understand why this bug exists such a long time - it's obvious
and important. You can't specify different hintstyles for individual
fonts through fontconfig - gnome-settings-daemon override all your
settings and only one hintstyle for all fonts. This is the main reason I
choose KDE: libxft doesn't have this bug.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/12

------------------------------------------------------------------------
On 2009-02-20T00:54:57+00:00 Rox "Need For Money" Dorentus wrote:

Created an attachment (id=23125)
patch for cairo-ft-font.c

This bug still exists in Debian sid (libcairo2=1.8.6-2).
This simple patch shall fix it, at least it works for me.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/13

------------------------------------------------------------------------
On 2010-03-27T11:21:37+00:00 Paul Bredbury wrote:

Created an attachment (id=34511)
cairo-respect-fontconfig.patch

(In reply to comment #3)
> I'll look into this after 1.8.  Feel free to ping.

Ping!

I've used the enclosed cairo-respect-fontconfig.patch in Gentoo, Fedora,
Arch Linux and Lunar Linux. And so have others. It is needed, so as not
to partially ignore fontconfig's configuration files. Further info is in
this post within Gentoo's huge fonts thread:

http://forums.gentoo.org/viewtopic-t-723341-postdays-0-postorder-asc-
start-258.html

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/14

------------------------------------------------------------------------
On 2010-05-09T19:02:53+00:00 careta wrote:

Hi, this is an annoying bug, any chance for the patch above to be
included in cairo? It solves the problem for me.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/15

------------------------------------------------------------------------
On 2010-07-25T16:43:32+00:00 Grogi wrote:

Bug still there (1.8.10) and cairo-respect-fontconfig.patch still works... 
Simple fix, waiting far too long to be fixed in codebase.

I did some digging and condition (options->base.hint_style ==
CAIRO_HINT_STYLE_DEFAULT) would be only true if Xft.hintstyle had a
unrecognized value, for instance 5. Empty value will falls back to
CAIRO_HINT_STYLE_FULL.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/17

------------------------------------------------------------------------
On 2010-07-31T17:14:33+00:00 Grogi wrote:

Created an attachment (id=37489)
The complete patch for respecing Fontconfig in Cairo. Hintstyle / RGBA / LCDFilter are supported now. 

The routines dealing with data returned by Fontconfig have been
rewritten to support all properties. The logic is simple - if anything
is returned by Fontconfig, it will be respected. If not, the xrdb/Xft
settings are used.

Reply at: https://bugs.launchpad.net/libcairo/+bug/200707/comments/18


** Changed in: libcairo
   Importance: Unknown => Low

-- 
fontconfig does not honor hintslight, hintmedium, hintfull
https://bugs.launchpad.net/bugs/200707
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for libcairo.