Bug 164767 - Overriding font size with fontconfig rules doesn't work correctly in cairo-based gtk2
Summary: Overriding font size with fontconfig rules doesn't work correctly in cairo-ba...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: pango
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-01 04:25 UTC by Luca Barbieri
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-11-07 13:55:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Luca Barbieri 2005-08-01 04:25:16 UTC
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):
gtk2-2.7.4-1
fontconfig-2.3.2-1
cairo-0.6.0-1
pango-1.9.1-1

How reproducible:
Always.

Steps to Reproduce:
1. Replace /etc/fonts.conf with the XML document at the bottom of the bug 
2. Run gnome-font-properties
  
Actual results:
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
fonts.conf size.

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">
<fontconfig>
  <dir>/usr/share/fonts</dir>
  <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
  <dir>/usr/X11R6/lib/X11/fonts/OTF</dir>
  <dir>~/.fonts</dir>

        <match target="font">
                <edit name="pixelsize" mode="assign"><double>72.0</double></edit>
                <edit name="size" mode="assign"><double>72.0</double></edit>
        </match>
</fontconfig>

Comment 1 Owen Taylor 2005-08-16 16:34:54 UTC
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.


Comment 2 Luca Barbieri 2005-08-16 16:55:05 UTC
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
for it.

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.


Comment 3 Matthias Clasen 2005-11-07 13:55:02 UTC
Tracked upstream in http://bugzilla.gnome.org/show_bug.cgi?id=317121


Note You need to log in before you can comment on or make changes to this bug.