Fix two test failures affecting CI and local test runs:
1. Cross-platform test runner thread stack overflow:
In debug builds (opt-level = 0), `app.view(wid)` constructs the entire Iced UI
widget tree (ribbon, tool panels, palettes, command line, status bar).
Because libtest spawns test worker threads without setting an explicit stack
size, the default thread stack allocated by the OS (2MB on Linux glibc, 1-2MB
on Windows) overflows during recursive un-inlined view construction in
`app::automation::tests::test_pline_line_then_arc`.
- Set `[env] RUST_MIN_STACK = "8388608"` in `.cargo/config.toml` so `cargo test`
allocates 8MB per test thread across all platforms (Linux CI, macOS, Windows).
- Wrapped `test_pline_line_then_arc` in an explicit 8MB thread via
`std::thread::Builder` to guarantee immunity even when invoked without env vars.
2. Windows temporary path formatting in JSON payload:
In `app::update::page_setup_import::tests::psetupin_imports_named_setups_from_a_saved_drawing`,
interpolating `source.display()` directly into a raw JSON string resulted in
unescaped backslashes from Windows paths, causing JSON deserialization to fail.
Replaced backslashes with forward slashes to ensure cross-platform valid JSON strings.
Embed debug locales and expand the WebAssembly stack so modal construction remains responsive. Keep the Options scrollbar in its own lane and refine Turkish CAD terminology.
The release profile's strip = true (added in #324) strips the wasm
target_features custom section. Without it, wasm-opt can't tell that
bulk-memory is enabled and rejects the module's memory.fill/copy ops
("operations require bulk memory"), failing the release web build — the
newer Rust toolchain now emits those ops by default. Override strip only
for the wasm target with -Cstrip=none, so native release binaries stay
stripped while the wasm keeps its feature section.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Follow-up cleanups on the merged TTF-fill work:
- Drop the unconditional resolve_text_style log line — it fired for every
text style and spammed ~7k stderr lines opening a single real drawing.
- Drop the per-glyph tessellation-error eprintln; a malformed font would
otherwise log once per character. The glyph still falls back silently.
- Tessellate glyph fills with the nonzero winding rule (lyon defaults to
even-odd, which mis-fills TrueType outlines whose contours overlap).
- Make the sysfont prefix fallback deterministic (sorted) and require ≥3
chars so a 1–2 letter request can't grab an arbitrary family.
- Remove the unrelated windows-gnu --exclude-all-symbols linker flag that
slipped into .cargo/config.toml.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Text elements previously rendered as hollow wireframe outlines and sometimes
fell back to the wrong system font due to case-sensitive exact matching. Also,
the viewport background grid drew on top of solid entities.
Case-insensitive and partial-name fallback matching (e.g., mapping "arialn"
to "Arial Narrow") is now added to `sysfont::canonical_family_name`, ensuring
text resolves to the correct installed system font.
TrueType font contours are now triangulated into solid fills (`fill_tris`)
using `lyon_tessellation` in `ttf_glyph.rs`. To prevent the GPU from misclassifying
this 2D text as a 3D mesh (which broke flat shading), text tessellation splits
the output into separate outline and fill `WireModel`s.
The background grid is extracted from `SelectionCanvas` into `GridCanvas` and
moved beneath the 3D viewport to ensure proper layering. Finally, `DepthBiasState`
is enabled on all face/fill pipelines to apply a polygon offset, perfectly
resolving Z-fighting between coplanar wireframe lines and solid faces.
The web build had bit-rotted: native-only features added since it last
compiled pulled crates that don't build for wasm32-unknown-unknown.
- printpdf (PDF export / printing) → native-only target; the web build gets
stub export_pdf / print_wires. It pulls a wasm-incompatible memchr 1.0.2
via lopdf → nom_locate, and the web has no filesystem.
- getrandom 0.3 (via ahash via acadrust) → enable its wasm_js feature and add
the matching --cfg getrandom_backend rustflag in .cargo/config.toml.
- ocs_plugin_api "host" feature (out-of-process plugin runtime: interprocess,
libloading, memmap2, rkyv) → native-only target; the web gets the
dependency-free manifest/ribbon contract. The host code was already
wasm-gated; only the Cargo wiring pulled it in unconditionally.
`trunk build --release` succeeds again.
Co-Authored-By: Claude Opus 4.8 <[email protected]>