You are not logged in.

#1 2018-05-16 12:28:53

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,746

gtk3.0, is it possible to force a specified weight for default font?

I'm using plasma DE, and i would like to use the "medium" weight" for gtk3 widgets too.
Using standard KCM font module i've set it for plasma:

koko@Gozer# grep Medium /home/koko/.config/kdeglobals
font=Noto Sans CJK JP,9,-1,5,57,0,0,0,0,0,Medium

Using Gnome application style, i've set it to the same font for GTK(2,3) too:

koko@Gozer# 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="Noto Sans CJK JP Medium"
}
widget_class "*" style "user-font"
gtk-font-name="Noto Sans CJK JP Medium 9"
gtk-theme-name="oxygen-gtk"
gtk-icon-theme-name="breeze-nosmall"
gtk-fallback-icon-theme="KFaenza"
gtk-cursor-theme-name="Jimmac"
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=0
gtk-button-images=0
gtk-primary-button-warps-slider=0

koko@Gozer# grep Medium ~/.config/gtk-3.0/settings.ini 
gtk-font-name=Noto Sans CJK JP Medium 9

Now Qt5 widgets and GTK2 widgets use the Medium font weight, but GTK3 ones ignores that and continue to use the "Regular" weight.

1a951d863532014.jpg


Maybe the default theme (Adwaita) is getting priority over it? Is it possible to override the weight of "non already bold" fonts somehow?

Last edited by kokoko3k (2018-05-16 12:34:11)

Offline

#2 2018-05-17 08:30:42

gnumdk
Member
Registered: 2009-10-15
Posts: 140

Re: gtk3.0, is it possible to force a specified weight for default font?

cat ~/.config/gtk-3.0/gtk.css

* {
   you can put here any CSS code related to fonts
}

For example, change font size for Corebird tweets:
$ cat ~/.config/gtk-3.0/gtk.css
window > .vertical > stack > scrolledwindow > .frame > list > .tweet
{
    font-size: 18px;
}

Last edited by gnumdk (2018-05-17 08:31:27)

Offline

#3 2018-05-17 10:09:36

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,746

Re: gtk3.0, is it possible to force a specified weight for default font?

Thanks, but i fear that doing that way, will force the selected weight for *all* the widgets.
I mean, if a widget was intended to have a heavier weight (bold, black), will appear as "medium" as well, right?

Thanks, i'll try anyway.

--EDIT
Tried, indeed.
all of the fonts now appear at the selected weight. so i'm loosing bold.
--EDIT2
eheh, another victim:
https://superuser.com/questions/811340/ … -in-webkit

Last edited by kokoko3k (2018-05-17 10:15:50)

Offline

Board footer

Powered by FluxBB