Closed mkvlrn closed 1 year ago
Had the same problem and just now understood that it broke with the 22H2 update. Thanks for the workaround which at least temporarily fixes the problem.
I believe the root cause is: https://github.com/microsoft/terminal/issues/3257
I believe the root cause is: microsoft/terminal#3257
It's not only on windows-terminal, it's system wide. It also happens to vscode, notepad, any applications. It's like the font was never installed to begin with.
Same issue here. I just did a fresh re-install of Windows 11 22H2. I then installed JetBrainsMono NF font via scoop
. This puts the font files into %LOCALAPPDATA%\Microsoft\Windows\Fonts
.
I can even successfully set the font in Windows Terminal. The weirdest part is that the setting won't survive a system reboot.
After reboot:
%LOCALAPPDATA%\Microsoft\Windows\Fonts
, and the font files are still there;Same issue here.
And for me, it happens after the installation of 2022-10 Cumulative Update for Windows 11 Version 22H2 for x64-based Systems (KB5018427) yesterday.
ADD:
It seems like this issue only happens to nerd-fonts like JetBrainsMono-NF (scoop install JetBrainsMono-NF
), while JetBrains-Mono (scoop install JetBrains-Mono
) has no such thing. Can you guys reproduce this?
me too......
It seems like this issue only happens to nerd-fonts like JetBrainsMono-NF (
scoop install JetBrainsMono-NF
), while JetBrains-Mono (scoop install JetBrains-Mono
) has no such thing. Can you guys reproduce this?
For me, none of the fonts (installed by scoop
into %LOCALAPPDATA%\Microsoft\Windows\Fonts
) survive a reboot, including JetBrains-Mono
.
There's nothing wrong with the font installation, it's an issue with the Windows font cache. You can use the following command to get them working again.
Restart-Service -Name FontCache
Seems like Windows has a feature that can block untrusted fonts from loading outside of the %windir%/Fonts
directory. However, the last time I checked, this feature was Not configured
on my system.
TL;DR sudo scoop install -g <font>
instead of scoop install <font>
I encountered this issue after upgraded to 22H2, Restart-Service -Name FontCache
does not help, untrusted fonts
was also not configured, but https://github.com/microsoft/terminal/issues/14231#issuecomment-1280827973 seems to be a workable solution.
BTW, following that comment, I found https://github.com/matthewjberger/scoop-nerd-fonts/pull/161, which introduces installing font in user scope instead of system level. I suspect it conflicts with 22H2 upgrade. However, I have another desktop PC, which also upgraded to 22H2 recently, the font works fine.
Great hint, thanks a lot for that! Solved the problem for me.
Hi there,
Sorry for being late... and BIG THANKS to everyone here for providing so much useful information!
Base on DavidZhang73's comment and #180.
It seems that the best solution for now is using sudo scoop install -g <font>
to install font for all users.
According to this issue, it seems we need to install Nerd Fonts for all users instead of current user.
I think the problem is that the installer is trying to install the fonts in the user space. Installing to the system to all users, apparently, solve the problem.
More info available here -> https://github.com/microsoft/cascadia-code/issues/137#issuecomment-550973296
https://github.com/matthewjberger/scoop-nerd-fonts/pull/200 will probably solve this issue.
Alright, so it's definitely not an issue in this repo, but the discussion finally got to a solution. Thanks! Closing this.
I think I may have found the root cause of the original issue.
It appears to caused by misconfigured permissions of the user font install folder (%LOCALAPPDATA%\Microsoft\Windows\Fonts
), which is preventing the fonts from functioning properly.
On a fresh installed Windows (Windows 10 1809 onward), if we install a font using the normal way:
Install
button on the font viewer app.Install
(not Install for all users
) on the menu.Windows will automatically create the user font install folder (%LOCALAPPDATA%\Microsoft\Windows\Fonts
) for us.
And the important part is that Windows will give it the proper permission settings,
which included permissions for ALL APPLICATION PACKAGES
and ALL RESTRICTED APPLICATION PACKAGES
.
Screenshot of the correct permission settings:
On the other hand, if we manually create this folder using File Explorer,
or in the case of the PowerShell script introduced in #161, using New-Item
PowerShell command:
The folder will not have the same permission settings as the user font install folder created by Windows.
In particular, the permissions for ALL APPLICATION PACKAGES
and ALL RESTRICTED APPLICATION PACKAGES
will be missing.
Screenshot of the wrong permission settings:
The mysterious part is that if the user font install folder has the misconfigured permissions problem:
To address this issue, we just need to make sure the user font install folder has the correct permission settings.
There are a few ways to do this:
Set-Acl
PowerShell command to add back the missing permissions$userFontInstallFolder = "${env:LOCALAPPDATA}\Microsoft\Windows\Fonts"
$accessControlList = Get-Acl $userFontInstallFolder
# ALL APPLICATION PACKAGES
$allApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new("S-1-15-2-1"), "ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow")
# ALL RESTRICTED APPLICATION PACKAGES
$allRestrictedApplicationPackagesAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]::new("S-1-15-2-2"), "ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow")
$accessControlList.SetAccessRule($allApplicationPackagesAccessRule)
$accessControlList.SetAccessRule($allRestrictedApplicationPackagesAccessRule)
Set-Acl -AclObject $accessControlList $userFontInstallFolder
Q: What does "S-1-15-2-1" and "S-1-15-2-2" mean?
A: These are the security identifiers for
ALL APPLICATION PACKAGES
andALL RESTRICTED APPLICATION PACKAGES
respectively.
%LOCALAPPDATA%\Microsoft\Windows\Fonts
).Registry Editor
, go to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts
, and then delete all of the font entries except for the first (Default)
entry.Install
.I will probably send a PR using the first solution (maybe this weekend), so users who have used this Scoop bucket to install fonts before can retrive the fix by updating/reinstalling the font using Scoop.
@jonz94 Awesome!! The first solution fixed the problem for me!
just a typo.
- $accessControlList = Get-Acl $userFontInstallDir
+ $accessControlList = Get-Acl $userFontInstallFolder
TL;DR:
Fonts installed (they were installed before the update) appear to be installed but do not work - installing them manually from the cache folder works.
Not really sure if this should be opened here or elsewhere, could be a manifest problem? Here's what happened:
I have 2 NF fonts installed from this bucket:
firacode-nf-mono
for vscode andhack-nf-mono
for the terminal. They are used with the names "FiraCode NFM" and "Hack NFM", respectively, and have been working fine for months.Day after my windows 11 22h2 update, when I opened windows-terminal I've received the warning that "Hack NFM" coulndn't be found and it defaulted to Consolas. Checked
scoop list
, fonts still there. Checked the "Fonts" control panel applet, fonts are there.But I cannot find them in a list, for example, trying to change Notepad's font. They are not there.
So I uninstall and reinstall both, restart computer, same problem.
BUT - after uninstalling them again, I go to scoops cache folder, see the
.ttf
files, and try to install them manually - by double clicking and hitting "Install". It worked! They appear exactly the same as before in the "Fonts" applet, but now are also listed on the font change dropdown for apps and work correctly as before.Repeated the process 3 times to check my own sanity, it happened as described again and again.