Bug 921459 - Custom font size ignored by gtk applications
Summary: Custom font size ignored by gtk applications
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kcm-gtk
Version: 18
Hardware: i686
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-14 09:19 UTC by info@kobaltwit.be
Modified: 2014-02-05 19:57 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-02-05 19:57:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description info@kobaltwit.be 2013-03-14 09:19:40 UTC
Description of problem:
I am using the kde workspace my system. I need to use some gnome applications. I have used the kde system settings to modify the default font and size for gtk applications (using "Application Appearance"->"Gtk+ Appearance").

The changed font is picked up by gtk based applications but the changed size is not.

Version-Release number of selected component (if applicable):
kcm-gtk-0.5.3-11.fc18.i686

How reproducible:
Always

Steps to Reproduce:
1. Log in into a kde workspace
2. Start System Settings
3. Navigate to "Application Appearance"->"Gtk+ Appearance"
4. Choose a custom font size there (take something wildly different for clear results, like 18 or so)
5. Start a gtk based application (eg gnucash)
  
Actual results:
The gtk based application continues to use the old font size

Expected results:
The new font size should have been picked up

Additional info:
This appears to be a bug in what is written out to the gtkrc file by the configuration module. This is what gets written:

--
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"
include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
        font_name="Albertus Extra Bold"
}
widget_class "*" style "user-font"

gtk-theme-name="Clearlooks"
gtk-font-name="Albertus Extra Bold Bold 18"
--

Note that there's no font size defined within the style section. The font size is added to gtk-font-name in the end. If I manually change this file to:

--
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"
include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
        font_name="Albertus Extra Bold 18"
}
widget_class "*" style "user-font"

gtk-theme-name="Clearlooks"
gtk-font-name="Albertus Extra Bold Bold 18"
--

Then suddenly the font size is picked up by all gtk applications. The only difference is that the font size is now also added to the font_name parameter inside the style section.


Lastly, bug 869479 may be related, but I'm not really sure. So I decided to create a new bug report to be on the safe side.

