Summary
Emitted SVG text does not use the fonts specified by the model. The emitter always renders theme defaults (observed: Arial 9px, Yu Gothic UI 13px, Calibri 7px mixed in one diagram), while EA's own export applies the per-element font face and size. Font face and size therefore differ from what EA builds.
Mechanism
Ea::Model::DiagramElement models the full font set (font_family, font_size, font_bold, font_italic, font_underline), but:
- The QEA builder drops the size.
lib/ea/sources/qea/diagram_builder.rb:95-97 maps only font_family, font_bold, font_italic from the style hash — font_size and font_underline are never assigned. The QEA style/font table carries the size (EA stores per-element font size); it is parsed into style_hash and discarded.
FontResolver therefore always misses. lib/ea/svg/ea_emitter/font_resolver.rb:35-43 uses element.font_size only when explicitly set, else falls back to theme.font_size — so every element renders at the theme default instead of its model font.
- Serialized diagram shards confirm it: elements carry
fontFamily / fontBold / fontItalic but no fontSize key at all.
Result in one rendered CG2 diagram: font-family:Arial; font-size:9px (×42), Yu Gothic UI 13px (×21), Calibri 7px (×1) — a theme mishmash, not the model's fonts, and px units where EA's export uses its own font-size conventions.
Impact
Any consumer comparing our SVG to EA's export sees wrong text metrics: different face, different size, different line wrapping and box overflow. This blocks the parity goal — SVG output must be fully identical to what EA builds — together with #51 (text renderer crash) and #52 (connector source ports).
Suggested direction
- QEA
diagram_builder: map font_size (and font_underline) from the style hash / font table alongside family/bold/italic; consult the QEA font table (t_font) where per-object overrides live.
- Keep
FontResolver's theme fallback, but only for elements that genuinely have no font data.
- Add font face/size/weight to
Ea::Svg::Parity::Checker's measured attributes so regressions are caught against EA reference exports.
Parity acceptance
Parity::Suite (lib/ea/svg/parity/suite.rb) is ready to drive this — it compares our render against per-diagram EA reference SVGs (<eaid>.svg in a reference dir) — but the repository currently ships zero EA reference exports. To "ensure the SVGs built are fully identical to what EA builds", we need a set of EA-exported reference SVGs for a representative diagram subset committed as fixtures, and the suite extended to fail on font/geometry deltas, not just element counts.
Summary
Emitted SVG text does not use the fonts specified by the model. The emitter always renders theme defaults (observed:
Arial 9px,Yu Gothic UI 13px,Calibri 7pxmixed in one diagram), while EA's own export applies the per-element font face and size. Font face and size therefore differ from what EA builds.Mechanism
Ea::Model::DiagramElementmodels the full font set (font_family,font_size,font_bold,font_italic,font_underline), but:lib/ea/sources/qea/diagram_builder.rb:95-97maps onlyfont_family,font_bold,font_italicfrom the style hash —font_sizeandfont_underlineare never assigned. The QEA style/font table carries the size (EA stores per-element font size); it is parsed intostyle_hashand discarded.FontResolvertherefore always misses.lib/ea/svg/ea_emitter/font_resolver.rb:35-43useselement.font_sizeonly when explicitly set, else falls back totheme.font_size— so every element renders at the theme default instead of its model font.fontFamily/fontBold/fontItalicbut nofontSizekey at all.Result in one rendered CG2 diagram:
font-family:Arial; font-size:9px(×42),Yu Gothic UI 13px(×21),Calibri 7px(×1) — a theme mishmash, not the model's fonts, andpxunits where EA's export uses its own font-size conventions.Impact
Any consumer comparing our SVG to EA's export sees wrong text metrics: different face, different size, different line wrapping and box overflow. This blocks the parity goal — SVG output must be fully identical to what EA builds — together with #51 (text renderer crash) and #52 (connector source ports).
Suggested direction
diagram_builder: mapfont_size(andfont_underline) from the style hash / font table alongside family/bold/italic; consult the QEA font table (t_font) where per-object overrides live.FontResolver's theme fallback, but only for elements that genuinely have no font data.Ea::Svg::Parity::Checker's measured attributes so regressions are caught against EA reference exports.Parity acceptance
Parity::Suite(lib/ea/svg/parity/suite.rb) is ready to drive this — it compares our render against per-diagram EA reference SVGs (<eaid>.svgin a reference dir) — but the repository currently ships zero EA reference exports. To "ensure the SVGs built are fully identical to what EA builds", we need a set of EA-exported reference SVGs for a representative diagram subset committed as fixtures, and the suite extended to fail on font/geometry deltas, not just element counts.