Can't change fontFace in Windows Terminal

Viewed 13974

Trying out Windows Terminal customization via settings.json. I found a profiles.json that follow the new conventions closely enough to work when pasted into settings.json, (I know it took because the theme changed). The problem is that changes to "fontFace" are not having any effect. I'm trying to use a nerd font for some powerline stuff, works in Powershell running in ConEmu but not in Windows Terminal. Here is the relevant portion of settings.json:

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings

    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,

    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,

    // A profile specifies a command to execute paired with information about how it should look and feel.
    // Each one of them will appear in the 'New Tab' dropdown,
    //   and can be invoked from the commandline with `wt.exe -p xxx`
    // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
            "cursorShape": "vintage",
            "fontFace": "Iosevka Nerd Font"
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false,
                "fontFace": "Iosevka Nerd Font",
                "colorScheme": "PowerShellTom",
                "useAcrylic": true,
                "acrylicOpacity": 0.8
            },
            { ...

I get the same behavior in Windows Terminal Preview, which is supposed to be the least "bleeding edge" version.

Even trying non-nerd fonts for "fontFace" has no effect, however, "fontSize" will work.

4 Answers

For people who are coming from SCOTT HANSELMAN article (especially from the third step)

  1. Install Cascadia Code for all users

enter image description here

  1. Change the "fontFace" property in the settings.json like this
    Shortcut to open settings.json: Ctrl+Shift+, (comma)

enter image description here

here is the code to copy

"profiles": {
   "defaults": {
      "fontFace": "Cascadia Code PL"
      // Put settings here that you want to apply to all profiles.
    }
}

This is the only way I made that work (after 2 hours or trying)

Change the fontFace from "Iosevka Nerd Font" to just "Iosevka"; the fontFace attribute expects a font family, as far as I'm aware this isn't in the documentation and I only found it out after reading this issue on the WT github

From a comment to the Issue I opened on Windows Terminal's GitHub page, (#6606), I was directed to another fontFace problem where choosing another font would not stick if you reopened WT, (not quite the problem I was having).

Anyway, the current solution to that is to uninstall any font you want to use, then right-click and choose "Install for all users". Double-click the file to open the sample view, and use the font name found just below the the two buttons. use the spaces in the font name as is in your settings.json file.

This worked for MesloLGL NF, but not Iosevka NF.

I wanted to install MesloLGS NF Regular as a recommended font for Powerlevel10k in WindowsTerminal for WSL: https://github.com/romkatv/powerlevel10k/blob/master/font.md

To make it work I had to:

  1. Install it for all users as @hakan-fıstık showed in his answer.
  2. Change the "fontFace" in settings.json to "MesloLGS NF" (Supplying full names of fonts is not working as supposed to).
  3. Be sure to change size of font (changing font may make it huge): https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-appearance
Related