A Zig library that finds fonts as fontconfig does, without it: the same configuration, OpenType and bitmap fonts, and the same answers.

Skip scan rules that cannot match, and preheat decoded patterns

Every family named in a generic family's <alias> becomes scan rules, so a typical configuration has hundreds of them, and a cached scan applied all of them to every pattern. A rule that opens with a test that the pattern has a family equal to one string now records that string's hash, and is skipped for a pattern with no family of the same hash; the families are gathered again after any rule that edits them. A pattern read from the cache now starts with room for about four times its encoded size, rather than growing its arena a value at a time, which in a Debug build meant a stack trace for every step. A cached `zfc list` of 5,513 fonts goes from 7.0 s to 1.6 s in Debug and from 0.79 s to 0.30 s in ReleaseSafe, with identical output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XxMfD5H5cp867D4Rdkx6Di


Author
Co-author Claude Opus 5.5 Date Commit Parent 87248e31
+142 -1
3 changed files
+142 -1
3 changed files