This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Unable to change font size for gtk apps inside KDE

Tags: None
(comma "," separated)
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
I am using Kubuntu, and trying to configure the fonts for gtk apps from systemsettings > Common Appearance and Behavior > Application Appearance > GTK
Changing the themes and font family works fine. But the font size is not working. It sticks to 10pt, no matter what font size is selected.

Here is a screenshot
http://i58.tinypic.com/9ury9v.png

My KDE font is Droid Sans 9pt, and I have set the same for GTK apps. But gedit is using Droid Sans 10pt, and so are all gtk apps like pidgin. If I change the font, it will use it but at the fixed 10pt size, irrespective of whatever size is specified.

So how do I fix this issue ? I verified that the issue is present on a fresh install of Kubuntu.

Here is some more information

Code: Select all
$ env | grep gtk
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/enlightened/.gtkrc-2.0:/home/enlightened/.kde/share/config/gtkrc-2.0
GTK_RC_FILES=/etc/gtk/gtkrc:/home/enlightened/.gtkrc:/home/enlightened/.kde/share/config/gtkrc
GTK_MODULES=overlay-scrollbar:unity-gtk-module
Contents of ~/.gtkrc-2.0


Code: Select all
$ cat .gtkrc-2.0
# File created by KDE Gtk Config
# Configs for GTK2 programs


include "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"
style "user-font"
{
        font_name="Droid Sans [unknown] Regular"
}
widget_class "*" style "user-font"
gtk-font-name="Droid Sans [unknown] Regular 9"
gtk-theme-name="oxygen-gtk"
gtk-icon-theme-name="oxygen"
gtk-fallback-icon-theme="oxygen"
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=0                                                                                                                                     
gtk-button-images=0


Contents of ~/.gtkrc-2.0-kde4

Code: Select all
$ cat .gtkrc-2.0-kde4                                                                                                       
# File created by KDE Gtk Config                                                                                                                     
# Configs for GTK2 programs                                                                                                                           
                                                                                                                                                     
include "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"                                                                                                 
style "user-font"                                                                                                                                     
{
        font_name="Droid Sans [unknown] Regular"
}
widget_class "*" style "user-font"
gtk-font-name="Droid Sans [unknown] Regular 9"
gtk-theme-name="oxygen-gtk"
gtk-icon-theme-name="oxygen"
gtk-fallback-icon-theme="oxygen"
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=0
gtk-button-images=0


KUBUNTU 18.04
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you try changing the following statement to include the font size? It seems like a bug in the Gtk configuration file generator which KDE includes.
Code: Select all
font_name="Droid Sans [unknown] Regular"

Code: Select all
font_name="Droid Sans [unknown] Regular 9"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
bcooksley wrote:Can you try changing the following statement to include the font size? It seems like a bug in the Gtk configuration file generator which KDE includes.
Code: Select all
font_name="Droid Sans [unknown] Regular"

Code: Select all
font_name="Droid Sans [unknown] Regular 9"


Hi

yes I tried that, did not work.


KUBUNTU 18.04
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you check to verify that Gedit, Pidgin, etc. are all still using Gtk2 instead of Gtk3?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
bcooksley wrote:Can you check to verify that Gedit, Pidgin, etc. are all still using Gtk2 instead of Gtk3?


I am not sure. But in GTK appearance settings,
the GTK3 theme applies to gedit , gnome-system-monitor etc
the GTK2 theme applies to leafpad, thunar etc.

So gedit is based on gtk3 if i am not wrong.
But the good thing is, that all gtk (gtk2 + gtk3) apps are disobeying the font size specified.


KUBUNTU 18.04
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
What is the content of /home/enlightened/.kde/share/config/gtkrc-2.0 and /home/enlightened/.kde/share/config/gtkrc?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
bcooksley wrote:What is the content of /home/enlightened/.kde/share/config/gtkrc-2.0 and /home/enlightened/.kde/share/config/gtkrc?


/home/enlightened/.kde/share/config/gtkrc-2.0
Code: Select all
$ cat /home/enlightened/.kde/share/config/gtkrc-2.0
# created by KDE, Sat May 3 09:04:58 2014
#
# If you do not want KDE to override your GTK settings, select
# Appearance -> Colors in the System Settings and disable the checkbox
# "Apply colors to non-KDE4 applications"
#
#

gtk-alternative-button-order = 1

