Skip to content

Split into mist (freetype frontend) and mist-core (dependency-free SDF core) - #2

Merged
flut2 merged 9 commits into
flut2:mainfrom
funbiscuit:extract-mist-core
Oct 10, 2026
Merged

flut2 merged 9 commits into
flut2:mainfrom
funbiscuit:extract-mist-core

Conversation

@funbiscuit

@funbiscuit funbiscuit commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The SDF generation pipeline never needed freetype — only the glyph-outline front end does. As it stood, any project linking mist pulled in freetype and libc, which made it impossible to bake SDFs inside a wasm32-freestanding engine. This split separates the two so the generator can run anywhere, while the freetype front end stays available for normal font usage.

What

One package, two modules:

  • mist — the full library, public API unchanged.
  • mist-core — new module: the geometry files and the SDF pipeline, with zero dependencies.

The freetype frontend now works like any other consumer of the core: it decomposes glyph outlines through ShapeSink(font-agnostic moveTo/lineTo/quadTo/cubicTo/close ingestion) and calls core.generateSingle, which takes a caller-built shape plus em-unit advance/bearings instead of a codepoint.

Notes

  • I've split the work into series of commits, each can be reviewed separately — can look at them as a series of small PRs.
  • mist consumers still download the freetype tarball (dependencies are package-wide, same as today), but the C code is only compiled when the mist module is linked — mist-core alone never compiles C. Verified that the core builds for wasm32-freestanding with no libc.
  • Text for this PR was structured with an LLM, but I've reviewed it and edited in some places.

@flut2

flut2 commented Oct 10, 2026

Copy link
Copy Markdown
Owner

LGTM, thanks for the PR

@flut2
flut2 merged commit d44f70b into flut2:main Oct 10, 2026
6 checks passed
@funbiscuit
funbiscuit deleted the extract-mist-core branch October 10, 2026 18:38
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.

2 participants