- Установка шрифтов в Linux
- Установка шрифтов в Linux
- Установка шрифтов TrueType от Microsoft в Linux
- Установка шрифтов ClearType от Microsoft в Linux
- Установка других шрифтов Windows в Linux
- How to Manually Install, Update, and Uninstall Fonts on Linux
- Install Fonts on Linux
- Step 1 : Pull the fonts to your system
- Step 2 : Unpack the font archive
- Step 3 : Install the fonts
- Step 4 : Clear and regenerate your font cache
- Step 5 : Verify the installation
- Step 6 : Cleanup
- All Together Now
- Uninstall Fonts on Linux
- Step 1 : Identify the font binary paths
- Step 2: Remove the font binaries
- Step 3: Clear and regenerate the font cache
- How to Install Fonts on Ubuntu
- Downloading and unpacking the chosen font
- Installing fonts in Ubuntu Linux
- Clear and regenerate font cache
- Verify the font installation
- Install fonts using Font Manager
- Uninstall Fonts on Ubuntu Linux
- Conclusion
Установка шрифтов в Linux
Если вы являетесь современным человеком и используете часто все возможности графических редакторов, то Установка шрифтов в Linux является для вас обязательной информацией при переходе на новую систему. Особенно это касается пользователей Windows где установка шрифтов заключается в буквально «двух» шагах и, особенности Linux могут показаться довольно сложными, но это не совсем так. Ведь в современных сборках этот процесс упростили, и он практически является таким же как и у аналогов на Windows и macOS. В этой статье вы узнаете, как установить шрифты в Linux быстро и легко. Но для начала нам нужно скачать какой-то набор шрифтов, для примера и вы сможете сами попробовать все установить.
Установка шрифтов в Linux
Как мы уже сказали выше, мы разберем интересные варианты быстрой установки шрифтов в Linux и расскажем, как установить ClearType, TrueType и других шрифты Windows в Linux. Будем делать все поэтапно чтобы даже начинающий пользователь смог просто ориентироваться в этом. Главное, что нужно знать перед началом, это как запустить «Терминал». Далее все еще намного проще, чем запуск простой программы. Если вы уже определились в шрифте который, вы хотите установить на свою редакцию Linux то, давайте продолжим.
Шрифты а именно растровые, чаще всего распространяются в форматах PCF, BDF. А если говорить о векторных то, это форматы: TrueType или TTF, Type1, Type3, Open Type или MetaFont.
Если говорить про разницу между растровыми или векторными, то здесь она в принципе очень «тонкая» с оговоркой на то, что векторные шрифты более распространенные и пользуются большей популярностью среди пользователей.
Система Linux использует две основные папки для хранения шрифтов: /usr/share/fonts – это для глобальных шрифтов и папка с названием «fonts» для шрифтов которые доступны только для пользователя. Установка шрифтов как мы сказали выше, очень простая и заключается в копировании файла в определенную папку с категорией.
Установка шрифтов в Linux может показаться аналогичной Windows но, здесь все немного более интересней.
Для начала перейдите по пути указанном выше и создайте папку «Fonts» если такой не существует. Для этого можете использовать быструю команду: $ mkdir
И после этого установка шрифтов в Linux будет заключаться в простом копировании файлов в папку:
Если вы скачали заархивированный шрифт, то сначала его нужно распаковать. И после этого произвести действия для установки. Главное, установить шрифт в нужную папку. Это важно для многих редакторов, которые работают с системой.
После копирования очень желательно будет обновить кэш шрифтов в системе, делается это по такой команде:
Но в Linux есть еще более удобный вариант, который привнесла Ubuntu, а именно установка шрифтов в Linux через менеджер пакетов. Который позволяет еще быстрее установить нужные шрифты. Давайте приведем в пример, очень популярный шрифт «Compact» и теперь попробуем найти его в списке пакетов:
- $ sudo apt search compact
После того как убедились в его наличии, мы можем его установить, с помощью такой команды как:
- $ sudo apt install compact
После этих манипуляций обновлять кэш шрифтов в принципе не обязательно, ведь он обновился вместе с установочным пакетом. Установка шрифтов от Windows происходит подобным образом, но давайте разберем эту тему еще более подробно. Тем более что многим это может пригодится для редакторов.
Установка шрифтов TrueType от Microsoft в Linux
Microsoft в свое время более интенсивно старалась контролировать все что связанно с операционными системами и в 1996 году выпустила набор шрифтов TrueType чтобы сделать их стандартом во всех обозревателях на то время. И действительно так было, эти шрифты смогли завоевать популярность и до сих пор пользуются огромной востребованностью среди пользователей. А самое главное, что компания выпустила их в «свободной» лицензии что позволяет их установку любому желающему.
В Ubuntu установка шрифтов является очень простой. И для того чтобы установить себе эти шрифты в систему, можно открыть «Терминал» и ввести:
- $ sudo apt install ttf-mscorefonts-installer
Шрифты очень быстро установятся на вашу систему. Но перед этим терминал попросит вас принять лицензионное соглашение Microsoft которое нужно для завершения установки.
После того как в окне появится текст «Лицензии» вам нужно будет с помощью стрелок на клавиатуре пролистать его и с помощью кнопки «Tab» принять «Лицензию». Все установка шрифта, должна пройти успешно. Кстати, если у вас есть какие-то вопросы, то можете сразу писать их в форму комментариев на нашем сайте.
Установка шрифтов ClearType от Microsoft в Linux
Этот способ является по сути аналогичным предыдущему и его также нужно выполнять через «Консоль». Конечно мы расскажем вам какие команды нужно использовать для быстрой установки. Ведь установка шрифтов в Linux как можно понять, очень быстрая.
В Microsoft в 2007 году решили обновить старый пакет шрифтов, новым улучшенным набором. В который входят такие популярные шрифты как известный Corbel, Cambria и Collibri. Они в данный момент являются очень востребованным среди дизайнеров и простых пользователей, ведь по сути их главная особенность это универсальность и очень удобное, стильное оформление, которое отлично подстраиваться под многие форматы. Что очень ценится многими.
Если вам нужно установить только ClearType шрифты и до этого вы не устанавливали TrueType, то вам необходимо ввести такую команду для установки Cabextract:
- $ sudo apt-get install cabextract
Далее создайте папку с локальными шрифтами, если вы еще не сделали этого:
Затем вам нужно будет выполнить установку шрифта в Linux:
- $ wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer | bash
Установка других шрифтов Windows в Linux
Установка других шрифтов Windows в Linux является аналогичной вариантам про которые мы уже рассказали вам выше. Главное найти нужный вам шрифт и скопировать его в папку или выполнить специальную команду в «Терминале». Любой из вариантов, как мне кажется является очень удобным ведь установка шрифтов в Linux в любом случае будет очень простой. И требует элементарных знаний в системе. Так вы сможете действовать в пределах системы более свободно и иногда выполнять команды получается еще быстрее чем пользоваться графическим интерфейсом. Что является огромным плюсом при работе с большим количеством файлов.
Если у вас есть чем дополнить статью, то пишите свое мнение в форму комментариев на нашем сайте. К тому же если информация будет действительно полезной или интересной, то мы дополним статью для других пользователей.
Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.
Источник
How to Manually Install, Update, and Uninstall Fonts on Linux
The management of fonts that are not packaged in Linux distributions can be performed with a handful of command line tasks. While this takes a bit more effort than font management with a GUI font manager or package manager application, the steps are simple, and an understanding of them will allow you to install and use the many unpackaged fonts that are available out there.
This article demonstrates a command line approach to install desktop fonts (i.e., the *.otf and *.ttf build varieties), clear and regenerate your font cache, and verify your font installation. I provide an example shell script that pulls all of the steps together into a single command for those who want to use it as a basis for a custom installation + upgrade script. In the final section, I demonstrate how to locate and uninstall fonts that you don’t need.
We will use our Hack fonts as released in font binary format through a Github repository to demonstrate the entire process. These steps assume that font files are accessible through HTTP GET requests and come packaged in a gzipped tar archive. Feel free to modify the paths in each step to install any set of fonts that meet these criteria.
Install Fonts on Linux
Step 1 : Pull the fonts to your system
To pull a font archive from a publicly accessible server with a HTTP GET request, navigate to a directory of your choice and use cURL:
Step 2 : Unpack the font archive
Unpack the gzipped tar archive with tar :
For the Hack fonts, this results in an unpacked directory path, ttf . The fonts are contained in the root of the directory. Archives from other typeface projects may result in a different unpacked path structure. If you are installing a different set of fonts, review the font paths before you move on to the next step.
Step 3 : Install the fonts
On Linux systems, font binaries are generally installed in either the system font directory on the path /usr/share/fonts/ or in a user font directory that is frequently on one of the following paths:
/.local/share/fonts/ or /usr/local/share/fonts . We’ll use the
/.local/share/fonts/ path in this example. If the directory does not exist, create it with the following command:
Move your font binaries to the destination directory with mv :
Step 4 : Clear and regenerate your font cache
Next, clear and regenerate your font cache with the following command:
You will see a stream of text as the font cache is created. This can be a lengthy body of text if you have a large number of fonts installed on your system. If you examine the text closely, you should see that your new font installs were identified during this process.
Step 5 : Verify the installation
Confirm that the fonts are installed by displaying the paths and style definitions with the fc-list executable filtered on the font family name with grep :
On my system, the following text is displayed:
The fonts are now installed and ready for use.
Step 6 : Cleanup
The archive file and unpacked directory are no longer necessary. Let’s remove them:
All Together Now
We provide a shell script for Hack font installs that pulls these steps together into a single command for our Linux users.
The command to manually install version 3.003 of our fonts looks like this:
To upgrade the fonts, users increment the version number in the command as new releases are pushed to the Github repository.
A Github gist of the script source follows. If you followed along above you will notice that the commands are identical to the examples in the steps that we just reviewed.
- Step 1 is on line 42
- Step 2 is on line 47
- Step 3 is on lines 61–71
- Step 4 is on line 81
- Step 5 is on line 85
- Step 6 is on lines 58 & 75
The script is MIT licensed and can be modified by typeface developers and users to support simple initial installs and upgrades for other projects that release in a similar way.
Uninstall Fonts on Linux
The process to uninstall fonts requires identification of the installation paths, removal of the font binaries, and regeneration of the font cache. The font removal step is the only new task that you need to learn if you went through the installation steps in the section above. Be aware that the removal of font binaries with rm step eliminates the files permanently. Please consider backups if they are not readily accessible in the future and you might have a need for them again!
Step 1 : Identify the font binary paths
Use the fc-list executable with grep to identify the paths to the installed fonts by family name:
Modify the grep search term to identify other font families.
Step 2: Remove the font binaries
Use the rm executable to remove the installed font binaries on the paths that you identified with the command in Step 1. This permanently deletes the files. Use caution (and backup copies somewhere!) if the files are not readily accessible should you need them again.
If you used the installation steps above to install the Hack fonts, the following command will remove the fonts:
Step 3: Clear and regenerate the font cache
Then regenerate your font cache:
And that is a manual font management round trip on the Linux command line. Enjoy the many new typeface options that are available to you on your Linux box!
I would like to thank Paride Legovini for his technical review and feedback on this article. His input was very helpful and improved the tutorial.
Your feedback is extremely helpful to us. If you identify any errors or have suggestions for improvements to the approach that was used in this article, please submit a new issue report on our Github repository.
Источник
How to Install Fonts on Ubuntu
In Ubuntu, you already have many fonts installed by default, but there might be a time you would want to install some additional fonts. Or maybe you want to install Microsoft fonts and Google web fonts for off-line use or for your website.
In any case, we will now see how to install fonts on Ubuntu 18.04 Linux distribution.
Downloading and unpacking the chosen font
Let’s see how we can install True Type or Open Type fonts (.ttf, .otf, .ttc) in Ubuntu 18.04.
First, we need to download the fonts we want to install. In this tutorial, we will use Hack fonts to install on our Ubuntu 18.04. We will download the fonts using cUrl with the following command:
Next, we will unpack the file using tar:
Now we can proceed with installing our downloaded font.
Installing fonts in Ubuntu Linux
Font files are generally installed in either the system font directory on the path /usr/share/fonts/ or in a user font directory that is frequently on one of the following paths:
/.local/share/fonts/ or /usr/local/share/fonts. We’ll use the
/.local/share/fonts/ path in this example. If the directory does not exist, create it with the following command:
Now we will move the fonts to destination folder with mv command:
You can now optionally also remove the empty ttf folder and downloaded archive:
Clear and regenerate font cache
Finally, we need to build font information caches for apps using fontconfig for their font handling:
If you get the following error, you’ll need to install the fontconfig package first:
Install the fontconfig package with the following command:
Type Y for apt-get to proceed.
And now we can continue rebuilding the font cache:
From this terminal output, we can see that our new fonts were identified during this process.
Verify the font installation
Confirm that the fonts are installed by displaying the paths and style definitions with the fc-list command filtered on the font family name with grep:
The fonts are now installed and ready for use.
Install fonts using Font Manager
Fonts you have downloaded can be installed by double-clicking on the font file.
It will open it in Gnome Font Viewer. In here, you can see the option to install the font in the top right corner:
You can also install Font Manager application and manage fonts that way. To install Font Manager in Ubuntu, open a terminal and use the command below:
You can see installed fonts here and options to install new fonts, remove existing fonts, etc.
To remove Font Manager, use the command below:
Uninstall Fonts on Ubuntu Linux
We will now see how to uninstall these fonts. The process of uninstalling fonts consists of the identification of the installation paths, removal of the font binaries, and regeneration of the font cache.
First, use the fc-list command with grep to identify the paths to the installed fonts by family name:
NOTE: Modify the grep search term to identify other font families.
Now use the rm command to remove the installed font files on the paths that you identified with the fc-list command:
Now regenerate your font cache with the following command:
Conclusion
In this tutorial, we have learned how to manually manage fonts using the Ubuntu Linux command line, and also manage them using GUI font tools. If you have any questions or comments, please post them below.
Источник