Commit Graph
101 Commits
Author SHA1 Message Date
jpirnay 387b0898c5 Reduce logs 2026-05-19 14:26:40 +02:00
jpirnay cac61d85b9 Add domitian font family 2026-05-17 14:09:09 +02:00
jpirnay a7450fa8d4 Further optimisations 2026-05-17 13:55:55 +02:00
jpirnay 95d33a67f0 Proper support of superscript/subscript 2026-05-15 20:47:01 +02:00
jpirnay 099688a7ef Fixes 2026-05-12 11:36:56 +02:00
jpirnay fddc81ec0a Special case for zero-byte prewarm 2026-05-11 22:57:15 +02:00
jpirnay 461a277925 Use upstream variant to get in sync 2026-05-11 13:05:43 +02:00
jpirnay 917219401a Dont create cjk fonts (yet) 2026-05-10 21:28:32 +02:00
jpirnay ba30ed029f Update font weights for Bitter font in YAML 2026-05-10 18:10:53 +02:00
jpirnay ad52abf069 Close source TTFont after instantiateVariableFont rebind
instantiateVariableFont with default inplace=False returns a *new*
TTFont; rebinding `font` strands the source TTFont and its file handle
open until GC. The trailing font.close() then closes only the new
pinned-instance object.

Capture the source as a separate reference and close both with nested
try/finally: inner finally closes the static instance after save (or
on save failure), outer finally closes the source unconditionally.
2026-05-10 10:35:51 +02:00
jpirnay 49b039a775 Fix SMP ligature filter and Extension-wrapped GPOS kern dispatch
Two related bugs in fontconvert_sdcard.py:

1. SMP filter for ligatures was post-pack, which only checked the
   already-masked low half (always ≤ 0xFFFF), didn't check `lc`, and
   couldn't catch SMP cps that already had bits truncated by the
   mask. Filter at source instead — inside extract_ligatures_fonttools
   when building the `filtered` dict — so any seq with an SMP
   component or any lig_cp > 0xFFFF is dropped before packing. The
   chained 3+ char path is naturally covered because
   `intermediate_cp = filtered[prefix].lig_cp` reads from the same
   already-filtered table.

2. GPOS kern dispatch checked `actual.LookupType` after unwrapping an
   Extension subtable. Format-specific subtables (PairPosFormat1/2)
   don't carry `LookupType`, so this fails for any Extension-wrapped
   PairPos lookup — i.e. how every modern font (Inter, Source Serif,
   Bitter, …) ships kern. Use the effective type instead:
       effective_type = getattr(st, "ExtensionLookupType", lookup.LookupType)
   so non-Extension lookups read the outer type and Extension lookups
   read the inner ExtensionLookupType, and Type-2 PairPos lookups
   actually reach _extract_pairpos_subtable in either case.
2026-05-10 10:16:36 +02:00
jpirnay 907fdadf16 Drop unsupported static=True kwarg from instantiateVariableFont
instantiateVariableFont() in current fontTools doesn't accept a
`static` parameter (signature: varfont, axisLimits, inplace=False,
optimize=True, overlap=…, updateFontNames=False, *, downgradeCFF2=False).
Calling it with static=True raises TypeError, breaking
extract_static_instance() for any sd-fonts.yaml entry that uses the
`variable: {wght: …}` form.

