mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 03:39:57 -04:00
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:
@@ -326,7 +326,9 @@ def extract_fonts(layout, game_dir='', dump=''):
|
||||
fam = font_family(otf) if otf else None
|
||||
if not otf or not fam:
|
||||
continue
|
||||
(d / f'{role}.otf').write_bytes(otf)
|
||||
p = d / f'{role}.otf'
|
||||
if not (p.is_file() and p.read_bytes() == otf): # a file this process registered as a font stays as it is
|
||||
p.write_bytes(otf)
|
||||
(d / f'{role}.family').write_text(fam, encoding='utf-8')
|
||||
out[role] = (d / f'{role}.otf', fam)
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user