98

There are many questions and answers regarding fonts on Ubuntu, but not so many dealing with Ubuntu for Embedded Linux, such as Beaglebone Black.

I have not been able to locate any .ttf files in standard locations on my system, and I think that given the resource constraints these have been omitted.

Using the command line, how can I (1) find out which fonts are installed, and (2) install more fonts.

FYI: I am looking for a simple sans-serif ttf that I can use to display text on an 8x8 LED matrix.

3

4 Answers 4

123

The best and simplest way is to use console command (this command should be available for all ubuntu-based distributions) :

fc-list

Example output (stripped) :

/usr/share/fonts/truetype/lato/Lato-Medium.ttf: Lato,Lato Medium:style=Medium,Regular
/usr/share/fonts/truetype/tlwg/TlwgTypo-Bold.ttf: Tlwg Typo:style=Bold
/usr/share/fonts/truetype/lato/Lato-SemiboldItalic.ttf: Lato,Lato Semibold:style=Semibold Italic,Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/noto/NotoSansThai-Regular.ttf: Noto Sans Thai:style=Regular
...

From MAN :

fc-list - list available fonts

To check all available options use MAN (manual): man fc-list

1
  • sudo apt install fontconfig to install, e.g. if you are getting a fc-list: command not found error Jan 3, 2023 at 19:50
14

if you need to get the font family name:

fc-list : family | sort | uniq

4

What version of Ubuntu are you using?

(1) Thanks to the links from Lety, on my ubuntu 15.04 machine less /etc/fonts/fonts.conf. In there it describes how to use local.conf.

(2) from a command line, to search for more fonts I use apt-cache search font | grep lcd then I use apt-cache show {} (replacing {} with the package name) for a more detailed description. installation from the command line has several variants (like aptitude) but good old sudo apt-get install {} works well.

4

Answer for 2nd question:

Installing font is just copying its file to some folder. There can be many folders. At my system they are:

  • /usr/share/fonts/ — fonts for all users
  • ~/.local/share/fonts/ - fonts for particular user

There can be any subfolders you want.

Here is the command to get list of font files that your system uses.

fc-list -f '%{file}\n' | sort

Look at it and you'll get the idea of where fonts in your system located/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .