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.

user391339
  • 1,519

4 Answers4

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

d a i s y
  • 5,511
15

if you need to get the font family name:

fc-list : family | sort | uniq

Savrige
  • 253
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/

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.

grantbow
  • 976