Red Hat Bugzilla – Bug 164767
Overriding font size with fontconfig rules doesn't work correctly in cairo-based gtk2
Last modified: 2007-11-30 17:11:11 EST
Description of problem:
Setting size and/or pixelsize with fontconfig rules doesn't seem to have the
intended effect, with a cairo-based gtk2.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Replace /etc/fonts.conf with the XML document at the bottom of the bug
2. Run gnome-font-properties
The user interface font is displayed at normal size, while the text examples use
the large fonts.conf size.
In the font chooser dialog, the sample text is displayed at a fixed size
dependent on the font chosen (of unclear origin), regardless of the choice of
size in the list box.
Expected results (and actual results with gtk2-2.6.8):
The user interface font and the text example are displayed at the large
In the font chooser dialog, the sample text is displayed at the large fonts.conf
size, regardless of the font chosen and the choice of size in the list box.
XML document that should be used as /etc/fonts.conf:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<edit name="pixelsize" mode="assign"><double>72.0</double></edit>
<edit name="size" mode="assign"><double>72.0</double></edit>
Can you be more specific about what you are trying to do? It wouldn't
be hard to make pixelsize assignment from fonts.conf work. (size
assignment won't work) But if there aren't good use cases, I'm reluctant
to support that, since it might restrict what we can do in the future.
I was trying to enforce a minimum font size.
I personally prefer to set the minimal legible font size for normal text, so
that the amount of the text on screen at a given time is maximized.
However, some applications request fonts smaller that the GNOME/KDE configured
text size: by my choice of default font size, they get fonts that are too small
for comfortable reading.
To prevent this, I wrote a fonts.conf that would set the preferred size for
"Sans" and "Monospace" patterns with size less than the preferred one.
I submitted the simplest testcase I could conceive that would fail to work visibly.
Also that functionality seemed to work before the Pango transition, but doesn't
seem to work correcty now; this fact may be an argument for reinstating support
Furthermore, I think that if not reinstated pixelsize overriding should be
completely removed: as you can see from "Actual results", while it doesn't work
correctly, it also isn't ignored.
NOTE: all the preceding text discussed the situtation at the time the bug was
reported (gtk2-2.7.4-1); I'm not sure of the exact status of current development
version (I may test them if necessary).
BTW, it would also be useful to be able to the set the minimum font size for
single glyphs or glyph ranges/Unicode blocks since one may for instance want to
have a larger minimum size for CJK or other complex glyphs.
Tracked upstream in http://bugzilla.gnome.org/show_bug.cgi?id=317121