From 2ea82878563b4080f566262dc3f1b508eea36cb9 Mon Sep 17 00:00:00 2001 From: "Justin W. Flory (he/him)" Date: Mon, 2 Nov 2020 14:14:13 -0500 Subject: [PATCH] fonts: Refactor fonts page into something more comprehensive This commit refactors the content for the fonts page. I focused on organization and layout. I restructured the previous layout from a more command line vs. GUI approach, and instead emphasized "packaged vs. unpackaged" fonts. I was inspired to rework this page because I went looking for it recently, and the search engine led me here. :-) Signed-off-by: Justin W. Flory (he/him) --- modules/ROOT/nav.adoc | 2 +- .../proc_adding-new-fonts-as-superuser.adoc | 81 ----------- .../proc_adding-new-fonts-as-user.adoc | 71 --------- modules/ROOT/pages/fonts.adoc | 137 +++++++++++++++++- 4 files changed, 132 insertions(+), 159 deletions(-) delete mode 100644 modules/ROOT/pages/_partials/proc_adding-new-fonts-as-superuser.adoc delete mode 100644 modules/ROOT/pages/_partials/proc_adding-new-fonts-as-user.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index d222656..545218a 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -23,7 +23,7 @@ ** xref:gnome-shell-extensions.adoc[Using GNOME Shell extensions] ** xref:wine.adoc[Running Windows applications with Wine] ** xref:using-adobe-flash.adoc[Using Adobe Flash] -** xref:adding-new-fonts-fedora.adoc[Adding new fonts in Fedora] +** xref:fonts.adoc[Adding new fonts] ** xref:create-gpg-keys.adoc[Creating GPG Keys] ** xref:bootloading-with-grub2.adoc[Bootloading with GRUB2] ** xref:securing-the-system-by-keeping-it-up-to-date.adoc[Securing the system by keeping it up-to-date] diff --git a/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-superuser.adoc b/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-superuser.adoc deleted file mode 100644 index 1c775cc..0000000 --- a/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-superuser.adoc +++ /dev/null @@ -1,81 +0,0 @@ -[[adding-new-fonts-as-superuser]] -= Adding new fonts as the superuser - -System fonts are available to all system users. If you need to add system fonts, there are two ways: - -. Use the `dnf` package manager to install font packages, -. Manually add fonts to the system and update the font cache to make them available to the users. - -[WARNING] -==== -If you manually add system-wide fonts, you will not be able to control them with the package manager. If the font is provided as a distribution package, you should always use the package manager to install it. -==== - - -[[installing-new-fonts-with-dnf]] -== Installing new fonts with dnf - -Whenever you can add new fonts by installing a font package with the `dnf` package manager, you should do so. This method gives you control over the font package in the future, such as updating the package and removing it from the system. - -To install a font package with `dnf`: - - -[discrete] -=== Before you start - -* Add and enable repositories with font packages. -+ -[NOTE] -==== -A lot of fonts are available from the RPMfusion repository. To enable the repository on your system, follow xref:setup_rpmfusion.adoc[these instructions]. -==== - - -[discrete] -=== Procedure - -. List all available font packages from enabled repositories. -+ ----- -# dnf search fonts ----- - -. Install the package you need. -+ ----- -# dnf install libreoffice-opensymbol-fonts.noarch ----- - - -[discrete] -=== More information - -* The `dnf search fonts` command lists all available font packages, as well as their descriptions. - - -[[installing-new-fonts-manually]] -== Installing new fonts manually - -When you need to install fonts that are not available in a repository, you can install them manually by copying the font files into a system font directory and updating the font cache. - - -[discrete] -== Procedure - -. Create a new directory in the system's font directory `/usr/share/fonts`, where you will place the font files. -+ ----- -# mkdir /usr/share/fonts/robofont ----- - -. Copy the font file to the font's directory created in the previous step. -+ ----- -# cp ~/fonts/robofont.ttf /usr/share/fonts/robofont ----- - -. Update the font cache. -+ ----- -# fc-cache -v ----- diff --git a/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-user.adoc b/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-user.adoc deleted file mode 100644 index fbccfaf..0000000 --- a/modules/ROOT/pages/_partials/proc_adding-new-fonts-as-user.adoc +++ /dev/null @@ -1,71 +0,0 @@ -[[adding-new-fonts-as-user]] -= Adding new fonts as a user - -When you do not have superuser access to install fonts on the system level, or you only need to install a font that will be available to your user account only, there are two methods to do it. - - -[[adding-new-local-fonts-with-gfv]] -== Adding new local fonts with the Gnome Font Viewer - -The *Gnome Font Viewer* is an application to display the fonts installed on the system. It also allows you to locally install fonts. To add a new font file with *Gnome Font Viewer*: - - -[discrete] -=== Before you start - -* Make sure you have installed the `gnome-font-viewer` package. - - -[discrete] -=== Procedure - -. Open a file manager. - -. Double-click on a font file to open it in the *Gnome Font Viewer*. - -. Click on the blue btn:[Install] button on the top bar. -+ -[NOTE] -==== -Currently, there is a bug in the application. When you click on the btn:[Install] button, it does not inform whether the installation succeeded. -==== - - -[discrete] -=== More information - -* *Gnome Font Viewer* copies the font files to a font directory in the current user's directory `.local/share/fonts` and updates the font cache. - - -[[adding-new-local-fonts-manually]] -== Adding new local fonts manually - -If you do not want to use any tools to add new fonts, you can do it manually. Copy the font files in the `.fonts` directory placed in the user's directory and update the font cache. - - -[discrete] -=== Before you start - -* If it does not exist, create a `.fonts` directory in your user's home directory. - - -[discrete] -=== Procedure - -. In the `.local/share/fonts` directory, create a new directory to place your fonts files. -+ ----- -$ mkdir ~/.local/share/fonts/robofont ----- - -. Copy the font file into the newly created directory. -+ ----- -$ cp robofont.ttf ~/.local/share/fonts/robofont ----- - -. Update the font cache. -+ ----- -$ fc-cache -v ----- diff --git a/modules/ROOT/pages/fonts.adoc b/modules/ROOT/pages/fonts.adoc index ca7818b..e8e0259 100644 --- a/modules/ROOT/pages/fonts.adoc +++ b/modules/ROOT/pages/fonts.adoc @@ -1,16 +1,141 @@ :experimental: ifdef::context[:parent-context: {context}] -:context: adding-new-fonts-fedora +:context: fonts -[[adding-new-fonts-fedora]] +[[fonts]] = Adding new fonts in Fedora +:toc: -include::{partialsdir}/unreviewed-message.adoc[] +Fedora pre-installs several basic fonts by default. +This page explains how to add new fonts to a Fedora installation. -The default installation of the Fedora Linux (Fedora) includes several basic fonts. If you plan to use Fedora for activities such as typesetting and graphic design, you may wish to add additional fonts. -include::{partialsdir}/proc_adding-new-fonts-as-superuser.adoc[leveloffset=+1] +[[packaged]] +== Packaged fonts + +Did you know Fedora packages several freely-licensed fonts? +There are several supplementary fonts to preview and try out that are not installed by default. +Like all fonts on Fedora, these fonts are not encumbered with licenses or restrictions. + +An added benefit of packaged fonts is they give you control over the font package in the future. +You will receive future updates and can easily uninstall it later if you decide it is not the font for you. + +[[gnome-software]] +=== GNOME Software + +[NOTE] +==== +This section uses a Graphical User Interface (G.U.I.) for managing fonts. +==== + +The easiest way to preview and install new fonts is to use [application]`GNOME Software`. +Search for a specific font or search "fonts" in [application]`GNOME Software` to see what other freely-licensed fonts are available. + +[[dnf]] +=== DNF package manager + +[NOTE] +==== +This section uses a Command Line Interface (C.L.I.) for managing fonts. +==== + +If you prefer working in a C.L.I., you can also install fonts with [application]`dnf`. + +Add or enable third-party repositories with font packages:: +Many fonts are available from the RPM Fusion repository. +To enable the repository on your system, follow xref:setup_rpmfusion.adoc[these instructions]. + +List all available font packages from enabled repositories:: +`sudo dnf search fonts` + +Install the font package you need:: +`sudo dnf install libreoffice-opensymbol-fonts` + + +[[unpackaged]] +== Unpackaged fonts + +In many cases, you may want to use a specific font that is not available in Fedora or is not made available under https://freedomdefined.org/Definition[Free Culture] licenses. + +[WARNING] +==== +Unpackaged fonts are not managed by a package manager. +You will not automatically receive updates or optimizations. +If a font is provided by a distribution package, you should always use a packaged version of a font. +==== + +[[system-fonts]] +=== System fonts + +System fonts are installed for all users. +Anyone with an account on the machine will be able to use these fonts. + +Create a new directory `/usr/share/fonts//` for the new font family:: +`sudo mkdir /usr/share/fonts/robofont` + +Copy font files (e.g. `.ttf` files) to the new directory:: +`sudo cp ~/Downloads/robofont.ttf /usr/share/fonts/robofont` + +Update the font cache:: +`sudo fc-cache -v` + +[[user-fonts]] +=== User fonts + +User fonts are installed for an individual user. +Only the user who installs the fonts on the machine will be able to use these fonts. +This is also convenient if you do not have superuser (i.e. `root`) access on the machine. + +There are two ways to install user fonts. + +[[user-fonts--gnome-font-viewer]] +==== GNOME Font Viewer + +[NOTE] +==== +This section uses a Graphical User Interface (G.U.I.) for managing fonts. +==== + +The [application]`GNOME Font Viewer` is an application to display the fonts installed on the system. +It also allows you to locally install fonts. +Follow these steps to add new user fonts with [application]`GNOME Font Viewer`: + +. Install [application]`GNOME Font Viewer`. +** Use GNOME Software or use the command line (`sudo dnf install gnome-font-viewer`) +. Open a file browser. +. Double-click on a font file to open it in [application]`GNOME Font Viewer`. +. Click on the blue btn:[Install] button on the top bar. + +[NOTE] +==== +Currently, there is a bug in the application. +When you click on the btn:[Install] button, it does not inform whether the installation succeeded. +==== + +[application]`GNOME Font Viewer` does two things to install fonts: + +. Copy font files to a font directory in the user's home directory `.local/share/fonts`. +. Update the font cache. + +[[user-fonts--command-line]] +==== Command line + +[NOTE] +==== +This section uses a Command Line Interface (C.L.I.) for managing fonts. +==== + +If you prefer a command line interface, you can install user fonts manually. +Follow these steps in a terminal window to install a font locally: + +Create a new directory `~/.local/share/fonts//` for the new font family:: +`mkdir -p ~/.local/share/fonts/robofont` + +Copy font files (e.g. `.ttf` files) to the new directory:: +`cp ~/Downloads/robofont.ttf ~/.local/share/fonts/robofont` + +Update the font cache:: +`fc-cache -v` -include::{partialsdir}/proc_adding-new-fonts-as-user.adoc[leveloffset=+1] ifdef::parent-context[:context: {parent-context}] ifndef::parent-context[:!context:]