Comment 1 Rex Dieter 2013-03-14 11:55:23 UTC
gnome apps use kde fonts by default.  No need to define any custom ones (as you found out, this "custom" method sometimes doesn't work anyway)

I'd recommend simply using
systesmsettings->application appearance->fonts
instead of change fonts (for *all* apps)

Comment 2 info@kobaltwit.be 2013-03-14 13:47:21 UTC
Thank you for your reply.

(In reply to comment #1)
> gnome apps use kde fonts by default.  No need to define any custom ones (as
> you found out, this "custom" method sometimes doesn't work anyway)
> 
Have you actually tried this ? I can't get the gnome apps use the kde fonts.

> I'd recommend simply using
> systesmsettings->application appearance->fonts
> instead of change fonts (for *all* apps)

I played with these settings, but my gnome apps continue to use the font I had configured before I started playing.

My settings are
(in Gtk+ Appearance)
- Use kde fonts

(in Fonts)
- some fonts other than the default sans serif

My gnome apps still use sans serif. Everywhere.

Looking closer I see that the gtkrc file still contains the style defining sans serif as in my original post (as generated by the gtk kcm module). I have even removed the originally generated gtkrc file ($HOME/.gtkrc-2.0-kde4 to be precise), and simply altered the theme in the gtk kcm. The generated file again contains the style defining sans serif as the font, and no font size indicator.

I'll note that currently only the General font is configured to be something different. So the question could be: what font do I need to change to have them picked up by gnome apps ?

Comment 3 info@kobaltwit.be 2013-03-14 13:53:40 UTC
For reference I tried GnuCash (still gtk2 based) and poedit.

I have configured a couple of different fonts for menu bar, tool bar, window title and general. But only the window title appears to be changed for the two applications I tested.

On the other hand, I notice that firefox and thunderbird do pick up the changed fonts for their menu. I thought those two were gtk based applications as well, so I'm not sure what the difference is.

Comment 4 Rex Dieter 2013-03-14 14:12:29 UTC
Yes, it works for me.  I'll try testing gnucash.  (did you notice any other problematic gtk apps?)

In short, gtkrc is (largely) ignored, oxygen-gtk and xsettings-kde passes on the information instead (like how gnome-settings-daemon handles this in gnome)

Comment 5 info@kobaltwit.be 2013-03-15 14:51:09 UTC
I'm running a lot of additional tests here, because I don't seem to get consistent results. My test applications are gnucash, thunderbird and firefox.

To start, I have removed the .gtkrc-2.0-kde4 file on my system and have not created a new one. I also didn't reconfigure the gtk kcm, because that would create a new .gtkrc-2.0-kde4 file.
I Then logged out and in again (in a KDE session of course).

=> all gnome apps now use the default gnome theme and standard font sizes.

Still ignoring the gtk kcm, so I don't have a .gtkrc-2.0-kde4 yet. I can now change any font setting in kde. Gnome apps won't pick these up at all.

Next I will try with the gtk kcm configured to use kde fonts. I'll report the findings in a next comment.

Comment 6 Rex Dieter 2013-03-15 14:53:34 UTC
To be clear here, 

1. are you using (default) oxygen-gtk theme?

2. is xsettings-kde installed (and running)?

Comment 7 info@kobaltwit.be 2013-03-15 15:30:18 UTC
(In reply to comment #6)
> To be clear here, 
> 
> 1. are you using (default) oxygen-gtk theme?
> 
Without a .gtkrc-2.0-kde4 file, I don't know what theme is running. I think gnome uses adwaita. The gnome apps in the default theme have scrollbars without up and down arrows (very annoying if you don't have a scroll wheel).

Anyway, I didn't have oxygen-gtk installed. It is now.

> 2. is xsettings-kde installed (and running)?

Yes, xsettings-kde is running.

Continued experiment...

My general kde font is currently "Sans serif Italic 16". Unusual enough to easily recognize. At the same time, I have configured the kde font for menu items to be "Sans serif Italic 11". Not too large, but different from the other fonts due to the choice for italics.

With these settings, I have now chosen oxygen-gtk as them in the gtk kcm and opted to use kde's default fonts in gtk applications. Apply changes

=> A .gtkrc-2.0-kde4 file is being generated. It shows to use oxygen-gtk as theme and sets the gtk-font-name to "Sans Serif Italic 16". So it sets the kde general font as the gtk general font.

- Log out and back in to be on the safe side.
- Start gnucash (gtk2 app)

=> Font used in dialog boxes is "Sans Serif 16". Note that the Italic attribute is not used. Except for the buttons. These are "Sans Serif Italic 16".
=> Menu items use "Sans Serif Italic 11".

So my kde font for menus and buttons is picked up well. But general text is missing the extra attributes like bold or italic.

- Start thunderbird (same for firefox)

=> All text (menus, buttons, toolbar, general text) is in "Sans Serif 16". No italic.

- Start gedit (gtk3 app)

=> All text (menus, buttons, toolbar, general text) is in "Sans Serif Italic 16". So gtk3 apps pick up the full font definition, but only the general one. Such apps ignore any specific font for menu, toolbar, and so on.

To be continued...

Comment 8 info@kobaltwit.be 2013-03-15 15:38:35 UTC
Next experiment: I have now changed the kde general font to "Sans Serif Bold 8". A big contrast to the Italic 16 from the previous test.

=> All open apps immediately update their fonts. But with the same limitations as indicated in my previous message:
- gtk2 bases apps use the general font minus the bold attribute for general text, and properly use the kde fonts defined for menu and toolbar (including the italic attribute). Buttons use the full general font definition (including the bold attribute).
- gtk3 based apps use the full general font definition for all text, including menus and toolbars. So these ignore any custom kde fonts for those items.

And now interestingly, if you open the gtk kcm, it will indicate "Use anoter font", with "Sans Serif (size 16)" in italic as marked as custom font. This is also the definition still in the .gtkrc-2.0-kde4 file.

Comment 9 info@kobaltwit.be 2013-03-15 15:44:00 UTC
So to summarize I think my experiments have revealed several bugs:

- oxygen-gtk2 comes closest to using the fonts defined in kde. It is missing the bold/italic attribute on general text though (bug number 1)

- oxygen-gtk3 only uses the general kde font and ignores kde's toolbar en menu font definitions

- there's an interoperability bug between the font kcm and the gtk kcm. When the gtk kcm is configured to "Use my kde fonts in gtk+ applications" that option should not change if the user decided to choose another kde font. On the contrary, instead that font should be propagated to the .gtkrc-2.0-kde4 file.  Or perhaps the option to use another font should be removed from the kcm, since it's pretty buggy in itself.

Comment 10 info@kobaltwit.be 2013-03-15 16:22:17 UTC
I also note that not all fonts are updated immediately after applying changes in the font kcm. For example kontact changes all fonts properly, dolphin changes all fonts except for the widget showing the contents of one directory. It takes a logout/login cycle before these are fixed.

Similarly, the plasma widget that pops up when changing the sound volume using the volume keys on the keyboard seems to continue to use the old font settings until I log out and back in.

Those are very minor issues ("papercut" or "every detail matter" kind of details), but I thought I'd mention them anyway for completeness.

Comment 11 Fedora End Of Life 2013-12-21 12:08:16 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Fedora End Of Life 2014-02-05 19:57:25 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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