Skip to content

GraphiteText: list a collection's faces by count and each font file once; tag swift-freetype - #24

Merged
colemancda merged 5 commits into
masterfrom
feature/font-finder
Nov 26, 2026
Merged

colemancda merged 5 commits into
masterfrom
feature/font-finder

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

  • FreeTypeFace.faceCount: how many faces the font file has (at least 1), read from swift-freetype.
  • FontFinder lists a collection's faces by that count (1 ..< faceCount), where it probed indexes up to an arbitrary 32 and stopped at the first that wouldn't open. An ordinary font file no longer makes a failed open of index 1, and a face that won't open is skipped without ending the collection.
  • FontFinder reads each font file once. Folders inside others (/System/Library/Fonts/Supplemental is inside /System/Library/Fonts) listed their files twice before.
  • swift-freetype is a tagged dependency, from: "0.1.1", in place of the master branch. 0.1.1 is the revision this was built and tested against. A version dependency also lets packages that depend on Graphite by version use it, which a branch dependency doesn't.

The swift-freetype update to 0.1.1 needed no code changes: its changes since the previous pin are additive (namedInstance has a default; GlyphOutline gained fields we don't construct).

Testing

  • New FontFinderTests: no face is listed twice; each file's faces are listed from 0 and within its faceCount; collections are listed whole, exactly the faces that open; an ordinary .ttf has one face. They use the machine's system fonts, so a collection is only exercised where the machine has a .ttc.
  • Built and ran all 397 tests in Xcode on macOS: all pass, with swift-freetype resolved to 0.1.1.
  • Linux, and the build without the FreeType trait, are left to CI.

@colemancda
colemancda merged commit 8e34572 into master Nov 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant