This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours

Bug 76582

Summary: gnome-font-properties fails to correctly set font for gtk1 apps
Product: [Retired] Red Hat Linux Reporter: Osma Ahvenlampi <oa+redhat>
Component: rhl-release-notes-x86Assignee: Ed Bailey <ed>
Status: CLOSED RAWHIDE QA Contact: Ed Bailey <ed>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: hp, otaylor
Target Milestone: ---Keywords: MoveUpstream, Triaged
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-23 16:46:40 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Osma Ahvenlampi 2002-10-23 13:00:06 EDT
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 17:55:31 EST
Owen how do you think we should address this?
Comment 2 Owen Taylor 2002-12-19 21:27:39 EST
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-19 21:32:23 EST
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 09:34:10 EST
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 10:59:24 EST
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 11:14:15 EST
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 12:18:00 EST
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 16:24:11 EST
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 16:46:40 EST
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 16:55:05 EST
Looks good to me.