8

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.

Tom Fetherston
  • 149
  • 1
  • 7
  • What version of Windows Terminal are you using? – apena Jun 19 '20 at 19:15
  • The about dialog gives the version as Version: 1.0.1401.0 – Tom Fetherston Jun 20 '20 at 02:21
  • for 'Windows Terminal Preview', (which has the same problem), it is Version: 1.1.1671.0 – Tom Fetherston Jun 20 '20 at 02:39
  • Created an issue for this Windows Terminal github page, got pointed to similar issues that involve only installing the font for current user rather than all users. I'm playing with that but no joy yet. Major pain as I used the install.ps included with the Nerd "patched fonts" folder to install all the nerd fonts, which it does for the current user. – Tom Fetherston Jun 20 '20 at 10:55
  • I've found that there is a registry key for each of the Windows Terminal apps, (regular and Preview), Computer\HKEY_ ... \SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe that has three entries, (default), Cascadia.tff, and CascadiaMono.ttf. The Value data , (C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf) leadl me to explore the containing folder, where two cascadia true type fonts are. If I could get 'CascadiaMono PL', I believe it would work, but Windows 10 has that locked out. – Tom Fetherston Jun 20 '20 at 18:39
  • I was able to use 'Cascadia Mono PL' by adding a registry string at the above registry path: Value name: CascadiaMonoPL.ttf Value data: C:\Users\tfeth\OneDrive\Documents\Fonts_Power_Line\CascadiaMonoPL.ttf. Try something similar for Iosevka, no joy. – Tom Fetherston Jun 20 '20 at 19:55
  • I installed `Iosevka Term Nerd Font Complete Windows Compatible.ttf` and had the same issue. Not working in windows Terminal but working in ConEMu (Cmder). – apena Jun 20 '20 at 19:55
  • That is my experience also. Also posting on Windows Terminal issue #6606 – Tom Fetherston Jun 20 '20 at 20:02
  • I think something is up with how `Isoveka NF` is crafted. Other NF fonts work in Windows terminal. Would you be open to using `MesloLGS NF` font? I use it in windows Terminal for all my powerline stuff (fancy glyphs, etc..) – apena Jun 20 '20 at 20:07

4 Answers4

25

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

  1. Install Cascadian Code for all users

enter image description here

  1. Change the "fontFace" property in the settings.json like this

enter image description here

here is the code to copy

"profiles": {
   "defaults": {
      "fontFace": "Cascadian 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)

Hakan Fıstık
  • 11,376
  • 8
  • 74
  • 105
3

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

2

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.

Tom Fetherston
  • 149
  • 1
  • 7
1

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