Bug 76582 - gnome-font-properties fails to correctly set font for gtk1 apps
Summary: gnome-font-properties fails to correctly set font for gtk1 apps
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rhl-release-notes-x86
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ed Bailey
QA Contact: Ed Bailey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-23 17:00 UTC by Osma Ahvenlampi
Modified: 2007-04-18 16:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-23 21:46:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Osma Ahvenlampi 2002-10-23 17:00:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021017

Description of problem:
after upgrading from rh7.3 + ximian gnome 2 (developer snapshot) to rh8.0, I
could not change the font configuration for any of my installed gtk1
applications. In addition, depending on the locale, gtk1 apps would show up with
the weirdest default fonts (LANG=C would use monospaced fonts everywhere,
whereas LANG=en_US.utf8 would make all gtk1 widgets use HUGE fonts (my screen
has 88 dpi resolution).


Version-Release number of selected component (if applicable):
control-center-2.0.1-8

How reproducible:
Always

Steps to Reproduce:
Change font settings from Font Preferences

Actual Results:  GTK 2.0 apps change fonts. GTK 1.2 apps do not react.

Expected Results:  All GTK apps change to use the new font setting.

Additional info:

Turns out this was because control-center would not write a .gtkrc for font
selections, only for themes. The locale affected gtk1 fonts, because the default
gtkrc for different locales had wildly different default fonts. For example,
/etc/gtk/gtkrc.iso885915 uses
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1, while /etc/gtk/gtkrc.utf8
uses -*-helvetica-medium-r-normal--*-120-*-*-p-*-*-*. UTF8 is affected by X dpi
setting, while ISO-8859-15 is not. LANG=C (which I assume uses /etc/gtk/gtkrc
failing a more exact match) had no default font at all.

The workaround is to create $HOME/.gtkrc.mine with a fontset matching what is
configured for GTK2.

Comment 1 Havoc Pennington 2002-12-19 22:55:31 UTC
Owen how do you think we should address this?


Comment 2 Owen Taylor 2002-12-20 02:27:39 UTC
I don't think we should address it.

 - There is no way to map a fontconfig font to an XLFD automatically
   in any way that isn't going to create more problems than it will
   solve.

 - Adding a GUI with an XLFD selector into the font properties capplet
   isn't reasonable.

The best we can do is document how to configure your gtk-1 font using
~/.gtkrc.mine

Comment 3 Havoc Pennington 2002-12-20 02:32:23 UTC
OK, bouncing to release notes.

Ed, the note is something like:

 - due to the transition to the new fontconfig/Xft2 font system, GTK+ 1.2  
   applications are not affected by the font preferences dialog. 
   A font can be configured for these applications by adding a line
   'font = "-*-*-*-*-whatever-*-*-*-' to the file ~/.gtkrc.mine

(Owen you probably want to fix my gtkrc)

Hmm, perhaps also a release note summarizing fontconfig/Xft2 which we should 
have had for 8.0: 
  https://listman.redhat.com/pipermail/psyche-list/2002-October/000585.html
  https://listman.redhat.com/pipermail/psyche-list/2002-October/002797.html


Comment 4 Osma Ahvenlampi 2002-12-20 14:34:10 UTC
I'd like to ask that, in addition to the release notes, you'd go through the
/etc/gtk/gtkrc* files and verify that all locales choose a default font using
the same logic. Currently, some of them use a point size while others use pixel
size. For instance, the ISO-8859-15 locale default would not have been a problem
for me, but the UTF-8 locale default was, due to my screen DPI:

/etc/gtk/gtkrc.iso885915:       fontset =
"-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\

/etc/gtk/gtkrc.utf8:       fontset =
"-*-helvetica-medium-r-normal--*-120-*-*-p-*-*-*"

Otherwise, Merry Christmas. :)

Comment 5 Ed Bailey 2002-12-23 15:59:24 UTC
Havoc, here's what's going into the release notes -- speak now, or fix it
yourself in CVS.. :-)

     o Due to the transition to the new font system based on fontconfig/Xft2,
       GTK+ 1.2 applications are not affected by any changes made via the
       Font Preferences dialog. For these applications, a font can be
       configured by adding the following line to the file ~/.gtkrc.mine:

       font = <font-specification>

       (Where <font-specification> represents a font specification in the
       -*-*-*-*-whatever-*-*-*- style used by traditional X Window
       applications.)

I'll see what I can do about whipping together an entry describing the font stuff.

In the meantime, there is the matter mentioned by Osma in the last comment. 
This is not a release notes-related thing; where/who would you like me to bounce
this bug to?

Comment 6 Havoc Pennington 2002-12-23 16:14:15 UTC
A new bug should probably be filed for the gtkrc issue, but it would be vs. 
the gtk+ package.

Comment 7 Ed Bailey 2002-12-23 17:18:00 UTC
Ok, I'm closing this as rawhide to indicate that the update to the release notes
will appear in a subsequent public release of the release notes.

Osma, you should file a new bug for the other issue you mentioned in comment #4...


Comment 8 Owen Taylor 2002-12-23 21:24:11 UTC
Argh, sorry for not responding earlier.  I'm not sure what Havoc was
thinking about, but that isn't the right syntax.

the right thing to put into ~/.gtkrc.mine is:

====
style "user-font" {
  fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*"
}

widget_class "*" style "user-font"
====

I'm not going to twiddle the GTK+-1.2 /etc/gtk/gtkrc.* files at this
point; GTK+-1.2 is dead and will soon be buried and they are close
enough to right (plus, we only recommend UTF-8 locales currently). 
So, there isn't really any point in filing another bug report.


Comment 9 Ed Bailey 2002-12-23 21:46:40 UTC
Ok, once more with feeling... :-)

     o Due to the transition to the new font system based on fontconfig/Xft2,
       GTK+ 1.2 applications are not affected by any changes made via the
       Font Preferences dialog. For these applications, a font can be
       configured by adding the following lines to the file ~/.gtkrc.mine:

       style "user-font" {

       fontset = "<font-specification>"

       }

       widget_class "*" style "user-font"

       (Where <font-specification> represents a font specification in the
       style used by traditional X applications, such as
       "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*".


Comment 10 Owen Taylor 2002-12-23 21:55:05 UTC
Looks good to me.


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