Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

Languages: the 12-pixel font has Latin letters too, for games whose own font lacks some a translation needs

Mason Chen014000aa86f5
diff --git a/assets/fonts/fusion-pixel-12px.bin b/assets/fonts/fusion-pixel-12px.bin
index 036ed4b5..977c839a 100644
Binary files a/assets/fonts/fusion-pixel-12px.bin and b/assets/fonts/fusion-pixel-12px.bin differ
diff --git a/tools/lang.py b/tools/lang.py
index 99354266..406459c2 100644
--- a/tools/lang.py
+++ b/tools/lang.py
@@ -164,7 +164,7 @@ def tree(code, out):
if os.path.isdir(os.path.join(ROOT, nm)):
os.symlink(os.path.join(ROOT, nm), os.path.join(out, nm))
# fonts: the launcher's accented letters, and the 12-pixel font for the rest
- text = "\n".join(used)
+ text = "\n".join(used) + "\n" + "".join(chr(c) for c in range(0x21, 0x7F))
latin = sorted({ord(c) for c in text if 0x80 <= ord(c) < 0x180})
# the launcher's own texts get Nunito's letters; the games draw theirs with accents (np_latin)
if os.path.isdir(os.path.join(ROOT, "tools/.fonts")):
diff --git a/tools/xfont.py b/tools/xfont.py
index d82fb2b6..92ab764c 100644
--- a/tools/xfont.py
+++ b/tools/xfont.py
@@ -3,7 +3,7 @@
xfont.py extract font.pcf assets/fonts/fusion-pixel-12px.bin
Keeps the letters of GB2312 (simplified Chinese), CJK and fullwidth
- punctuation from Fusion Pixel 12px (SIL Open Font License 1.1, see
+ punctuation, and Latin (ASCII, Latin-1, Latin Extended-A) from Fusion Pixel 12px (SIL Open Font License 1.1, see
LICENSES/OFL-1.1-Fusion-Pixel.txt), in a small file committed with the
sources: magic "NPXF", the count, then for each letter its code point
(4 bytes), advance, x, y (from the top of a 12-pixel line), width, height
@@ -27,6 +27,8 @@ def wanted():
except (UnicodeDecodeError, TypeError):
pass
cps |= set(range(0x3000, 0x3040)) | set(range(0xFF00, 0xFFF0)) | set(range(0x2010, 0x2070))
+ # Latin too: for a game whose own font lacks letters a translation needs (np_xdraw draws them)
+ cps |= set(range(0x21, 0x7F)) | set(range(0xA1, 0x180))
return cps
@@ -65,8 +67,8 @@ def table(font_path, out, texts):
used = set()
for t in texts:
used |= {ord(c) for c in open(t, encoding="utf-8").read() if ord(c) >= 0x80}
- # (Latin letters and the usual punctuation are drawn by the games' fonts: see np_latin)
- cps = sorted(c for c in used if c in font and c >= 0x2100)
+ # every letter beyond ASCII the texts use, and the Latin ones too (for games whose font lacks some)
+ cps = sorted(c for c in used if c in font and (c >= 0x2100 or 0x21 <= c < 0x180))
L = ["/* Made by tools/xfont.py from Fusion Pixel 12px (SIL Open Font License 1.1): the letters this",
" build's texts use that the games' fonts don't have. See games/common/np_text.h. */"]
rows = bytearray()