Let the launcher replace a cached font file it has registered.

A font file registered with Windows stays open, so writing it failed with Permission denied. When the cached title font was registered but its family could not be used, every start tried to decode it again, failed on the locked file and kept the system font. The registration is now given up before the fonts are decoded again, and an unchanged file is not rewritten.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 12:31:22 -05:00
parent 0a9bbed34a
commit fd22aab8d4
4 changed files with 27 additions and 1 deletions

View File

@@ -315,6 +315,11 @@ class App:
got = heard = {}
try:
if fonts:
# The cached files are registered (load_fonts) and were not usable, or this would not run:
# registered, Windows keeps them open, and decoding them again failed with "Permission denied"
# at every start, so a cache file that had gone bad was never replaced.
for path, _family in gamefiles.cached_fonts(self.layout).values():
winsys.unregister_font(path)
got = gamefiles.extract_fonts(self.layout, game_dir, dump)
except Exception as e:
self.ctx.log(f'fonts: {e}')