You are not logged in.
I want to have 'Noto Sans 10 medium' for my desktop icons and Thunar (or all GTK3 apps). How can i achieve that?
This is my ~/.config/gtk-3.0/gtk.css so far but i can't figure out how to set the font weight/style.
* {
-XfdesktopIconView-cell-spacing: 2px;
-XfdesktopIconView-cell-padding: 2px;
-XfdesktopIconView-text-width-proportion: 1.7;
}I found this but i can't figure out how to adapt it properly.
https://forum.manjaro.org/t/bold-text-xfce/75691
sys2064
Offline
Perhaps what's happening is that some programs are explicitly setting the weight of text and other programs do not do that? When I play around with the font settings here for me on XFCE, I can see the font changing to medium in some programs and in others like Thunar it stays as regular weight.
I'm thinking what you can try to do is play around with fontconfig. It's perhaps possible to create a fake font name that gets translated into Noto Sans at medium weight.
About how to do that, in my own fontconfig files here, I found an old commented out experiment where I tried to replace "Trebuchet MS" with Fira Sans and where I tweaked what happened to certain weights:
<!-- <match target="pattern"> -->
<!-- <test qual="any" name="family"><string>Trebuchet MS</string></test> -->
<!-- <edit name="family" mode="assign" binding="same"><string>Fira Sans</string></edit> -->
<!-- <edit name="weight" mode="assign"> -->
<!-- <if> -->
<!-- <more_eq> -->
<!-- <name>weight</name> -->
<!-- <const>demibold</const> -->
<!-- </more_eq> -->
<!-- <const>demibold</const> -->
<!-- </if> -->
<!-- </edit> -->
<!-- </match> -->I think this snippet here was supposed to make it so first Trebuchet MS gets replace by Fira Sans. And then next, the Trebuchet MS "bold" weight gets replaced by Fire Sans "demibold" weight because I thought Fira Sans "bold" was too heavy. I don't remember if it actually worked.
I also found another snippet in my files that looks interesting for your problem:
<!--<edit name="weight" mode="assign">
<minus>
<name>weight</name>
<int>20</int>
</minus>
</edit>-->There's also a "<plus>" tag. You could try to use that to change weight from regular to medium.
If you are interested in battling with fontconfig, it's sadly very badly documented so is kind of impossible to learn how it works. The following blog post helped me a lot with my experiments:
Offline
Perhaps what's happening is that some programs are explicitly setting the weight of text and other programs do not
Yes, that's correct. That's what the gtk.css is for. It can globally override these values. It probably could also be done in the 'desktop theme' itself (or fontconfig) but i would rather prefer the gtk.css file.
Last edited by Maniaxx (2019-07-16 14:45:52)
sys2064
Offline
I just did the following experiment:
notebook {
font-weight: 500;
}This makes Thunar use the medium weight of Noto Sans for its main view.
That "500" there is needed because "Pango" has no name for the medium weight, so you need to use a number to select medium.
I got that "notebook" name by starting Thunar like this:
GTK_DEBUG=interactive thunarThis only works if you first kill XFCE's Thunar daemon process.
Last edited by Ropid (2019-07-16 16:44:21)
Offline
Tried that as well with .thunar {...} and it works indeed but it only affects the main window (no sub windows/options/settings).
I guess your approach to replace 'Noto Sans regular' with 'medium' is indeed much better.
Fontconfig is very difficult indeed. Not sure how far i will get.
Thanks so far.
Last edited by Maniaxx (2019-07-17 20:24:54)
sys2064
Offline