Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NvChad - Nerd Fonts - new installation method #2007

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/books/nvchad/images/font_nerd_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 44 additions & 11 deletions docs/books/nvchad/nerd_fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,61 @@ Fonts are available for download at:
https://www.nerdfonts.com/font-downloads
```

## :material-monitor-arrow-down-variant: Installation
### :material-monitor-arrow-down-variant: Installation procedure

The procedure for installing fonts on Rocky Linux is to save the fonts you want to add somewhere, and then install them with the `fc-cache` command. This procedure is not a true installation so much as a registration of the new fonts in the system.
The installation of Nerd Fonts in Rocky Linux is done entirely from the command line thanks to the implementation of the procedure provided by the project repository [ryanoasis/nerd-fonts](https://github.com/ryanoasis/nerd-fonts), the procedure uses *git* to retrieve the required fonts and *fc-cache* for their configuration.

!!! warning "Creation of compressed packages"
!!! Note

The procedure described below is not a standard procedure as each developer has packaged fonts using a custom scheme. So once downloaded and extracted, the contents must be checked to choose the procedure for copying the fonts.
This method can be used on all *linux* distributions that use [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) for system font management.

For this guide we will use the `Sauce Code Pro Nerd` font.
To begin, retrieve the necessary files from the project repository:

Download the package with:
```bash
git clone --filter=blob:none --sparse git@github.com:ryanoasis/nerd-fonts
```

This command downloads only the necessary files omitting the fonts contained in *patched-fonts* so as not to weigh down the local repository with fonts that later will not be used, thus allowing for selective installation.
This guide will use the [IBM Plex Mono](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/IBMPlexMono) font, which offers a clean and slightly typographic display, features that make it particularly suitable for writing Markdown documentation.
For an overview, with preview, of available fonts you can visit the [dedicated site](https://www.programmingfonts.org/#plex-mono).

Go to the newly created folder and then download the font set with the commands:

```bash
https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/SourceCodePro.zip
cd ~/nerd-fonts/
git sparse-checkout add patched-fonts/IBMPlexMono
```

Next, unzip the contents of the folder and copy the fonts to `~/.local/share/fonts/` with:
The command will download the fonts to the *patched-fonts* folder and once finished you can install them with the ==install.sh== script provided, type:

```bash
mkdir ~/.local/share/fonts
unzip SourceCodePro.zip -d ~/.local/share/fonts/
fc-cache ~/.local/share/fonts
./install.sh IBMPlexMono
```

!!! Note "Reserved Name"

The font during installation is renamed to *BlexMono* to comply with the SIL Open Font License (OFL) and in particular the [reserved name mechanism](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a).

The *install.sh* script copies the fonts to the user folder `~/.local/share/fonts/` and invokes the *fc-cache* program to register them on the system. Once finished the fonts will be available for the terminal emulator, in particular we will find the following fonts installed:

```text title="~/.local/share/fonts/"
NerdFonts/
├── BlexMonoNerdFont-BoldItalic.ttf
├── BlexMonoNerdFont-Bold.ttf
├── BlexMonoNerdFont-ExtraLightItalic.ttf
├── BlexMonoNerdFont-ExtraLight.ttf
├── BlexMonoNerdFont-Italic.ttf
├── BlexMonoNerdFont-LightItalic.ttf
├── BlexMonoNerdFont-Light.ttf
├── BlexMonoNerdFont-MediumItalic.ttf
├── BlexMonoNerdFont-Medium.ttf
├── BlexMonoNerdFont-Regular.ttf
├── BlexMonoNerdFont-SemiBoldItalic.ttf
├── BlexMonoNerdFont-SemiBold.ttf
├── BlexMonoNerdFont-TextItalic.ttf
├── BlexMonoNerdFont-Text.ttf
├── BlexMonoNerdFont-ThinItalic.ttf
├── BlexMonoNerdFont-Thin.ttf
```

## :material-file-cog-outline: Configuration
Expand Down
Loading