How to get the real name of font?

16,610

Check the output from the fc-list command (in a terminal window):

/usr/share/fonts/TTF/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/TTF/VeraMono.ttf: Bitstream Vera Sans Mono:style=Roman
/usr/share/fonts/TTF/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/OTF/LinLibertine_M.otf: Linux Libertine Mono O:style=Mono

/usr/share/fonts/OTF/LinLibertine_M.otf: Linux Libertine Mono O:style=Mono

For example:

/usr/share/fonts/OTF/LinLibertine_M.otf       File name
:                                             Separator
Linux Libertine Mono O                        Font name (note, remove the initial space)
:                                             Separator
style=Oblique                                 The font 'style'

Font style is normally one of Regular (or Normal), Italic (or Oblique), Monospace (or Mono), Book, and combinations of these are valid.

The middle value ('Font name') is normally the name you'd want to use. If it contains space(s) you might need to escape each space (with a '\' in front) or put the entire name in quotes ('"'). Not always necessary though.

Beware that some font names contain extended characters (such as the TM or Copyright symbol) so you may need to handle those. (they can appear as, eg. ⢠in fc-list output)

Software such as font-manager show those names too.

Share:
16,610

Related videos on Youtube

Unimor
Author by

Unimor

Updated on September 18, 2022

Comments

  • Unimor
    Unimor over 1 year

    In my .spacemacs I try to change my default font but it draws an error, how to find the name of fonts that you can write up in config files ?

  • drumfire
    drumfire over 5 years
    What if there is a comma in the name? For example: ƦB.ttf: TTEditFont,花鳥風月B:style=Regular