[Research] Add bezier-curve SDF generation via ttf-parser (research branch for #16)#27
Draft
lseelenbinder wants to merge 2 commits into
Draft
[Research] Add bezier-curve SDF generation via ttf-parser (research branch for #16)#27lseelenbinder wants to merge 2 commits into
lseelenbinder wants to merge 2 commits into
Conversation
Add an alternative vector-based SDF generation path that computes signed distance fields directly from font bezier curve outlines, rather than from rasterized bitmaps. This improves rendering quality for complex scripts (Indic, Khmer, Burmese) where rasterization loses information. New modules in sdf_glyph_renderer: - outline.rs: Glyph outline data structures with bezier curve flattening - outline_sdf.rs: SDF algorithm using R-tree spatial indexing + winding number - ttf.rs: ttf-parser integration via OutlineBuilder trait - types.rs: Shared SdfGlyph/GlyphMetrics types (extracted from ft.rs) New in pbf_font_tools: - ttf_generate.rs: ttf-parser glyph generation pipeline (parallel to ft_generate.rs) CLI changes: - build_pbf_glyphs --backend bitmap|bezier flag to select SDF generation method New dependencies: ttf-parser (pure Rust font parser), rstar (R-tree spatial index) Both gated behind the "ttf-parser" feature flag. https://claude.ai/code/session_01MZQnJnULX397TRkQ6vpJms
lseelenbinder
force-pushed
the
claude/sdf-font-tools-plan-eS2ED
branch
from
March 13, 2026 10:22
a7c841d to
eeff6de
Compare
The two modules were tightly coupled (outline_sdf only operated on types from outline). Combining them removes a module boundary and the cross-module imports, keeping all outline geometry + SDF rendering in one place. https://claude.ai/code/session_01MZQnJnULX397TRkQ6vpJms
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.
Add an alternative vector-based SDF generation path that computes signed distance fields directly from font bezier curve outlines, rather than from rasterized bitmaps. This improves rendering quality for complex scripts (Indic, Khmer, Burmese) where rasterization loses information.
New modules in sdf_glyph_renderer:
New in pbf_font_tools:
CLI changes:
New dependencies: ttf-parser (pure Rust font parser), rstar (R-tree spatial index) Both gated behind the "ttf-parser" feature flag.
https://claude.ai/code/session_01MZQnJnULX397TRkQ6vpJms