How to Install, Update Fonts in Linux

Configurare noua (How To)

Situatie

Adding Fonts in Linux

Solutie

Linux supports two primary locations to place new fonts. The first location makes fonts available globally, so if more than one person logs into your Linux server and wants to have access to more than the standard font, the directory for those fonts is /usr/share/fonts. Within that directory you’ll find five subdirectories, three of which are important:

/usr/share/fonts/opentype

/usr/share/fonts/truetype

/usr/share/fonts/truetype1

The first directories where you place opentype fonts. These fonts generally have the .otf file extension. The second and third directories house truetype fonts, which typically end in .ttf.

The second directory, for user-specific fonts, is found in /home/USER/.fonts (Where USER is the actual username). Fonts stored in this directory can only be used by that particular user. Not all Linux distributions create this directory by default. If you open your file manager, you’ll need to instruct it to display hidden directories (directories which start with a dot). For most file managers, press Ctrl+H. If you don’t see that directory, create it by either right-clicking in your file manager and selecting New > Folder, or you can open a terminal window and issue the command:

mkdir ~/.fonts

There is no need to create subfolders to house opentype and truetype fonts, as they will all be housed within that same directory.

Adding Fonts

Move your .ttf, .TTF, or .otf files into the correct directory. You’ll have to work from a shell prompt to add global fonts because a standard user doesn’t have permission to move files into /usr/share/fonts/.

If you’ve downloaded a bunch of .ttf fonts into your user Download directory (/home/user/Downloads), moveve those fonts into the global directory by issuing the following command:

sudo mv ~/Downloads/*.ttf /usr/share/fonts/truetype/
Next, make the system aware of the change by issuing the command:
sudo fc-cache -fv
When fc-cache completes, all users on the system enjoy access to the newly added global fonts.

 

Tip solutie

Permanent

Voteaza

(11 din 27 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?