Fix #206 — system font lookup on Linux through fontconfig - #207
Merged
Merged
Conversation
- Fontconfig: libfontconfig.so.1 loaded with dlopen at first use (no build-time dependency; absent library = no system fonts, as before). FcFontList only, never FcFontMatch, so an uninstalled family finds nothing. - SystemFonts: family and PostScript-name lookups and the listing go through it on Linux; faces in formats OpenTypeFont cannot read (Type 1, bitmap) are passed over. - OpenTypeFont.summary: names, weight, slant, format and fsType without parsing outlines, sharing readStyle with parse. - CI Linux job installs fontconfig, Liberation, EB Garamond, URW base 35, WenQuanYi and the CeolKitTest.ttc fixture, and sets CEOLKIT_FONT_FIXTURES=1 for the gated FontconfigTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #206
Stacked on #205 (#191, which this builds on:
SystemFonts.listing,availableFaces). Base isfeature/fix_191; retarget todeveloponce #205 merges.Lookup
Fontconfig(Linux only):dlopen("libfontconfig.so.1")at first use, resolvingFcInitLoadConfigAndFonts,FcPattern*,FcObjectSet*,FcFontListandFcFontSetDestroy. There is no build-time dependency. Where the library is missing, lookup finds nothing, as before.FcFontListonly, neverFcFontMatch: a family that isn't installed must find nothing, not fontconfig's nearest guess.SystemFonts.faces(family:),faces(postScriptName:)andlistinguse it on Linux. Faces in formatsOpenTypeFontcan't read (Type 1, PCF, …) are skipped byFC_FONTFORMATbefore any file is read.OpenTypeFont.summary(_:faceIndex:)reads names, weight, slant, format andfsTypewithout parsing outlines, so the Linux listing costs one read per file. It sharesreadStylewithparse, so the listing and the provider can't disagree.SVGRenderConfig.systemFontsand CONFORMANCE.md now describe Linux.Tests and CI
fontconfig fonts-liberation fonts-ebgaramond fonts-urw-base35 fonts-wqy-microheiand copiesCeolKitTest.ttcinto/usr/local/share/fonts, then runs the tests withCEOLKIT_FONT_FIXTURES=1.FontconfigTests(compiled only without CoreText):.otf, TrueType,.otfinstalled beside Type 1, and.ttcface 0;Times-Bold→LiberationSerif-Bold, reported as a note;.ttcface 1 (CeolKitTest-Restricted): drawn as<text>, refused as outlines withfontNotEmbeddable;.otfface once.swift:6.3):swift testpasses; the CoreText path is unchanged.🤖 Generated with Claude Code