Linux find font file

How can I determine which fonts are installed from the command line, and what is the easiest way to install more?

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 8×8 LED matrix.

/usr/share/fonts isn’t there. fc-list command is not found. so far I just downloaded a free arial font from www.dafont.com and used secure copy to transfer it to my beaglebone. i will create a /usr/share/fonts/ directory manually for future use. scp /Users/me/Downloads/pixel_arial_11/PIXEARG_.TTF ubuntu@192.168.7.2:/home/ubuntu/

4 Answers 4

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

/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 . 
fc-list - list available fonts 

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

Источник

Find font file from font name on linux

If urxvt is built with Xft support (check to be sure), you might want to give it font names prefixed by Other options affecting font matching and rendering may be specified in xft font name: (search for for further details) No server upload necessary Screenshot Solution 2: (part of GNOME of course) can do this (this is the default association for fonts under GNOME); indeed, it comes with a button to install the font, which obviously wouldn’t make sense if the font needed to be installed already.

Find font file from font name on Linux

Also give a try to fc-scan , fc-match

where FontName is the exact font name found with

fc-list | grep -i approximate-or-partial-font-name

How to find out which font can display these characters?, Yes, after install python3-fonttools , your script list all fonts which contain this character. I can pick up each font and test. thanks. –

How to Install Fonts in Ubuntu

Most people will be happy with the default font sets installed on Linux, which dictate the fonts Duration: 4:46

Читайте также:  Chmod 777 astra linux

How to get the real name of font?

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

How to Install (and Remove) Font Files on Windows 10, Basically, if you install the font for all users, Windows is copying the file you just selected into C:\Windows\Fonts , which is the system font

How to view a TTF font file?

I use character maps heavily and decides to make one which you access from anywhere using a web interface and requires no installation. Works best on Chrome.

  • Select your own font file
  • Provides font and character information
  • Character copy-able
  • Supports TTF/OTF
  • Supports Icon fonts
  • Simple interface
  • No installation necessary
  • No server upload necessary

Imgur

gnome-font-viewer (part of GNOME of course) can do this (this is the default association for fonts under GNOME); indeed, it comes with a button to install the font, which obviously wouldn’t make sense if the font needed to be installed already.

fontmatrix lets you organize groups of fonts to be installed or uninstalled, and you can preview them and see their features, whether installed or not.

Most font editors, like fontforge, certainly don’t require the fonts to be installed to open them up and look at them.

display OpenSans-CondBold.ttf 

what <code data-lazy-src=

Locating fonts on Linux (in C++)

I want to be able to get the absolute path to a ttf font file on Linux when given a font name (if it exists). Is there a command or API that will return that information? For example, given «arial.ttf» I want to find the absolute path (e.g. /usr/share/fonts/truetype/msttcorefonts/arial.ttf) wherever that may be.

2 Answers 2

The easiest way is probably to use fontconfig with the —format option:

$ fc-match --format=% LiberationSans-Regular.ttf 

will result in the output

/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf 

Instead of the font file name, you can also supply a font description that may be something like mono , DejaVu , :weight=bold , DejaVu-12 , or DejaVu:weight=bold . So, for example,

$ fc-match --format=% :weight=bold 
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf 

on my system. The only thing that does not seem to work is giving the complete path of the font file.

@Mohan As I said: Just replace the file name with the font description. I have added a working example for the font description now. Hope it helps.

Arguably, it’s a really bad idea to try to access fonts by path, the linux fonts stack is not designed this way. There won’t be any stability in locations and a lot of the «fonts» users expect in font lists do not map to a single font file but are composites of multiple font files.

If you want to be consistent with all the other desktop apps (and users expect the font choices to work the same way in all apps) you need to access fonts by patterns through the fontconfig indirection layer (using pango-cairo, or QT) and accept the result may be complex and not intuitive.

It does not matter that it seems less than intuitive to you, it only matters that font selections work the same way as in all other apps. And usually there are very good reasons for fontconfig mapping choices.

Источник

Find font file from font name on Linux

I have a font with the name Media Gothic. How can I find the file name of that font in Linux? I need to copy that file to another system. I’ve tried:

find /usr/share/fonts/ -name '*media*' 

But this gives no results. gothic gives some other fonts. TTF is a binary format so I can’t use grep .

2 Answers 2

Also give a try to fc-scan , fc-match

How does this help locate the actual font file? The font file name might be (at best) a scrambled version of the actual font name.

where FontName is the exact font name found with

fc-list | grep -i approximate-or-partial-font-name

On newer systems — yes, but on older ones fc-list withouth the file command does not show filenames for the fonts listed. And the file command could only be specified after a FontName.

You should mention that in answer, that on older system accepted answer don’t show files names and you need to call fc-list again to get the filename.

Portable 1-liner (w/ extra, automating steps). fc-list $(fc-list|grep -i |head -n 1|awk ») file|sed ‘s/: $//’ . e.g., Unifont; steps — in: $ fc-list|grep -i unifont , out: 1st of 3 lines: /usr/share/fonts/unifont-fonts/unifont-14.0.01.ttf: Unifont:style=Regular’ .Just name — in: $ fc-list|grep -i unifont|head -n1|awk » , out: Unifont:style=Regular .Answer above — in: $ fc-list $(fc-list|grep -i unifont|head -n 1|awk ») file , out: /usr/share/fonts/unifont-fonts/unifont-14.0.01.ttf: Lose colon w/ pipe to sed ‘s/: $//’

Источник

Оцените статью
Adblock
detector