wordcraft/crates/metafile
naxvog 05679497ea
Pictures: WMF drawings fill their frame like Word plays them (#739)
Word plays a WMF into the picture's box the way a GDI player does: the
placeable header's bounds are only the first window, mapped onto a
viewport of the picture's size, and the file's own SETWINDOWORG and
SETWINDOWEXT records replace that window. WordCraft mapped the header's
bounds through the file's final mapping instead, which broke three
pictures in docxide-pdf's fixtures:

- bulgarian_farmland_allocation_order: the coat of arms draws in a
  window centred on the origin, nowhere near the header's bounds, so
  the lion was blown up into a solid black box.
- ukrainian_municipal_heating_resolution: a portrait window replaced
  the landscape bounds, so the emblem was drawn at a fifth of its size.
- A plain WMF in anisotropic mode that sets a window but no viewport
  kept the 1 x 1 default viewport and shrank to a point; its first
  window is now its target.

Files that set their own viewport, or use the fixed-scale map modes,
are read as before.

SETROP2 is now read too: with R2_NOP, shapes and paths draw nothing
(the coat of arms first draws its bounding rectangle that way, which
showed as an outline). The mode is saved and restored with the DC.

Co-authored-by: Naxvog <4963183+naxvog@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-12 00:45:53 -04:00
..
src Pictures: WMF drawings fill their frame like Word plays them (#739) 2026-10-12 00:45:53 -04:00
Cargo.toml Pictures: draw WMF and EMF pictures instead of a grey box (#293) 2026-10-10 14:35:32 -04:00