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

Walk the charmap, build charsets and pick subtables more cheaply

Four smaller costs of a scan, each giving the same answer as before: - The charmap is walked in code point order, and a format 4, 8, 12 or 13 subtable whose segments are in order now has its segment followed rather than binary-searched for each character. A subtable out of order is looked up as before. - CharSet.Builder remembers the page it last added to, since the next character is usually on the same one. - Only the cmap subtables in line to be chosen are parsed, in order of preference, rather than every subtable and then a choice among them. - A pattern built from a face starts with 4 KiB of arena, and the scan rules rule out most rules with a 64-bit mask of the pattern's family hashes before looking through them. A full rebuild of 5,883 font files goes from 1.66 s to 1.09 s in ReleaseSafe and from 12.3 s to 6.7 s in Debug, with identical output; a cached scan goes from 0.30 s to 0.24 s and from 1.6 s to 1.4 s. 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 0622e976
+168 -17
4 changed files
+168 -17
4 changed files