Ubuntu

some ~/.fonts.conf settings do no override desktop-wide gnome settings (hinting style)

Reported by puntium on 2007-11-08
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Medium
Unassigned
libcairo (Ubuntu)
Undecided
Unassigned

Bug Description

I didn't fill out the package field, since this seems to be an interaction between multiple packages (gnome-setting-daemon, libgtk, libcairo, pango/cairo).

In the 'Appearance' control app, under the font settings, I like to use 'Subpixel' and 'Full' hinting by default, since this looks good for most bundled fonts.

However, there is occasionally a font (especially in the msttcorefonts package) that doesn't look good with these settings. So I want to override their rendering settings using .fonts.conf. My main tactic is to usually turn on the autohinter in 'hintslight' mode for certain fonts. Lets take Times new Roman as an example.. the .fonts.conf incantation to do this would be:

 <match target="font">
         <test name="family" qual="any">
                 <string>Times New Roman</string>
         </test>
    <edit name="autohint"> <bool>true</bool></edit>
    <edit name="hinting"> <bool>true</bool></edit>
    <edit name="hintstyle" > <const>hintslight</const> </edit>
 </match>

The odd thing about this is that the 'autohint' and 'hinting' edits seem to work, but the 'hintstyle' edit is always overridden by the control applet's settings. I can verify this by launching gedit each time after tweaking these settings.

"fc-match -v 'Times New Roman'" does return the right settings, so its something in the chain of gtk libraries that is messing it up.

Interstingly, it's not all possible edit settings that are ignored. It seems to only be hintstyle. For example if I were to say:

 <match target="font">
         <test name="family" qual="any">
                 <string>Times New Roman</string>
         </test>
    <edit name="antialias"> <bool> false </bool> </edit>
 </match>

Then this works correctly. Only Times New Roman will be non-antialiased even in gedit. Even setting "hinting" to "false" works.. its only the hintstyle setting that doesn't work.
[lspci]
00:00.0 Host bridge [0600]: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge [8086:7190] (rev 01)
     Subsystem: VMware Inc Device [15ad:1976]
00:0f.0 VGA compatible controller [0300]: VMware Inc Abstract SVGA II Adapter [15ad:0405]
     Subsystem: VMware Inc Abstract SVGA II Adapter [15ad:0405]

Tobias Wolf (towolf) wrote :

How about cross-checking with KDE or something similar?

Mingming Ren (portis25) wrote :

I have reported a same bug in libcairo Bug #209256, but no response.

I'd like to render my fonts in different hintstyles.

To be precise, I have chinese font and western language fonts. For the chinese font, I'd like it to be rendered in hintfull, but for other fonts, I'd prefer hintslight.

Ok, I configured in the fontconfig file, but it didn't make any change. All the fonts are in the same hintstyle, depending on the configuration in gnome-appearance-properties.

I googled for quite a long time and finally I got one solution.

In the file cairo-ft-font.c, in function _cairo_ft_options_merge, just comment the following line:

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

and recompile, now everything works fine. The fonts are rendered according to the hintstyles configured in fontconfig.

I don't know if this is really a bug of libcairo. If I'm wrong, please accept my apology.

puntium (puntium) wrote :

Tobias, what do you mean by cross checking with KDE? Qt's interaction with fontconfig and freetype is entirely different, and I don't really really think relevant to this discussion. I don't use KDE.

Mingming, thanks for the interesting comment. If you apply this change, and you _don't_ specify a setting for a font in .fonts.conf, then does it get the setting in gnome-appearance-properties?

The behaviour should be that gnome-appearance-properties specifies the default, and then users can use .fonts.conf to override this setting for particular fonts.

Mingming Ren (portis25) wrote :

puntium,

I remove .fonts.conf, and it gets the setting in gnome-appearance-properties.

Ian Weisser (ian-weisser) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

puntium (puntium) wrote :

Yes it's still there in 8.04.

Bryce Harrington (bryce) wrote :

Hi puntium,

Please attach the output of `lspci -vvnn`, and attach your /var/log/Xorg.0.log file from after reproducing this issue. If you've made any customizations to your /etc/X11/xorg.conf please attach that as well.

Changed in xorg:
status: New → Incomplete
Bryce Harrington (bryce) wrote :

We're closing this bug since it is has been some time with no response from the original reporter. However, if the issue still exists please feel free to reopen with the requested information. Also, if you could, please test against the latest development version of Ubuntu, since this confirms the bug is one we may be able to pass upstream for help.

Changed in xorg:
status: Incomplete → Invalid
puntium (puntium) wrote :

I'm running in a vm, so I doubt you'll see anything interesting.

puntium (puntium) wrote :
puntium (puntium) wrote :

reopening with requested output

Changed in xorg:
status: Invalid → New
puntium (puntium) wrote :

Just confirmed on 8.10 as well. It seems things have gotten slightly better.

I wrote a simple ~/.fonts.conf:

<fontconfig>
   <match target="font">
      <test name="family"><string>DejaVu Sans Mono</string></test>
      <edit name="hintstyle"><const>hintfull</const></edit>
   </match>
</fontconfig>

fc-match -v "DejaVu Sans Mono" will always return me a result that is consistent with my fonts.conf.

In Intrepid, the above setting *seems* to work as long as you never actually run the gnome appearance panel and manually change the hint settings. Once you do that, then all the settings get overridden again (even if I restart apps [i've been testing with gedit])

Bryce Harrington (bryce) wrote :

Thanks puntium.

Changed in xorg:
importance: Undecided → Medium
status: New → Confirmed
mbana (m.bana) wrote :

I can also confirm this. The following snippet doesn't set the hinting to hintslight

    <match target="font">
        <test compare="eq" name="family">
            <string>Consolas</string>
        </test>
        <edit name="rgba" mode="assign"><const>rgb</const></edit>
        <edit name="autohint" mode="assign"><bool>false</bool></edit>
        <edit name="antialias" mode="assign"><bool>true</bool></edit>
        <edit name="hinting" mode="assign"><bool>true</bool></edit>
        <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
    </match>

Bryce Harrington (bryce) on 2009-01-17
description: updated
Carsten Gräser (graeser) wrote :

I observe the same problem im 9.04. I mainly use kde which respects the per font setting of hintstyle in .fonts.conf . However any gnome app (e.g. gvim, gnome-terminal) ignores it.

Carsten Gräser (graeser) wrote :

Same problem in 9.10. Will this ever be fixed?

Igor (i-gocalinski) wrote :

This is not a problem of FontConfig. Cairo (still in 10.04) just decides to ignore the hintstyle returned by FontConfig if desktop provides any other value. Rebuild of Cairo solves this problem.

Thomas Hotz (thotz) wrote :

So should we close the fontconfig task? Please tell us! Thank you!

Changed in libcairo (Ubuntu):
status: New → Confirmed
Changed in fontconfig (Ubuntu):
status: Confirmed → Incomplete
Thomas Hotz (thotz) on 2013-05-02
Changed in fontconfig (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers