cad-editor/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kevin Griffin 6b15884444 fix(export): render SDF text as vectors in PDF/print export (#385)
Since text became SDF-only (the legacy stroke-text path was removed), all
text — standalone TEXT/MTEXT and dimension text — rendered on-screen only as
GPU glyph quads carried on `WireModel::text_verts`. The CPU PDF/print exporter
draws only wire stroke `points` and hatch fills, so it silently dropped every
glyph: dimensions and text were missing from exported PDFs and prints
(present in v0.7.6).

Reconstruct vector text in the exporter instead of resurrecting the stroke
path, so the SDF render path and its caching are untouched:

- sdf_atlas: `GlyphAtlas::export_table()` snapshots each baked glyph's vector
  geometry (outline strokes + fill triangles, glyph space) keyed by its tile
  `uv_min`, re-resolved through `Face` so it honours the current TEXTFILL.
- pdf_export: a new `emit_text` pass walks each wire's `text_verts` (one
  6-vertex quad per glyph), recovers the glyph geometry by `uv_min`, and
  affine-maps it into the quad — `DrawLine` polylines for stroke (LFF/SHX)
  fonts, filled triangles for TrueType, plus solid decoration bars. Runs under
  the same rotation/scale/clip CTM as the wires, so it covers model space,
  paper space and windowed plots, and every SDF-text kind (text, dimension,
  multileader, table, tolerance).

Text embedded in complex linetypes is SDF-only with no stroke fallback and
stays out of scope.

Tests: a unit test asserts a stroke glyph emits vector ops within the glyph's
world bbox; an integration test drives a real TEXT + linear DIMENSION through
scene.entity_wires() -> export_pdf and checks text reaches the file. Verified
bug-first: with emit_text disabled the end-to-end test fails with the reported
symptom (text adds no content).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 13:49:21 -07:00
..
active_space_roundtrip.rs fix(layout): create the CTAB variable so the exact paper tab round-trips 2026-07-12 01:17:26 +03:00
annotative_context_roundtrip.rs feat(annotative): synthesize per-object contexts + editable UI 2026-07-13 22:38:29 +03:00
annotative_context_synthesis.rs feat(annotative): synthesize per-object contexts + editable UI 2026-07-13 22:38:29 +03:00
block_hatch_export.rs fix(hatch): flag only the outer ring as external when serializing holes 2026-07-13 05:55:54 +01:00
dim_copy_check.rs fix(copy): duplicate a dimension's baked block so COPY copies it (#161) 2026-06-25 22:30:45 +03:00
dim_line_color_roundtrip.rs feat(props): make dim-line colour editable for leaders and dimensions 2026-07-13 17:31:09 +03:00
page_setup_root_repair.rs fix(io): resolve root named-objects dict robustly on foreign DWGs 2026-07-13 16:28:21 +03:00
pdf_export_text_check.rs fix(export): render SDF text as vectors in PDF/print export (#385) 2026-07-15 13:49:21 -07:00
text_font_rendering.rs fix(text): keep inline \C colours through block colour inheritance (SDF) 2026-07-07 22:17:27 +03:00
zoom_extents_xline.rs fix(view): exclude XLine/Ray display segments from ZOOM Extents (#284) 2026-07-05 14:08:43 -07:00