Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to change fonts in Ubuntu

Shulou Source: shulou.com Published: 2022-06-01 18:29:48 10月02日 Update

This article will explain in detail how to change fonts in Ubuntu, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Download and extract the font

First, download the font you want to install. In this tutorial, we will use Hack fonts. Download fonts from github using wget:

Bob@ubuntu-18-04Vera $wget https://github.com/source-foundry/Hack/releases/download/v3.003/Hack-v3.003-ttf.tar.xz

Now extract the file:

Bob@ubuntu-18-04 xvf Hack-v3.003-ttf.tar.xz $tar-xvf Hack-v3.003-ttf.tar.xz /. / Hack-Bold.ttf./Hack-BoldItalic.ttf./Hack-Italic.ttf./Hack-Regular.ttf

Now we can install fonts.

Download fonts in ubuntu

Fonts are usually installed in the / usr/share/fonts/ font directory, or in the following directory: ~ / .local/share/fonts/ or / usr/local/share/fonts. In this example, we will use ~ / .local / share/fonts/path/. If the directory does not exist, create it using the following command:

Bob@ubuntu-18-04 local/share/fonts $mkdir-p ~ /.

Now let's move the font to the directory we just created:

Bob@ubuntu-18-04 local/share/fonts $mv Hack-*.ttf ~ /.

Regenerate the font cache

Finally, the font cache is regenerated using fontconfig.

Bob@ubuntu-18-04VANG $fc-cache-f-v

Verify that the font is installed

Use fc-list to view the installed fonts and filter out the desired results through grep:

Bob@ubuntu-18-04 grep Hack $fc-list | grep "Hack"

Uninstall installed fonts

The process of unloading fonts, deleting fonts, and then regenerating the font cache:

Bob@ubuntu-18-04 rf $rm-rf ~ / .local / local / share/fonts/Hack-*.ttfbob@ubuntu-18-04rf $fc-cache about how to change fonts in Ubuntu. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Fonts directories caching generation content articles more knowledge articles good commands tutorials files results quality process reference help related check Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Shulou Tech Info Apple macOS