oh-my-posh/website/docs/installation/fonts.mdx

119 lines
3.7 KiB
Plaintext
Raw Normal View History

2021-03-12 16:19:26 -08:00
---
2022-04-20 09:43:59 -07:00
id: fonts
2021-03-12 16:19:26 -08:00
title: Fonts
2022-06-03 07:47:56 -07:00
sidebar_label: 🔤 Fonts
2021-03-12 16:19:26 -08:00
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
2021-03-12 16:19:26 -08:00
### Nerd Fonts
Oh My Posh was designed to use [Nerd Fonts][nerdfonts]. Nerd Fonts are popular fonts that are patched to include icons.
2021-03-12 16:19:26 -08:00
We recommend [Meslo LGM NF][meslo], but any Nerd Font should be compatible with the standard [themes][themes].
To see the icons displayed in Oh My Posh, **install** a [Nerd Font][nerdfonts], and **configure** your terminal to use it.
2021-03-12 16:19:26 -08:00
### Installation
2021-03-12 16:19:26 -08:00
<Tabs
defaultValue="oh-my-posh"
values={[
{ label: 'Oh My Posh', value: 'oh-my-posh' },
{ label: 'homebrew', value: 'homebrew' }
]
}>
<TabItem value="oh-my-posh">
Oh My Posh has a CLI to help you select and install a [Nerd Font][nerdfonts] (beta):
:::caution Windows
2023-06-12 11:19:47 -07:00
This command is best executed as admin so that fonts are installed system wide.
In case you have no admin rights, you can install the fonts by adding the `--user` flag.
Do know this can have side-effects when using certain applications.
2022-06-03 07:47:56 -07:00
:::
```bash
oh-my-posh font install
```
2021-03-12 16:19:26 -08:00
</TabItem>
<TabItem value="homebrew">
If you're using Homebrew, you can tap the `homebrew-cask-fonts` repository and install Nerd Fonts from there instead:
```bash
brew tap homebrew/cask-fonts # You only need to do this once!
brew search nerd-font # Search for font packages
# EXAMPLE: Install the NF version of Fira Code
brew install --cask font-fira-code-nerd-font
```
</TabItem>
</Tabs>
### Configuration
Make sure to **configure your terminal** to use the font you have installed. The following sections will show you how to do this for the most popular terminals.
<Tabs
defaultValue="wt"
values={[
{ label: 'Windows Terminal', value: 'wt' },
{ label: 'VS Code', value: 'code' }
]
}>
<TabItem value="wt">
:::caution Text renderer
To ensure correct rendering of the glyphs you will need to enable the option `Use the new text renderer ("AtlasEngine")` in your terminal settings.
For further details, see [here][wt-issue-8993].
:::
2021-03-12 16:19:26 -08:00
Once you have installed a Nerd Font, you will need to configure the Windows Terminal to use it. This can be easily done
by modifying the Windows Terminal settings (default shortcut: `CTRL + SHIFT + ,`). In your `settings.json` file, add the
2022-04-26 10:50:38 -07:00
`font.face` attribute under the `defaults` attribute in `profiles`:
2021-03-12 16:19:26 -08:00
```json
{
"profiles":
{
"defaults":
{
"font":
{
"face": "MesloLGM Nerd Font"
}
2021-03-12 16:19:26 -08:00
}
}
}
```
</TabItem>
<TabItem value="code">
When using Visual Studio Code, you will need to configure the integrated Terminal to make use of the Nerd Font as well. This can be done by changing the `Integrated: Font Family` value in the Terminal settings (default shortcut: `CTRL + ,` and search for `Integrated: Font Family` or via `Users` -> `Features` -> `Terminal`).
2023-06-19 05:51:30 -07:00
If you are using the JSON based settings, you will need to update the `terminal.integrated.fontFamily` value. Example in case of `MesloLGM Nerd Font` Nerd Font:
```json
2023-06-19 05:51:30 -07:00
"terminal.integrated.fontFamily": "MesloLGM Nerd Font"
```
</TabItem>
</Tabs>
2021-03-12 16:19:26 -08:00
### Other Fonts
If you are not interested in using a Nerd Font, you will want to use a theme which doesn't include any Nerd Font icons.
The `minimal` themes do not make use of Nerd Font icons.
[Creating your own theme][configuration] is always an option too 😊
[nerdfonts]: https://www.nerdfonts.com/
2023-06-22 10:58:18 -07:00
[meslo]: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Meslo.zip
2021-03-12 16:19:26 -08:00
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[configuration]: /docs/installation/customize
[wt-issue-8993]: https://github.com/microsoft/terminal/issues/8993