mORMot2 DailyDaily read of upstream commits

EMF lines now keep the right stroke and path boundaries in PDF output

The PDF engine fixes several EMF line-record cases that could omit a line, paint it with a later shape, or emit redundant stroke operators. The change matters to Delphi and FPC applications that convert Windows metafiles to PDF; a separate test-only commit makes the same PDF regression suite deterministic on scaled displays.

TL;DR

  • mormot.ui.pdf now ends or strokes EMF LineTo, Arc, ArcTo and polyline geometry immediately when it is outside a recorded GDI path.
  • PDF regression tests now force ScreenLogPixels to 96, avoiding DPI-dependent hashes and coordinates without changing application output.

Upgrade advice

Applications that render Windows EMF content into PDF should land on merged revision ea5a2bbb6a5750f9fd60f21253fb8c5c4bb4cf67, build 2.4.17677, and compare representative documents containing lines, arcs and null pens. The raw payload lists no superseding fix for either non-merge commit; other backends have no urgent reason to update for this edition alone.

Commits4
Lines+396 -172
Read1 min

2 of 2 entries · 4 commits upstream

# Entry Category Units
1 Medium EMF line records no longer leak into later PDF shapes or lose their stroke In mormot.ui.pdf, TPdfCanvas.NewPath now only emits the PDF n operator instead of also changing fNewPath. TPdfEnum confines fNewPath to the EMR_BEGINPATH/EMR_ENDPATH bracket, removes fInLined, and makes LineTo, Arc, ArcTo, PolylineTo and related line records outside that bracket either Stroke with a real pen or NewPath with a null pen. FillRectangle no longer carries the ResetNewPath parameter. New EmfNullPenLines and EmfLineAfterEndedPath tests cover null pens, ended paths and later shapes. Fixes mormot.ui.pdf c5a9ae27+196-86

ui: pdf - lines outside a path are stroked or ended in their own record

Impact

Windows EMF content converted to PDF no longer drops PolylineTo output, leaves null-pen geometry for a later shape to paint, or emits a pending duplicate stroke after a normal line. Existing Delphi and FPC application code and public signatures are unchanged; only generated PDF path behaviour changes. The upstream matrix passed on Delphi 7/13 and FPC Win64, while retaining the known unrelated FPC 3.2.2 Win32 test failure.

Sven Harazim · 15:09 UTC · view the commit on GitHub →

2 Low PDF metafile tests now use fixed 96-DPI coordinates on scaled screens The test.ui.pdf helpers MetafileRenderingAndOrientation and RenderedEmf now set TPdfDocumentGdi.ScreenLogPixels to 96 before rendering. This keeps the expected coordinates, output length and hash independent of the real screen DPI when the test executable is DPI-aware. Tests test.ui.pdf 9b2ab725+2-0

test: pdf - the metafile checks expect a 96 DPI screen on any screen

Impact

This changes only the regression-test setup. Delphi and FPC applications do not receive a new default and their PDF scaling remains unchanged; developers running the suite on a 125%, 150% or other scaled Windows display should stop seeing DPI-dependent failures in these checks.

Sven Harazim · 07:00 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28