Unable to change fonts of jgmenu, dunst and network menu applet

Tried changing thier fonts in rc files in ~/.config to “Ubuntu Condensed” with and without double quotes. Fonts aren’t changing to condensed type.
If not using quotes the fonts remain to Ubuntu Regular or to some sans font otherwise.

Check the output of fc-match -a | grep -i ubuntu for the correct name.

It’s probably best to set the font in all applications to “sans” and then set sans to Ubuntu Condensed (or whatever) via an alias in ~/.config/fontconfig/fonts.conf so that you only have to edit one file to change font across the whole desktop.

1 Like

@ANiK3T I don’t know why it doesn’t work. At first I though you might not have re-started jgmenu (e.g. with F5), but having tried it myself, I have the same issue. Maybe by mind is playing tricks on me, but I’m pretty sure that I have successfully used jgmenu with “Ubuntu Condensed” in the past.

I’ve just tried pango_font_description_set_stretch() with PANGO_STRETCH_CONDENSED, but there’s no change.

The font is set here
https://github.com/johanmalm/jgmenu/blob/master/x11-ui.c#L232

I’ve just tried on Ubuntu, but it doesn’t work there either.

Grateful for any advice.

thanks for the advice. how may I create an alias?
also sorry to bother about this since I’m fairly new to Arch Linux (and OpenBox).

A search engine is your friend for questions like this, here is the top result for “create font alias linux” (I used startpage.com):

https://seasonofcode.com/posts/how-to-set-default-fonts-and-font-aliases-on-linux.html

For reference, here is BunsenLabs’ ~/.config/fontconfig/fonts.conf:

https://raw.githubusercontent.com/BunsenLabs/bunsen-configs/helium-dev/skel/.config/fontconfig/fonts.conf

As you can see we use the Noto fonts for serif & sans-serif with Inconsolata for the monospaced font.

2 Likes

For jgmenu, try it without spaces:

font = UbuntuCondensed 12px

that’s th way I have to do it. I suspect dunst and and the network menu applet will be the same.

1 Like

^ Can we see this output please.

Ubuntu-R.ttf: “Ubuntu” “Regular”
Ubuntu-L.ttf: “Ubuntu” “Light”
Ubuntu-M.ttf: “Ubuntu” “Medium”
Ubuntu-B.ttf: “Ubuntu” “Bold”
Ubuntu-RI.ttf: “Ubuntu” “Italic”
Ubuntu-LI.ttf: “Ubuntu” “Light Italic”
Ubuntu-MI.ttf: “Ubuntu” “Medium Italic”
Ubuntu-BI.ttf: “Ubuntu” “Bold Italic”
AL Ubuntu.ttf: “Ubuntu Nerd Font” “Book”
Ubuntu-C.ttf: “Ubuntu Condensed” “Regular”
AL Ubuntu Mono Nerd Font Complete.ttf: “UbuntuMono Nerd Font” “Regular”
AL Ubuntu Mono.ttf: “UbuntuMono Nerd Font” “Regular”
UbuntuMono-R.ttf: “Ubuntu Mono” “Regular”
AL Ubuntu Mono Bold Nerd Font Complete Mono.ttf: “UbuntuMono Nerd Font Mono” “Bold”
UbuntuMono-B.ttf: “Ubuntu Mono” “Bold”
UbuntuMono-RI.ttf: “Ubuntu Mono” “Italic”
UbuntuMono-BI.ttf: “Ubuntu Mono” “Bold Italic”

Ubuntu-C doesn’t work, I have to use UbuntuCondensed, like UbuntuMono.

Same goes for Fira Sans and Fira Mono - no spaces.

^ Thanks.

I would try this stanza in ~/.config/fontconfig/fonts.conf:

<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Ubuntu Condensed</family></prefer>
  </alias>
</fontconfig>

Then set the font in all applications to “sans”.

EDIT: check if the configuration works with fc-match sans

That will create a system-wide replacement of sans-serif by ubuntu condensed for the users GUI applications won’t it?

Yes, that’s right, the font for all applications can then be changed by editing a single file.

@PackRat Thanks for finding the solution. I have added an “UbuntuCondensed” example in the jgmenu(1) man page to help anyone else trying to do this (inculding myself :sunglasses:)

No problem.

Is this something in the font then? I’ve had to do this with a couple window managers too - mainly fluxbox which is my main wm.

^ I’m not sure. I have very limited knowledge of fonts.
Considering GTK uses pango for text rendering, I guess it probably quite far reaching.

It looks like ‘family name’ should be used
https://github.com/GNOME/pango/blob/master/pango/fonts.c#L1214

But looking at the output of this, I wonder if it’s linked to the postscript name.
fc-match -a --verbose | grep -i 'condensed'

comment this line (#csv_cmd = lx) to me it worked