terminal icon indicating copy to clipboard operation
terminal copied to clipboard

'fontFace' not working for any profile after system reboot.

Open Stadler76 opened this issue 6 years ago • 52 comments

Environment

  • Microsoft Windows [Version 10.0.18362.418]
  • Windows Terminal (Preview) Version: 0.5.2762.0
  • Ubuntu subsystem with Oh My Zsh using the agnoster theme with Powerline Fonts installed.

Steps to reproduce

  1. Setup Windows Terminal (With Ubuntu subsystem)
  2. Set the fontFace for various profiles (Tested with powershell, cmd and Ubuntu WSL) Note, that everything was working as intended up to here.
  3. Restart Windows.

Expected behavior

The font setting being applied: grafik grafik

Actual behavior

After restarting Windows fontFace is being ignored: grafik grafik

Additional Info

My current profiles.json: profiles.txt

Stadler76 avatar Oct 19 '19 17:10 Stadler76

I assume, issue #3250 is the same issue. Just wanted to create a new issue since that one is lacking any information.

Stadler76 avatar Oct 19 '19 17:10 Stadler76

Which font specifically are you using? "Powerline Fonts" isn't terribly descriptive.

Does the font work in other applications after rebooting? Can you share a screenshot of it working in Windows Terminal before rebooting? Thanks.

DHowett-MSFT avatar Oct 21 '19 19:10 DHowett-MSFT

Which font specifically are you using? "Powerline Fonts" isn't terribly descriptive.

Roboto Mono for Powerline at first, then Noto Mono for Powerline, DejaVu Sans Mono for Powerline and even with Courier New. It seems that every profile gets the fallback to the default font, no matter the fontFace-setting.

Does the font work in other applications after rebooting?