Drop the unsupported kwarg; keep updateFontNames=True (name table
accuracy) and optimize=False (skip wasted gvar work when every axis
is fully pinned). The output is still a fully-pinned static instance
because all yaml-declared axes are pinned in `axes`.
2026-05-10 08:28:16 +02:00
jpirnay 104af74079 Additional glyphs 2026-05-07 08:31:22 +02:00
jpirnay 3254582a20 Extend script functionality 2026-05-07 08:23:51 +02:00
jpirnay 464846fd75 Add builtin as default everywhere 2026-05-06 22:54:02 +02:00
jpirnay 6f877c03eb Safety guard 2026-05-06 15:29:02 +02:00
jpirnay 82cb274d84 Fix typo in description 2026-05-06 15:23:47 +02:00
jpirnay 180b601841 Extend character range 2026-05-05 20:49:30 +02:00
jpirnay 795e2fe9a9 Add two more fonts 2026-05-05 18:33:29 +02:00
jpirnay 9fba8b07e9 Minor stylistic updates 2026-05-05 17:54:38 +02:00
jpirnay f15b1d06bf Fix static font generation from variable fonts 2026-05-05 17:35:13 +02:00
jpirnay 8aac378b71 Add pyyaml 2026-05-05 16:18:53 +02:00
jpirnay 7a0dc31c2f Add minimal allback buffer for future use 2026-05-04 16:44:28 +02:00
jpirnay 95eafaecd1 Smarter cache eviction 2026-05-04 15:41:10 +02:00
jpirnay 48aaf821a5 Clear cache on prewarm 2026-05-04 15:33:47 +02:00
jpirnay ece696a115 Add additional fonts 2026-05-04 11:36:24 +02:00
jpirnay cd75e3b8e1 Adding additional font sizes 2026-05-03 23:59:45 +02:00
jpirnay 3bd18d855d Amend fonts 2026-05-03 23:40:45 +02:00
jpirnay 5617db3ad2 Fix font-location 2026-05-03 22:42:54 +02:00
jpirnay a176b3fa6d Merge pull request #162 from spfenwick/fix-oom-crash
fix: Avoid OOM crash when using SD font with many kern pairs
2026-05-02 21:09:43 +02:00
jpirnayandCopilot cc9ff5bae9 More review changes
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 18:42:45 +02:00
jpirnayandCopilot 06dfc6c50b Recover parts of the regression fiasco
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 18:19:23 +02:00
jpirnayandCopilot a5469c0bb9 Review comments
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 17:22:10 +02:00
jpirnay df94ccaa86 Recover from merge fiasco 2026-05-02 16:54:31 +02:00
spfenwick f07724dab4 Address review comment: Ensure ligature metadata is wired if requested but not yet wired 2026-05-02 20:09:52 +12:00
spfenwick acfb9e6cdc Address Review Comment: clear dangling pointers when miniData freed 2026-05-02 20:08:48 +12:00
spfenwick 9def61aed9 Address review comment: Don't leave dangling pointers when loading ligature/kern darta fails 2026-05-02 19:51:14 +12:00
spfenwick 8152204985 Fix formatting
This is particularly important when using SD fonts with many kern pairs
2026-05-02 16:40:23 +12:00
spfenwick 913b7e5f8b Avoid OOM during prewarm by loading only ligature data, not kern pairs
This is particularly important when using SD fonts with many kern pairs
2026-05-02 15:54:40 +12:00
jpirnay c59a893202 Merge pull request #152 from jpirnay/feat-strikethrough
feat: Support strikethrough
2026-04-29 12:33:00 +02:00
jpirnay a2daaa7194 Fix crash 2026-04-29 09:56:34 +02:00
jpirnay b83482e732 Support strikethrough 2026-04-29 09:08:07 +02:00
jpirnay 93f5bdb492 Merge pull request #147 from jpirnay/feat-fonts-sd
feat: Add sd fonts (integrate and improve upstream #1327 by adriancaruana)
2026-04-28 19:09:51 +02:00
jpirnay 0466465d8c Add destructor to unregister fonts from GfxRenderer 2026-04-28 19:03:38 +02:00
jpirnayandCopilot ebb80bf4d9 Make SdCardFont explicitly non-copyable and non-movable
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 18:41:48 +02:00
jpirnay 2694081af9 Use bitmap.pitch instead of assuming tightly packed rows 2026-04-28 18:14:58 +02:00
jpirnay ad2e3765ba Some environment cleaning 2026-04-28 18:09:36 +02:00
jpirnayandCopilot fd35b50ff9 Some minor fixes
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 18:06:56 +02:00
jpirnayandCopilot c84b971455 Fix signature
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 17:46:37 +02:00
jpirnay 2c9a6d7d31 One more 2026-04-28 16:09:59 +02:00