From e7037cced12a1a221452b17fa2bc4d9b2ef87f32 Mon Sep 17 00:00:00 2001 From: 4DBug Date: Sat, 31 Oct 2026 08:40:18 -0500 Subject: [PATCH] ws-arch: font/ttf (TrueType / CFF OpenType / collections) with tests vs fontTools, HarfBuzz and FreeType --- tools/fixtures/_font_reference.py | 2 +- tools/fixtures/fonts.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/fixtures/_font_reference.py b/tools/fixtures/_font_reference.py index fb7d492..96e0c2a 100644 --- a/tools/fixtures/_font_reference.py +++ b/tools/fixtures/_font_reference.py @@ -100,7 +100,7 @@ def reference(name, data, index=0): for a in letters: for b in letters: ga, gb = f.getGlyphID(cmap[ord(a)]), f.getGlyphID(cmap[ord(b)]) - v = face.get_kerning(ga, gb, freetype.FT_KERNING_UNSCALED) + v = face.get_kerning(a, b, freetype.FT_KERNING_UNSCALED) # freetype-py maps characters to glyphs kern.append([ga, gb, v.x]) elif "GPOS" in f: blob = hb.Blob(data) diff --git a/tools/fixtures/fonts.py b/tools/fixtures/fonts.py index 0e90cee..35f655b 100644 --- a/tools/fixtures/fonts.py +++ b/tools/fixtures/fonts.py @@ -6,6 +6,8 @@ # tests/gen/fonts.luau { fonts = { { name, data, upem, ..., cmap, glyphs, kern, renders } }, woff = { ... }, ttc } import base64, glob, json, os, subprocess +INPUTS = ["tools/fixtures/_font_reference.py"] + FONTS = os.environ.get("IMGUI_FONTS", os.path.expanduser("~/dev/luau/imgui/imgui-luau/fonts")) PICK = ["Cousine-Regular", "DroidSans", "Karla-Regular", "ProggyClean", "Roboto-Medium"]