You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bezier-curve SDF generation via ttf-parser (research branch for #16)
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
/// Bitmap-based SDF using FreeType rasterization (default, fast).
48
+
Bitmap,
49
+
/// Vector-based SDF using bezier curves from font outlines (higher quality for complex scripts).
50
+
Bezier,
51
+
}
52
+
41
53
#[derive(Parser,Debug)]
42
54
#[command(version, author, about)]
43
55
structArgs{
@@ -51,6 +63,9 @@ struct Args {
51
63
/// Overwrites existing glyphs. By default, glyph generation will be skipped for any range with a matching file in the output directory. Note that the contents of the file are not inspected; only the name.
0 commit comments