mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
Japanese (and Chinese, Korean) text in a family that lacks the glyphs, such as the default Inter, rendered as missing-glyph boxes: `fallback_for` only searched the bundled faces and faces some other layer had already loaded, so the result depended on render order. Now, after those cheap candidates, it tries the platform's usual family for the character's writing system (kana and hangul pick their language; Han ideographs follow the locale, Japanese first when it is unknown, `EFFECTCRAFT_CJK_LOCALE` overrides) in the preferred face's style, and finally any installed face that covers the character, reading files without keeping them. Results are cached per 256-character block and preferred face. `resolve` also accepts a face's full name (`Yu Gothic Bold`) or PostScript name (`YuGothic-Bold`), which is how After Effects scripts set `textDocument.font`; the sfnt reader now records name id 6. Tests: script classification, PostScript / full-name resolution on the bundled Inter, and (native, skipped when no Japanese family is installed) that kana, ideographs and CJK punctuation in Inter Bold fall back to an installed Japanese family's bold cut, with the cache returning the same face.