forked from 1b-agent/opencadstudio-upstream
feat(fonts): system TrueType support with shaping and fallback
Add a TrueType/OpenType render path alongside the LFF stroke engine so users can pick fonts installed on their machine for text and MText. - Discover system families via fontdb (sysfont) and list them in the text-style picker. - Extract glyph outlines with ttf-parser, flattened into wire strokes normalized to the same 9-unit cap-height space as LFF glyphs. - Shape runs with cosmic-text (ligatures, Arabic joining, kerning, bidi) plus automatic font fallback: a glyph missing from the chosen family is taken from another installed font. - Unify both sources behind a single Face type; a shared run tokenizer drives the stroke (per-glyph) and shaped (TTF) renderers identically. - Stroke fonts now fall back to a system TTF (cosmic-text picks it) for characters no LFF font covers, replacing the unicode/iso3098 chain. Also trim the embedded LFF set from 47 to 26, keeping the AutoCAD-SHX equivalents and dropping LibreCAD-only fonts now covered by TrueType. LFF builtins keep priority over same-named system fonts so DXF text renders identically across machines. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
eff6c7c730
commit
cd048165a9
31 files changed
+1037
-763578
No files matched your search
@@ -4,6 +4,7 @@ mod camera;
|
||||
pub mod complex_lt;
|
||||
pub mod lff;
|
||||
pub mod dispatch;
|
||||
pub mod font_face;
|
||||
pub mod grip;
|
||||
pub mod hatch_model;
|
||||
pub mod hatch_patterns;
|
||||
@@ -28,6 +29,8 @@ mod selection;
|
||||
pub mod acis_to_truck;
|
||||
pub mod solid3d_tess;
|
||||
pub mod spline_tess;
|
||||
pub mod sysfont;
|
||||
pub mod ttf_glyph;
|
||||
pub mod tess_util;
|
||||
pub mod tessellate;
|
||||
pub mod transform;
|
||||
|
||||
Reference in new issue
Block a user