Giter Club home page Giter Club logo

Comments (5)

YouveGotMeowxy avatar YouveGotMeowxy commented on June 4, 2024 1

Got it! Thank you both for pointing me in the right direction.

I was going to pass on the scary font cache deletions, but it sent me off on a deep investigation into the fonts. I'm not sure why, but I could see those particular fonts in c:\windows\fonts, but the weren't being shown in the Fonts Control Panel. I don't know if that might mean as @DHowett was saying; that it was installed for the User only, and not system?

Either way, I copied out those fonts to another folder, deleted them from that Windows path, and then dropped them onto the Fonts Control Panel which installed them again. Now, after testing with a reboot, no more errors. wewt!

thank you guys, that was incredibly annoying!

from terminal.

github-actions avatar github-actions commented on June 4, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from terminal.

lhecker avatar lhecker commented on June 4, 2024

Windows caches font information between reboots in two places:

  • %LOCALAPPDATA%\Microsoft\FontCache
  • C:\Windows\ServiceProfiles\LocalService\AppData\Local\FontCache

Additionally it also caches font information per process.

When you install a font, this causes Windows Terminal to not find it, because Terminal's internal (per process) font cache doesn't get invalidated when you install fonts. Once we address #17034 (an issue extremely similar to yours), that will be fixed, because we'll simply ask Windows "Hey, do you have new fonts installed?".

In your case on the other hand, the system font cache between reboots is broken. This can be due to 3 reasons:

  • either one of the two directories above is corrupted
  • the "Font Cache" service is not running
  • you installed fonts in the per-user directory

Can you please check whether you have any files in %LOCALAPPDATA%\Microsoft\Windows\Fonts? If you do, don't delete them in Explorer, but instead open the "Fonts" control panel via the start menu, find each font there and remove it. If you delete font files via Explorer, you break the Font Cache service.
Afterwards install the fonts again, but this time make sure to choose "Install for all users".

If that didn't fix the issue, can you please press Win+R and run services.msc? Then scroll down to "Windows Font Cache Service". It should be set to "Automatic" and should be running:
image


If the above didn't work, the following may fix your issue. I have done it before and it fixed this exact issue for me, however it's very much unsafe. It may break your system. In fact, one time it did break my system and I had to restore the Font Cache service manually. This is because the Font Cache service really isn't particularly robust (which is also why it's broken for you and so many others).

If you know Windows, you know what the Font Cache service is and you trust yourself doing it, you could attempt it. If it breaks your system and you don't know how to restore it, no one may be able to help you.

So, to be absolutely clear: ⚠️ Doing this is not recommended. ⚠️

That said, the Font Cache uses the aforementioned directories for its databases:

  • %LOCALAPPDATA%\Microsoft\FontCache
  • C:\Windows\ServiceProfiles\LocalService\AppData\Local\FontCache

Technically you need to delete both. 90% of the safety risk comes from deleting the 2nd database however. So we should first try to delete only the former and see if it fixes the issue.

To do so, you can do the following:

  • Launch pwsh or powershell as admin
  • Exit all applications, including background applications. This step is crucial or the next one won't work consistently and your system may break.
  • sc stop FontCache
  • rm -Recurse -Force $env:LOCALAPPDATA\Microsoft\FontCache\*
  • sc start FontCache
  • Reboot, etc., to test whether it works

If that didn't fix the issue, you may have a corrupted system font cache. Fixing that one is dangerous and somewhat difficult. It consists of multiple layers and it's unclear which ones need to be deleted. This may leave your system in a broken state. It can be recovered by restoring the files from another system.

Most importantly though, DO NOT USE EXPLORER TO GAIN ACCESS. Do not modify the access rights of that directory in any way.

The per-user cache in the system font cache directory can be deleted by first stopping the FontCache service as before and then running something like this:

rm -Force "C:\Windows\ServiceProfiles\LocalService\AppData\Local\FontCache\*$((New-Object -ComObject Microsoft.DiskQuota).TranslateLogonNameToSID((Get-WmiObject -Class Win32_ComputerSystem).Username))*"

If that didn't work, you can still try to delete the entire FontCache directory contents (not the directory itself, only the contents!). However, I consider this an option of last resort. I'm not entirely sure if it restores the Fonts\fontset-2017-04.json file in that case. If it doesn't restore it you can get it here.

If none of that worked, you may have broken font files, although that's somewhat less likely to affect the font cache service.

from terminal.

DHowett avatar DHowett commented on June 4, 2024

@lhecker wow, that’s comprehensive. I was just gonna guess that they’d installed their font “per user” rather than “for all users” :)

from terminal.

lhecker avatar lhecker commented on June 4, 2024

Oh, I thought that it broke the font until you reinstalled it after a reboot, and that it can't be fixed by clicking Save in the settings. But looking through related issues that indeed doesn't seem true. I've edited my large comment above accordingly.

from terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.