Skip to content

Fix #191 — probe available and resolved fonts - #205

Merged
sbeitzel merged 1 commit into
developfrom
feature/fix_191
Oct 3, 2026
Merged

sbeitzel merged 1 commit into
developfrom
feature/fix_191

Conversation

@sbeitzel

@sbeitzel sbeitzel commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Fix #191

Library

  • CeolKitFonts.availableFaces(config:) -> [FontFaceInfo] (PostScript name, family, weight, style, origin, format, embeddable), in search order: registered → system (only with systemFonts) → bundled.
    • System faces are described by CoreText plus their OS/2 table rather than parsed (parsing every installed file took minutes; this takes ~3.5 s for ~880 faces). The Times/Helvetica/Courier stand-in families are also probed by name, because macOS hides Courier and Times from its font collection while a lookup by name still finds them.
  • RenderedDocument.fonts: [TuneFontReport] — per tune, per drawn role: the requested FontSpec, the directive's source, the FontResolution used, the size, and a one-line summary.

%%ceolkit:fontlist [resolved|available]

  • Defaults to resolved; a bad keyword is a warning (invalidFontDirective) and the directive is dropped.
  • Reports as .info diagnostics (new code fontList) at the directive's line; the page is unchanged.
  • Font directives are scoped, not positional, so a list in a tune (header or body) reports the fonts the whole tune is set in; one in the file preamble reports the document baseline.
  • Documented in EXTENSIONS.md; CLAUDE.md's directive list updated.

ckprobe

  • --fonts (no ABC file needed), --system-fonts, --font-file <path> (repeatable), and a per-tune fonts: section in the report and --json.

Tests

  • FontListDirectiveTests (parser: modes, placement in preamble/header/body, malformed argument).
  • FontReportTests (bundled-only list, registered and system faces, resolution reports with and without directives, per tune, preamble vs tune lists, available lists, page unchanged).
  • swift test passes on macOS; the Linux leg (swift:6.3 Docker) passes with 1451 tests.

🤖 Generated with Claude Code

- CeolKitFonts.availableFaces(config:): registered, system (when enabled) and bundled
  faces, in search order; system faces described through CoreText, with the base-14
  stand-in families probed by name since macOS hides some from enumeration.
- RenderedDocument.fonts: per tune, what each kind of text asked for and got.
- %%ceolkit:fontlist [resolved|available]: reports as info diagnostics at the
  directive, for the scope it is written in.
- ckprobe: --fonts, --system-fonts, --font-file, and a per-tune fonts: section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sbeitzel
sbeitzel merged commit d2770f9 into develop Oct 3, 2026
2 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