How to find the name in gnome-terminal through fc-list?

Everything about X, Gnome, KDE, ... and everything running on it

How to find the name in gnome-terminal through fc-list?

Postby shogun1234 » 2020-05-11 14:52

I use Debian

Code: Select all
cat /etc/debian_version
bullseye/sid


And am learning to use simple term using the doc described at https://wiki.archlinux.org/index.php/St#Font

But when trying to configure font I encounter a problem, I search Monospace with command below

Code: Select all
fc-list | grep -i monospace


But nothing returns. However searching with mono, it would return some fonts. Also in gnome-terminal, there is a font I can configured with name Monospace Regular.

So my question - how do I find the font name that matched name in gnome-terminal through fc-list?

Thanks
shogun1234
 
Posts: 128
Joined: 2006-07-13 08:04

Re: How to find the name in gnome-terminal through fc-list?

Postby Head_on_a_Stick » 2020-05-11 15:10

Monospace is an alias:
Code: Select all
empty@E485 ~ % fc-match monospace
Inconsolata.otf: "Inconsolata" "Medium"
empty@E485 ~ %

I set mine in ~/.config/fontconfig/fonts.conf, like this:
Code: Select all
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>monospace</family>
    <prefer><family>Inconsolata</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>Times New Roman</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Arial</family></prefer>
  </alias>
</fontconfig>

I prefer to use the sans, serif & mono aliases in the various desktop and application settings so that I only have to edit fonts.conf to change the fonts everywhere.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12194
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to find the name in gnome-terminal through fc-list?

Postby shogun1234 » 2020-05-17 15:01

Sorry replying late. I tried fc-match monospace, the command shows
Code: Select all
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

And there is no fontconfig under .config folder. But I notice I have fontconfig installed already.

Code: Select all
$ sudo apt-get install fontconfig
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fontconfig is already the newest version (2.13.1-2+b1).
...


Maybe I miss something? Thanks for your help

Head_on_a_Stick wrote:Monospace is an alias:
Code: Select all
empty@E485 ~ % fc-match monospace
Inconsolata.otf: "Inconsolata" "Medium"
empty@E485 ~ %

I set mine in ~/.config/fontconfig/fonts.conf, like this:
Code: Select all
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>monospace</family>
    <prefer><family>Inconsolata</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>Times New Roman</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Arial</family></prefer>
  </alias>
</fontconfig>

I prefer to use the sans, serif & mono aliases in the various desktop and application settings so that I only have to edit fonts.conf to change the fonts everywhere.
shogun1234
 
Posts: 128
Joined: 2006-07-13 08:04

Re: How to find the name in gnome-terminal through fc-list?

Postby Head_on_a_Stick » 2020-05-17 16:32

shogun1234 wrote:there is no fontconfig under .config folder

You can create one if you want to use fonts.conf to change the monospace alias to something other than Dejavu Sans.

Note that st will accept the monospace alias in config.h: https://github.com/Head-on-a-Stick/conf ... ig.h.st#L8

I would actually recommend that approach because then you can change the font in st without having to recompile it. Not sure why suckless use Liberation Mono instead, seems like a strange choice.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12194
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable