Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
shogun1234
Posts: 156
Joined: 2006-07-13 08:04
Has thanked: 3 times

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

#1 Post by shogun1234 »

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

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#2 Post by Head_on_a_Stick »

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.
deadbang

shogun1234
Posts: 156
Joined: 2006-07-13 08:04
Has thanked: 3 times

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

#3 Post by shogun1234 »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#4 Post by Head_on_a_Stick »

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.
deadbang

Post Reply