style "default"
{
  bg[NORMAL] = { 0.878, 0.875, 0.871 }
  bg[SELECTED] = { 0.255, 0.545, 0.831 }
  bg[INSENSITIVE] = { 0.878, 0.875, 0.871 }
  bg[ACTIVE] = { 0.718, 0.710, 0.702 }
  bg[PRELIGHT] = { 0.878, 0.875, 0.871 }

  base[NORMAL] = { 1.000, 1.000, 1.000 }
  base[SELECTED] = { 0.255, 0.545, 0.831 }
  base[INSENSITIVE] = { 0.878, 0.875, 0.871 }
  base[ACTIVE] = { 0.255, 0.545, 0.831 }
  base[PRELIGHT] = { 0.255, 0.545, 0.831 }

  text[NORMAL] = { 0.078, 0.075, 0.071 }
  text[SELECTED] = { 1.000, 1.000, 1.000 }
  text[INSENSITIVE] = { 0.718, 0.710, 0.702 }
  text[ACTIVE] = { 1.000, 1.000, 1.000 }
  text[PRELIGHT] = { 1.000, 1.000, 1.000 }

  fg[NORMAL] = { 0.078, 0.075, 0.071 }
  fg[SELECTED] = { 1.000, 1.000, 1.000 }
  fg[INSENSITIVE] = { 0.718, 0.710, 0.702 }
  fg[ACTIVE] = { 0.078, 0.075, 0.071 }
  fg[PRELIGHT] = { 0.078, 0.075, 0.071 }
}

class "*" style "default"

style "ToolTip"
{
  bg[NORMAL] = { 0.878, 0.875, 0.871 }
  base[NORMAL] = { 1.000, 1.000, 1.000 }
  text[NORMAL] = { 0.078, 0.075, 0.071 }
  fg[NORMAL] = { 0.078, 0.075, 0.071 }
}

widget "gtk-tooltip" style "ToolTip"
widget "gtk-tooltips" style "ToolTip"

style "MenuItem"
{
  bg[PRELIGHT] = { 0.255, 0.545, 0.831 }
}

class "*MenuItem" style "MenuItem"



/home/enlightened/.kde/share/config/gtkrc
Code: Select all
$ cat /home/enlightened/.kde/share/config/gtkrc
# created by KDE, Sat May 3 09:04:58 2014
#
# If you do not want KDE to override your GTK settings, select
# Appearance -> Colors in the System Settings and disable the checkbox
# "Apply colors to non-KDE4 applications"
#
#
style "default"
{
  bg[NORMAL] = { 0.878, 0.875, 0.871 }
  bg[SELECTED] = { 0.255, 0.545, 0.831 }
  bg[INSENSITIVE] = { 0.878, 0.875, 0.871 }
  bg[ACTIVE] = { 0.718, 0.710, 0.702 }
  bg[PRELIGHT] = { 0.878, 0.875, 0.871 }

  base[NORMAL] = { 1.000, 1.000, 1.000 }
  base[SELECTED] = { 0.255, 0.545, 0.831 }
  base[INSENSITIVE] = { 0.878, 0.875, 0.871 }
  base[ACTIVE] = { 0.255, 0.545, 0.831 }
  base[PRELIGHT] = { 0.255, 0.545, 0.831 }

  text[NORMAL] = { 0.078, 0.075, 0.071 }
  text[SELECTED] = { 1.000, 1.000, 1.000 }
  text[INSENSITIVE] = { 0.718, 0.710, 0.702 }
  text[ACTIVE] = { 1.000, 1.000, 1.000 }
  text[PRELIGHT] = { 1.000, 1.000, 1.000 }

  fg[NORMAL] = { 0.078, 0.075, 0.071 }
  fg[SELECTED] = { 1.000, 1.000, 1.000 }
  fg[INSENSITIVE] = { 0.718, 0.710, 0.702 }
  fg[ACTIVE] = { 0.078, 0.075, 0.071 }
  fg[PRELIGHT] = { 0.078, 0.075, 0.071 }
}

class "*" style "default"

style "ToolTip"
{
  bg[NORMAL] = { 0.878, 0.875, 0.871 }
  base[NORMAL] = { 1.000, 1.000, 1.000 }
  text[NORMAL] = { 0.078, 0.075, 0.071 }
  fg[NORMAL] = { 0.078, 0.075, 0.071 }
}

widget "gtk-tooltip" style "ToolTip"
widget "gtk-tooltips" style "ToolTip"

style "MenuItem"
{
  bg[PRELIGHT] = { 0.255, 0.545, 0.831 }
}

class "*MenuItem" style "MenuItem"




KUBUNTU 18.04
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
Hi bcooksley

I have solved this for now. It was being caused by the strange font name "Droid Sans [unknown]".

1. Removed all droid sans fonts from the system (/usr/share/fonts)
2. Installed the fonts-droid package (kubuntu).
3. selected "Droid Sans" size 9 for all font settings (KDE and GTK).

Now all apps using the same font and size.

Thanks for your time.

regards
Silver


KUBUNTU 18.04
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Not a problem. In case you're wondering - the contents of those files certainly didn't have any effect on your problem, they only impact the colours used by Gtk applications.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]