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
---
2023-02-04 02:51:45 -08:00
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
2021-03-12 16:19:26 -08:00
### Nerd Fonts
2021-06-05 10:27:33 -07:00
Oh My Posh was designed to use [Nerd Fonts][nerdfonts]. Nerd Fonts are popular fonts that are patched to include icons.
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
2024-07-16 23:28:21 -07:00
:::info
Fonts need to be installed on the host system as this is a UI setting, not a command line, or shell configuration.
This means **when running inside a container or WSL**, you need to install the font on the host system and configure
your terminal emulator to use it.
:::
2023-03-08 01:27:45 -08:00
### Installation
2021-03-12 16:19:26 -08:00
2023-02-04 02:51:45 -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">
2024-07-01 03:01:25 -07:00
Oh My Posh has a CLI to help you select and install a [Nerd Font][nerdfonts]:
2022-06-02 02:30:41 -07:00
2024-07-01 03:01:25 -07:00
:::info
When running as root/administrator, the fonts will be installed system-wide.
2024-06-10 07:08:11 -07:00
When running as a regular user, the fonts will be installed in the user's font directory.
:::
2022-06-02 02:30:41 -07:00
```bash
oh-my-posh font install
```
2021-03-12 16:19:26 -08:00
2024-06-20 13:45:12 -07:00
This will present a list of Nerd Font libraries, from which you can select `Meslo`, which includes the `Meslo LGM NF` font we recommend. Note that you can also install it directly via:
```bash
oh-my-posh font install meslo
```
2023-02-04 02:51:45 -08:00
</TabItem>
<TabItem value="homebrew">
2024-07-01 03:01:25 -07:00
If you're using Homebrew, you can search for and install Nerd Fonts directly:
2023-02-04 02:51:45 -08:00
```bash
2024-07-01 03:01:25 -07:00
brew search nerd-font
2023-02-04 02:51:45 -08:00
brew install --cask font-fira-code-nerd-font
```
</TabItem>
</Tabs>
2023-03-08 01:27:45 -08:00
### 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' },
2023-12-25 02:18:33 -08:00
{ label: 'Visual Studio Code', value: 'code' },
{ label: 'Visual Studio', value: 'vs' }
2023-03-08 01:27:45 -08:00
]
}>
<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
2021-07-03 01:57:44 -07:00
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":
{
2023-12-25 02:18:33 -08:00
"font":
2023-10-07 03:31:49 -07:00
{
"face": "MesloLGM Nerd Font"
}
2021-03-12 16:19:26 -08:00
}
}
}
```
2023-03-08 01:27:45 -08:00
</TabItem>
<TabItem value="code">
2023-01-12 09:34:00 -08:00
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:
2023-01-12 09:34:00 -08:00
```json
2023-06-19 05:51:30 -07:00
"terminal.integrated.fontFamily": "MesloLGM Nerd Font"
2023-01-12 09:34:00 -08:00
```
2023-12-25 02:18:33 -08:00
</TabItem>
<TabItem value="vs">
When using Visual Studio, you will need to configure the integrated Terminal to make use of the Nerd Font as well. This can be done by opening the settings
in `Tools > Options > Fonts and Colors > Terminal` and selecting a font like `MesloLGM Nerd Font`.
:::warning
OTF fonts do not appear in Visual Studio's Terminal settings, only TTF fonts. See [here][vs-otf] for more information.
:::
2023-03-08 01:27:45 -08:00
</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-10-15 22:31:32 -07:00
[configuration]: /docs/installation/customize
2023-03-08 01:27:45 -08:00
[wt-issue-8993]: https://github.com/microsoft/terminal/issues/8993
2023-12-25 02:18:33 -08:00
[vs-otf]: https://stackoverflow.com/questions/75252606/is-it-possible-to-use-nerd-fonts-as-the-font-for-terminals-in-visual-studio