forked from 1b-agent/opencadstudio-upstream
feat(fonts): switch the text engine from CXF to LibreCAD LFF fonts
Replace the small QCAD CXF stroke-font set with the full LibreCAD LFF font library (46 fonts) and a new LFF parser/engine in src/scene/lff.rs. The parser reads the `[hex] char` glyph blocks, tessellates `,A<bulge>` arcs, and resolves `C<hex>` glyph references. Per LibreCAD's RS_Polyline convention a vertex's bulge curves the segment ending at that vertex — getting this wrong turned round letters like O into sideways capsules. Font name resolution mirrors LibreCAD: match by file stem, map common AutoCAD/DXF SHX names (txt, isocp, complex, italic, gothic*, gost, …) to the nearest LFF family, and fall back to `standard`. A missing glyph in the chosen family falls back to the broad `unicode` font so accented/Cyrillic/Greek text still renders. Cap height stays 9 units, so the text scale is unchanged. All text consumers move from cxf:: to lff::; complex linetypes still render embedded text but no longer draw embedded shapes (LibreCAD ships no shape file). The CXF module and every *.cxf asset are removed, and the MText / text style font pickers list the LFF families. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
32136dd9dd
commit
c1b33677e2
98 files changed
+886126
-47228
No files matched your search
+20
-20
@@ -60,26 +60,26 @@ const LIST: Color = Color {
|
||||
};
|
||||
|
||||
const BUILTIN_FONTS: &[&str] = &[
|
||||
"CourierCad.cxf",
|
||||
"Cursive.cxf",
|
||||
"GothGBT.cxf",
|
||||
"GothGRT.cxf",
|
||||
"GothITT.cxf",
|
||||
"GreekC.cxf",
|
||||
"GreekS.cxf",
|
||||
"ItalicC.cxf",
|
||||
"ItalicT.cxf",
|
||||
"RomanC.cxf",
|
||||
"RomanD.cxf",
|
||||
"RomanS.cxf",
|
||||
"RomanT.cxf",
|
||||
"SansND.cxf",
|
||||
"SansNS.cxf",
|
||||
"ScriptC.cxf",
|
||||
"ScriptS.cxf",
|
||||
"Standard.cxf",
|
||||
"Unicode.cxf",
|
||||
"SymbolCad.cxf",
|
||||
"Standard",
|
||||
"ISO",
|
||||
"Simplex",
|
||||
"RomanS",
|
||||
"RomanD",
|
||||
"RomanC",
|
||||
"RomanT",
|
||||
"ItalicC",
|
||||
"ItalicT",
|
||||
"ScriptS",
|
||||
"ScriptC",
|
||||
"GothGBT",
|
||||
"GothGRT",
|
||||
"GothITT",
|
||||
"Cursive",
|
||||
"GreekC",
|
||||
"Symbol",
|
||||
"ISO",
|
||||
"ISO3098",
|
||||
"Unicode",
|
||||
];
|
||||
|
||||
fn btn_s(accent: bool) -> impl Fn(&Theme, button::Status) -> button::Style {
|
||||
|
||||
Reference in new issue
Block a user