Outside of the terminal (Using the conhost setting dialogue the fonts work excluding Roboto Mono which is bugged atm (See #295, respectively google/fonts#1832), so that ones off the table for me).

Can you share a screenshot of it working in Windows Terminal before rebooting? Thanks.

Unfortunately I can't provide a screenshot from before restarting Windows. But I'll go check, if restarting Windows and/or reinstalling Terminal helps.

Stadler76 avatar Oct 21 '19 22:10 Stadler76

Ok, reinstalling the terminal and or restarting Windows didn't work. What 'seems' to do the trick was deleting all newly installed Powerline fonts and reinstall them: grafik To reinstall all of them I've cloned the repo https://github.com/powerline/fonts with GitHub Desktop and ran the install.ps1 in powershell (Used Set-ExecutionPolicy Bypass before running that script).

Next will be another restart or two to see, if it breaks again.

Stadler76 avatar Oct 21 '19 23:10 Stadler76

Ok, same issue after a restart. I've tried to install only a single set: DejaVu Sans Mono for Powerline. It worked, till I've restarted Windows.

In short: Reinstalling the font fixes it and restarting Windows breaks it again. Currently I'm too tired to hunt that issue down any more.

Stadler76 avatar Oct 22 '19 00:10 Stadler76

This is really fascinating! I wonder if it reproduces on v0.6? Sorry, I've never seen anything like this before, but we did make some font changes in that release.

DHowett-MSFT avatar Oct 23 '19 20:10 DHowett-MSFT

Also, if you install the font "for all users" instead of just plain installing it, does it work after a reboot? This might be something fun for the font team to look at.

DHowett-MSFT avatar Oct 23 '19 20:10 DHowett-MSFT

@DHowett-MSFT wrote:

This is really fascinating! I wonder if it reproduces on v0.6? Sorry, I've never seen anything like this before, but we did make some font changes in that release.

Yes, it reproduces with: Windows Terminal (Preview) Version: 0.6.2951.0

Also, if you install the font "for all users" instead of just plain installing it, does it work after a reboot? This might be something fun for the font team to look at.

Yes, this works fine after a reboot. When installing it locally (What the install.ps1 actually does) it breaks after a restart, unless:

  • You disable the Windows FontCache Service or
  • You restart the Windows FontCache Service

Did a couple more restarts and installing and uninstalling of fonts, what I've found out so far: I've installed Roboto Mono for Powerline locally and DejaVu Sans Mono for Powerline "for all users". I've switched between those two a couple times and everytime I hit save I saw Roboto broken and DejaVu working thanks to Terminal immediately updating.

So the steps to reproduce should be:

Steps to reproduce

  1. Setup oh-my-zsh with the agnoster theme (I guess oh-my-posh should show the same error).
  2. Now install one Powerline-font locally (for example Roboto Mono for Powerline) aka mark all font files → Right click → Install.
  3. Install one Powerline-font for all users (for example DejaVu Sans Mono for Powerline) aka mark all font files → Right click → Install for all users.
  4. Make sure the Windows FontCache service is running and set to start automatically (should be the default).
  5. Setup the profile to use the locally installed font and check, if it still works.
  6. Restart Windows.
  7. Restart Windows Terminal.
  8. Switch the fonts in the config back and forth between those two.

Expected behaviour

Both fonts always work.

Actual behavior

The globally installed (aka for all users) font works fine, the locally installed font breaks/won't load unless you restart the FontCache or disable the service before restarting Windows.

Stadler76 avatar Oct 24 '19 00:10 Stadler76

Oh and btw: I wonder, if its the FontCache to blame or how Windows Terminal utilizes it. I guess a bit of both, since the issue with the FontCache described above only exists in the Terminal.

Stadler76 avatar Oct 24 '19 00:10 Stadler76

So, Terminal isn't doing anything special with the font cache. We're using DirectWrite, the text rendering API, like most other apps on the system are. Now, I've got one last crazy idea before I escalate this to the fonts team:

If you introduce a delay (say, 30-60 seconds) between steps 6 and 7 ... does it work for you?

Sorry to make you jump through so many hoops. ☹️

DHowett-MSFT avatar Oct 24 '19 00:10 DHowett-MSFT

I doubt it does since I usually do a bunch of other thing before restarting the terminal, but I can test it one last time. Gimme a min or ten.

Stadler76 avatar Oct 24 '19 00:10 Stadler76

Nope, that didn't WFM. I've waited ~10 mins between restarting Windows and (re)starting Windows Terminal.

Just for funsies I've recorded and cut a brief video, that shows the issue: Fontcache issue with locally installs font in Windows Terminal Preview

PS:

Sorry to make you jump through so many hoops. ☹️

I've already planned to test with FontCache disabled 'n stuff. Thanks for the hint with the globally installed fonts, btw. And well: Through most of those hoops I've jumped voluntarily or otherwise it would leave me restless. 😉

Stadler76 avatar Oct 24 '19 01:10 Stadler76

:grin: Thanks for testing for me. I was concerned that Terminal was starting up before the font cache was, and the font cache was somehow not simply a cache, but you've handily blown that theory away.

I'm wrapping this all up to escalate to the team who owns font handling on Windows, since it looks like we're doing "everything we can" here.

DHowett-MSFT avatar Oct 24 '19 01:10 DHowett-MSFT

btw: I doubt, that its limited to powerline fonts. I assume, it would break with other locally installed fonts as well, but the extra glyphs of those fonts make it easier to visualize the issue.

Stadler76 avatar Oct 24 '19 02:10 Stadler76

Just appeared in 0.7 for me (was ok in 0.6) I first updated Win10 to 10933.1 Fast Insider (i think i had 19030 before) Then updated the terminal from the store

I do Confirm on OMyZsh + Agnoster, and also OMyPsh

font installed Delugia Nerd Font Complete, https://github.com/adam7/delugia-code/releases/download/v1911.21/Delugia.Nerd.Font.Complete.ttf https://github.com/adam7/delugia-code/releases/tag/v1911.21

Only using local install too (double click > install), i did not try an "All user install"

What surprise me is that if you use Cascadia Code (no powerlines yet IIRC) or XXXX Powerlines right after boot up, the glyph are not rendered the same :

Cascadia Code goes likes empty square :

image

Delugia goes like the video of @stadler76 (char inside square) :

So it's not behaving the same, corrupted buffer or something ? image

tebeco avatar Dec 03 '19 08:12 tebeco

The re-installing the font and restarting the terminal fixes it until the next reboot. Worth noting I believe the font also doesn't appear in the Windows 10 Fonts when doing a search until you re-install. Running Terminal version 0.9.433.0. Font: Meslo LGM.

suavelizard avatar Mar 11 '20 16:03 suavelizard

@suavelizard one of the workaround is to install the font System Wide and not for the user only. It should properly persist then (this is not optimal but it has fixed this behavior for me)

tebeco avatar Mar 11 '20 18:03 tebeco

Yes, installing font system wide fixes the issue.

fabiodbr avatar Apr 25 '20 17:04 fabiodbr

I came across this issue in Google after experiencing these exact same symptoms. I was using the Nerd Font patched Cascadia Code font (Delugia Nerd Font) and after every reboot the font face would not be recognized in VSCode (I had not opened Windows Terminal to see if it was the same but I suspect it would be).

If I went to Start -> Settings -> Personalisation -> Fonts and searched for the font it would not show in the list, but if I went to C:\Windows\Fonts\ I would see the font file there. I will see how it goes after performing a full reboot now that I have installed the font system wide.

Edit: confirmed font is still present after a reboot when installing system wide

Riiskyy avatar May 13 '20 22:05 Riiskyy

I was using the Nerd Font patched Cascadia Code font (Delugia Nerd Font) and after every reboot the font face would not be recognized in VSCode (I had not opened Windows Terminal to see if it was the same but I suspect it would be).

Good to know, that this is not a Terminal only issue. But I'm still curious, if this is 100% a font cache issue or if this can be fixed in Windows Terminal.

Stadler76 avatar May 16 '20 00:05 Stadler76

I have fonts installed (for all) in C:\Windows\Fonts directory, still Windows Terminal can't use it. Other system fonts can be recognized by the WT though.

Using WT Preview from MS store.

aasutossh avatar Jul 10 '20 02:07 aasutossh

@aasutossh your message was incomprehensible because of the email formatting, so I had to remove it.

DHowett avatar Jul 25 '20 02:07 DHowett

What I previously said was, I installed the fonts using the right click option "install for all users", and they were present in the regedit too. But I still couldn't use them (they were nerd fonts).

So I patched the fonts myself and now I can use it. I stopped using ms terminal, I use alacritty now.

aasutossh avatar Jul 25 '20 07:07 aasutossh

OMG! 😱😱 It was not just me! I have the exact same issue than @Riiskyy and @tebeco But I use WSL on VSCode

After reboot I always have to reinstall my fonts (MesloLGS NF and CaskaydiaCove NF) to work in Windows Terminal/VScode Terminal. If not, they behave as if the fonts have not been installed.

PS: I will test Font System Wide

luizwhite avatar Oct 14 '20 14:10 luizwhite

I don't believe it.. It really fixes the problem when i right-click the .ttf and "Install for all users" Simple as that, after reboot all terminals looking fine with my OMZ powerlevel10k in Windows Terminal or VScode

luizwhite avatar Oct 14 '20 14:10 luizwhite

This is for anyone else who Googles up this issue. Using "Install for all users" was the solution for me as well.

However, go to Start -> Settings -> Personalisation -> Fonts and search for the font. The name there is the one you want to use. As for me Ubuntu Mono Nerd Font Complete Mono Windows Compatible did not work, but in the Fonts directory it shows as UbuntuMono NF and this has correctly worked between reboots and shutdowns.

Cheers @luizwhite @Riiskyy @tebeco big ups. I almost resorted to going to page 2 on Google.

EndyBoi avatar Nov 11 '20 20:11 EndyBoi

Stupid JSON settings

Make a normal UI for such settings as in CMD.exe. Omg....

ilqvya avatar Dec 13 '20 14:12 ilqvya

Holy crap... 1 year have been passed for the issue. I can't set the Cascadia Mono ExtraLight font face. Only can set default Cascadia Mono.

But in cmd.exe it works well....

This project is a mess....

ilqvya avatar Dec 13 '20 15:12 ilqvya

I experienced this same issue as well. It's especially confusing because the fonts are visible in Word and work fine there, but putting the same font name in Terminal appears to not work. "Install for all users" did resolve the problem for me as well.

qidydl avatar Jan 21 '21 19:01 qidydl

This is for anyone else who Googles up this issue. Using "Install for all users" was the solution for me as well.

However, go to Start -> Settings -> Personalisation -> Fonts and search for the font. The name there is the one you want to use. As for me Ubuntu Mono Nerd Font Complete Mono Windows Compatible did not work, but in the Fonts directory it shows as UbuntuMono NF and this has correctly worked between reboots and shutdowns.

Cheers @luizwhite @Riiskyy @tebeco big ups. I almost resorted to going to page 2 on Google.

Oops!It works! "go to Start -> Settings -> Personalisation -> Fonts and search for the font " which can get the real name,so the icons won't just be the "□"

ZHHHH9980 avatar Feb 13 '21 14:02 ZHHHH9980