Repository navigation
Replace DRIT.Drawing with owned metafile rendering - #220
Conversation
Switch portable conversion to managed EMF and WMF rendering, resolve real font faces, preserve cropping, and remove incorporated Drawing sources and package notices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Important Review skippedToo many files! This PR contains 691 files, which is 541 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the legacy drawing removal and benchmark automation changes.
No open issues 🎉
What changed in this PR
This PR replaces the incorporated DRIT.Drawing implementation with MiniPdf-owned managed metafile rendering. The reviewed changes remove legacy drawing components and their packaging notices, and isolate Word automation used to generate benchmark references.
Changes:
- Remove legacy metafile, rendering, text, font, and imaging implementation files.
- Remove DRIT.Drawing license and notice entries from NuGet packaging.
- Create separate Word COM instances and open benchmark documents read-only without adding them to recent files.
| File | Description |
|---|---|
| tests/MiniPdf.Benchmark/generate_office_pdfs_docx.py | Isolates Word automation and opens documents read-only. |
| src/MiniPdf/MiniPdf.csproj | Removes DRIT attribution packaging entries. |
| src/MiniPdf/Drawing/Vector/VectorScenePlayer.cs | Removes legacy scene playback. |
| src/MiniPdf/Drawing/Vector/DrawingCommand.cs | Removes legacy command abstraction. |
| src/MiniPdf/Drawing/Vector/Commands/ClearCommand.cs | Removes legacy clear command. |
| src/MiniPdf/Drawing/Text/TextRenderingHint.cs | Removes legacy text-rendering options. |
| src/MiniPdf/Drawing/Text/TextOnPathOverflow.cs | Removes legacy text-path overflow options. |
| src/MiniPdf/Drawing/Text/TextLine.cs | Removes legacy text-line model. |
| src/MiniPdf/Drawing/Text/StringTrimming.cs | Removes legacy trimming options. |
| src/MiniPdf/Drawing/Text/StringDigitSubstitute.cs | Removes legacy digit-substitution options. |
| src/MiniPdf/Drawing/Text/StringAlignment.cs | Removes legacy alignment options. |
| src/MiniPdf/Drawing/Text/Native/NativeFontInfo.cs | Removes legacy native-font metadata. |
| src/MiniPdf/Drawing/Text/HotkeyPrefix.cs | Removes legacy hotkey options. |
| src/MiniPdf/Drawing/Text/GenericFontFamilies.cs | Removes legacy font-family categories. |
| src/MiniPdf/Drawing/Text/CharacterRange.cs | Removes legacy character-range model. |
| src/MiniPdf/Drawing/Text/Bidi/BidiParagraphDirection.cs | Removes legacy paragraph-direction options. |
| src/MiniPdf/Drawing/Rendering/ScanlineBuffer.cs | Removes legacy scanline storage. |
| src/MiniPdf/Drawing/Rendering/GraphicsContainer.cs | Removes legacy graphics container. |
| src/MiniPdf/Drawing/Rendering/BrushSampler.cs | Removes legacy brush sampling. |
| src/MiniPdf/Drawing/Rendering/ActiveEdge.cs | Removes legacy rasterization edge model. |
| src/MiniPdf/Drawing/NOTICE.md | Removes attribution for the removed implementation. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETWINDOWORG.cs | Removes legacy WMF window-origin record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETWINDOWEXT.cs | Removes legacy WMF window-extents record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETVIEWPORTORG.cs | Removes legacy WMF viewport-origin record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETVIEWPORTEXT.cs | Removes legacy WMF viewport-extents record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETTEXTJUSTIFICATION.cs | Removes legacy WMF text-justification record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETTEXTCOLOR.cs | Removes legacy WMF text-color record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETTEXTCHAREXTRA.cs | Removes legacy WMF character-spacing record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETTEXTALIGN.cs | Removes legacy WMF text-alignment record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETSTRETCHBLTMODE.cs | Removes legacy WMF bitmap-stretch mode record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETROP2.cs | Removes legacy WMF raster-operation record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETRELABS.cs | Removes legacy WMF coordinate-mode record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETPOLYFILLMODE.cs | Removes legacy WMF polygon-fill mode record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETMAPPERFLAGS.cs | Removes legacy WMF font-mapping flags record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETMAPMODE.cs | Removes legacy WMF mapping-mode record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETLAYOUT.cs | Removes legacy WMF layout record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETBKMODE.cs | Removes legacy WMF background-mode record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SETBKCOLOR.cs | Removes legacy WMF background-color record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_SAVEDC.cs | Removes legacy WMF state-save record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_RESTOREDC.cs | Removes legacy WMF state-restore record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_RESIZEPALETTE.cs | Removes legacy WMF palette-resize record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_REALIZEPALETTE.cs | Removes legacy WMF palette-mapping record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_OFFSETWINDOWORG.cs | Removes legacy WMF window-offset record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_OFFSETVIEWPORTORG.cs | Removes legacy WMF viewport-offset record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/StateRecordTypes/META_MOVETO.cs | Removes legacy WMF position record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/Record.cs | Removes legacy WMF record abstraction. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/ObjectRecordTypes/META_SELECTPALETTE.cs | Removes legacy WMF palette-selection record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/ObjectRecordTypes/META_SELECTCLIPREGION.cs | Removes legacy WMF clipping-selection record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/ObjectRecordTypes/META_DELETEOBJECT.cs | Removes legacy WMF object-deletion record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/META_PAINTREGION.cs | Removes legacy WMF region-paint record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/META_LINETO.cs | Removes legacy WMF line record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/META_INVERTREGION.cs | Removes legacy WMF region-inversion record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/META_EOF.cs | Removes legacy WMF end record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Records/META_DIBBITBLT.cs | Removes legacy WMF bitmap-transfer record. |
| src/MiniPdf/Drawing/Metafile/Wmf/Objects/SizeL.cs | Removes legacy WMF size model. |
| src/MiniPdf/Drawing/Metafile/Wmf/Objects/PolyPolygon.cs | Removes legacy WMF polygon model. |
| src/MiniPdf/Drawing/Metafile/Wmf/Objects/PointS.cs | Removes legacy WMF short-point model. |
| src/MiniPdf/Drawing/Metafile/Wmf/Objects/PointL.cs | Removes legacy WMF long-point model. |
| src/MiniPdf/Drawing/Metafile/Wmf/Objects/Brush.cs | Removes legacy WMF brush model. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/PostScriptJoin.cs | Removes legacy PostScript join options. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/PostScriptClipping.cs | Removes legacy PostScript clipping options. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/PolyFillMode.cs | Removes legacy WMF fill modes. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/PitchFont.cs | Removes legacy WMF font-pitch options. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/MixMode.cs | Removes legacy WMF background modes. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/MetafileVersion.cs | Removes legacy WMF version constants. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/MetafileType.cs | Removes legacy WMF storage types. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/LogicalColorSpace.cs | Removes legacy WMF color-space constants. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/Layout.cs | Removes legacy WMF layout options. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/FloodFill.cs | Removes legacy WMF flood-fill options. |
| src/MiniPdf/Drawing/Metafile/Wmf/Enumerations/ColorUsage.cs | Removes legacy WMF color-table options. |
| src/MiniPdf/Drawing/Metafile/MetafileFormat.cs | Removes legacy metafile-format enumeration. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/RecordHeader.cs | Removes legacy EMF+ record header. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/Record.cs | Removes legacy EMF+ record abstraction. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusStrokeFillPathRecord.cs | Removes legacy EMF+ stroke-and-fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetTSGraphicsRecord.cs | Removes legacy EMF+ terminal-server graphics record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetTSClipRecord.cs | Removes legacy EMF+ terminal-server clipping record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetTextRenderingHintRecord.cs | Removes legacy EMF+ text-rendering record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetTextContrastRecord.cs | Removes legacy EMF+ text-contrast record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetRenderingOriginRecord.cs | Removes legacy EMF+ rendering-origin record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetPixelOffsetModeRecord.cs | Removes legacy EMF+ pixel-offset record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetInterpolationModeRecord.cs | Removes legacy EMF+ interpolation record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetCompositingQualityRecord.cs | Removes legacy EMF+ compositing-quality record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetCompositingModeRecord.cs | Removes legacy EMF+ compositing-mode record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetClipRegionRecord.cs | Removes legacy EMF+ region-clipping record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetClipPathRecord.cs | Removes legacy EMF+ path-clipping record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSetAntiAliasModeRecord.cs | Removes legacy EMF+ antialiasing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSerializableObjectRecord.cs | Removes legacy EMF+ serialized-object record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusSaveRecord.cs | Removes legacy EMF+ state-save record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusRotateWorldTransformRecord.cs | Removes legacy EMF+ rotation record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusRestoreRecord.cs | Removes legacy EMF+ state-restore record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusResetWorldTransformRecord.cs | Removes legacy EMF+ transform-reset record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusResetClipRecord.cs | Removes legacy EMF+ clipping-reset record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusOffsetClipRecord.cs | Removes legacy EMF+ clipping-offset record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusMultiFormatStartRecord.cs | Removes legacy EMF+ multiformat-start record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusMultiFormatSectionRecord.cs | Removes legacy EMF+ multiformat-section record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusMultiFormatEndRecord.cs | Removes legacy EMF+ multiformat-end record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusGetDCRecord.cs | Removes legacy EMF+ GetDC record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusFillRegionRecord.cs | Removes legacy EMF+ region-fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusFillPolygonRecord.cs | Removes legacy EMF+ polygon-fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusFillPathRecord.cs | Removes legacy EMF+ path-fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusFillEllipseRecord.cs | Removes legacy EMF+ ellipse-fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusFillClosedCurveRecord.cs | Removes legacy EMF+ closed-curve fill record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusEndOfFileRecord.cs | Removes legacy EMF+ end-of-file record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusEndContainerRecord.cs | Removes legacy EMF+ container-end record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawPathRecord.cs | Removes legacy EMF+ path-drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawLinesRecord.cs | Removes legacy EMF+ line-drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawEllipseRecord.cs | Removes legacy EMF+ ellipse-drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawDriverstringRecord.cs | Removes legacy EMF+ driver-string record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawCurveRecord.cs | Removes legacy EMF+ curve-drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawClosedCurveRecord.cs | Removes legacy EMF+ closed-curve drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusDrawBeziersRecord.cs | Removes legacy EMF+ Bézier-drawing record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusCommentRecord.cs | Removes legacy EMF+ comment record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusClearRecord.cs | Removes legacy EMF+ clear record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusBeginContainerRecord.cs | Removes legacy EMF+ container-start record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Records/EmfPlusBeginContainerNoParamsRecord.cs | Removes legacy EMF+ parameterless container record. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Objects/EmfPlusRegionObject.cs | Removes legacy EMF+ region model. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Objects/EmfPlusRegionNodeObject.cs | Removes legacy EMF+ region-node model. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Objects/EmfPlusRectFObject.cs | Removes legacy EMF+ rectangle model. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Objects/EmfPlusGraphicsVersionObject.cs | Removes legacy EMF+ version placeholder. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/RegionNodeDataType.cs | Removes legacy EMF+ region-node types. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/ObjectType.cs | Removes legacy EMF+ object types. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusUnitType.cs | Removes legacy EMF+ measurement units. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusSmoothingMode.cs | Removes legacy EMF+ smoothing options. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusPixelOffsetMode.cs | Removes legacy EMF+ pixel-offset options. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusMatrixOrder.cs | Removes legacy EMF+ matrix-order options. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusInterpolationMode.cs | Removes legacy EMF+ interpolation options. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusHeaderFlags.cs | Removes legacy EMF+ header flags. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusCompositingQuality.cs | Removes legacy EMF+ compositing-quality options. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusCompositingMode.cs | Removes legacy EMF+ compositing modes. |
| src/MiniPdf/Drawing/Metafile/EmfPlus/Enumerations/EmfPlusCombineMode.cs | Removes legacy EMF+ region-combination modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_WIDENPATH.cs | Removes legacy EMF path-widening record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_STROKEPATH.cs | Removes legacy EMF path-stroke record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_STROKEANDFILLPATH.cs | Removes legacy EMF stroke-and-fill record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETWINDOWORGEX.cs | Removes legacy EMF window-origin record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETWINDOWEXTEX.cs | Removes legacy EMF window-extents record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETVIEWPORTORGEX.cs | Removes legacy EMF viewport-origin record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETVIEWPORTEXTEX.cs | Removes legacy EMF viewport-extents record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETTEXTJUSTIFICATION.cs | Removes legacy EMF text-justification record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETTEXTCOLOR.cs | Removes legacy EMF text-color record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETTEXTALIGN.cs | Removes legacy EMF text-alignment record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETSTRETCHBLTMODE.cs | Removes legacy EMF bitmap-stretch mode record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETROP2.cs | Removes legacy EMF raster-operation record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETPOLYFILLMODE.cs | Removes legacy EMF polygon-fill mode record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETPIXELV.cs | Removes legacy EMF pixel-setting record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETMITERLIMIT.cs | Removes legacy EMF miter-limit record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETMETARGN.cs | Removes legacy EMF meta-region record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETMAPPERFLAGS.cs | Removes legacy EMF font-mapping flags record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETMAPMODE.cs | Removes legacy EMF mapping-mode record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETLAYOUT.cs | Removes legacy EMF layout record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETICMMODE.cs | Removes legacy EMF color-management mode record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETCOLORSPACE.cs | Removes legacy EMF color-space record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETCOLORADJUSTMENT.cs | Removes legacy EMF color-adjustment record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETBRUSHORGEX.cs | Removes legacy EMF brush-origin record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETBKMODE.cs | Removes legacy EMF background-mode record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETBKCOLOR.cs | Removes legacy EMF background-color record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SETARCDIRECTION.cs | Removes legacy EMF arc-direction record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SELECTPALETTE.cs | Removes legacy EMF palette-selection record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SELECTOBJECT.cs | Removes legacy EMF object-selection record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SELECTCLIPPATH.cs | Removes legacy EMF clipping-path record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_SAVEDC.cs | Removes legacy EMF state-save record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_RESTOREDC.cs | Removes legacy EMF state-restore record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_RESIZEPALETTE.cs | Removes legacy EMF palette-resize record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_REALIZEPALETTE.cs | Removes legacy EMF palette-mapping record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_OFFSETCLIPRGN.cs | Removes legacy EMF clipping-offset record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_MOVETOEX.cs | Removes legacy EMF position record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_INTERSECTCLIPRECT.cs | Removes legacy EMF clipping-intersection record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_FORCEUFIMAPPING.cs | Removes legacy EMF font-mapping record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_FLATTENPATH.cs | Removes legacy EMF path-flattening record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_FILLPATH.cs | Removes legacy EMF path-fill record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_EXCLUDECLIPRECT.cs | Removes legacy EMF clipping-exclusion record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_ENDPATH.cs | Removes legacy EMF path-end record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_DELETEOBJECT.cs | Removes legacy EMF object-deletion record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_DELETECOLORSPACE.cs | Removes legacy EMF color-space deletion record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_COMMENT.cs | Removes legacy EMF comment record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_COLORCORRECTPALETTE.cs | Removes legacy EMF palette-correction record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_CLOSEFIGURE.cs | Removes legacy EMF figure-close record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_BEGINPATH.cs | Removes legacy EMF path-start record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/StateRecordTypes/EMR_ABORTPATH.cs | Removes legacy EMF path-abort record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/RecordHeader.cs | Removes legacy EMF record header. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/Record.cs | Removes legacy EMF record abstraction. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/ObjectRecordTypes/EMR_CREATEPEN.cs | Removes legacy EMF pen-creation record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/DrawingRecordTypes/EMR_ROUNDRECT.cs | Removes legacy EMF rounded-rectangle record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/DrawingRecordTypes/EMR_RECTANGLE.cs | Removes legacy EMF rectangle record. |
| src/MiniPdf/Drawing/Metafile/Emf/Records/DrawingRecordTypes/EMR_LINETO.cs | Removes legacy EMF line record. |
| src/MiniPdf/Drawing/Metafile/Emf/Objects/XForm.cs | Removes legacy EMF transform model. |
| src/MiniPdf/Drawing/Metafile/Emf/Objects/TriVertex.cs | Removes legacy EMF gradient-vertex model. |
| src/MiniPdf/Drawing/Metafile/Emf/Objects/GradientTriangle.cs | Removes legacy EMF gradient-triangle model. |
| src/MiniPdf/Drawing/Metafile/Emf/Objects/GradientRectangle.cs | Removes legacy EMF gradient-rectangle model. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/RegionMode.cs | Removes legacy EMF region modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/ModifyWorldTransformMode.cs | Removes legacy EMF transform modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/IcmProfileFlags.cs | Removes legacy EMF color-profile flags. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/IcmMode.cs | Removes legacy EMF color-management modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/HatchStyle.cs | Removes legacy EMF hatch styles. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/GraphicsMode.cs | Removes legacy EMF graphics modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/GradientFill.cs | Removes legacy EMF gradient-fill modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/FormatSignature.cs | Removes legacy EMF format identifiers. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/FamilyType.cs | Removes legacy EMF font-family classification. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/Contrast.cs | Removes legacy EMF font-contrast classification. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/ColorMatchToTargetAction.cs | Removes legacy EMF color-matching actions. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/ColorMatchToTarget.cs | Removes legacy EMF color-profile indicators. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/ColorAdjustment.cs | Removes legacy EMF color-adjustment options. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/BackgroundMode.cs | Removes legacy EMF background modes. |
| src/MiniPdf/Drawing/Metafile/Emf/Enumerations/ArcDirection.cs | Removes legacy EMF arc directions. |
| src/MiniPdf/Drawing/LICENSE.DRIT.Drawing | Removes license for the removed implementation. |
| src/MiniPdf/Drawing/Imaging/PropertyItem.cs | Removes legacy image-metadata model. |
| src/MiniPdf/Drawing/Imaging/MetafileFrameUnit.cs | Removes legacy metafile frame units. |
| src/MiniPdf/Drawing/Imaging/FrameDisposeMethod.cs | Removes legacy animation disposal options. |
| src/MiniPdf/Drawing/Imaging/FrameBlendMethod.cs | Removes legacy animation blending options. |
| src/MiniPdf/Drawing/Imaging/EncoderParameters.cs | Removes legacy encoder-parameter container. |
| src/MiniPdf/Drawing/Imaging/EmfType.cs | Removes legacy EMF output-type options. |
| src/MiniPdf/Drawing/Imaging/ColorMatrixFlag.cs | Removes legacy color-matrix flags. |
| src/MiniPdf/Drawing/Imaging/ColorMap.cs | Removes legacy color-mapping model. |
| src/MiniPdf/Drawing/Imaging/ColorAdjustType.cs | Removes legacy color-adjustment categories. |
| src/MiniPdf/Drawing/Imaging/AnimationFrame.cs | Removes legacy animation-frame model. |
| src/MiniPdf/Drawing/Geometry/PointTransform.cs | Removes legacy point-transform helpers. |
| src/MiniPdf/Drawing/Font/Sources/IStreamSource.cs | Removes legacy font-stream interface. |
| src/MiniPdf/Drawing/Font/Sources/FileSystemStreamSource.cs | Removes legacy file-backed font source. |
| src/MiniPdf/Drawing/Font/Sources/ByteContentStreamSource.cs | Removes legacy memory-backed font source. |
| src/MiniPdf/Drawing/Font/Glyphs/IGlyphAccessor.cs | Removes legacy glyph-access interface. |
| src/MiniPdf/Drawing/Font/Glyphs/GlyphId.cs | Removes legacy glyph identifier. |
| src/MiniPdf/Drawing/Font/Encoding/NullEncoding.cs | Removes legacy placeholder font encoding. |
| src/MiniPdf/Drawing/Font/Core/GlyphClass.cs | Removes legacy glyph classification. |
| src/MiniPdf/Drawing/Font/Core/FontVariationInstance.cs | Removes legacy variable-font instance model. |
| src/MiniPdf/Drawing/Font/Core/FontType.cs | Removes legacy font-format enumeration. |
| src/MiniPdf/Drawing/Font/Core/FontFaceStyle.cs | Removes legacy font-face styles. |
| src/MiniPdf/Drawing/Font/Core/FontFaceCollection.cs | Removes legacy font-face collection. |
| src/MiniPdf/Drawing/Font/Cff/CffPrivateDict.cs | Removes legacy CFF private-dictionary model. |
| src/MiniPdf/Drawing/Enums/ImageLockMode.cs | Removes legacy image-lock options. |
| src/MiniPdf/Drawing/Enums/GraphicsUnit.cs | Removes legacy graphics measurement units. |
| src/MiniPdf/Drawing/Enums/FontStyle.cs | Removes legacy font-style flags. |
| src/MiniPdf/Drawing/Drawing2D/WrapMode.cs | Removes legacy brush-wrapping options. |
| src/MiniPdf/Drawing/Drawing2D/SmoothingMode.cs | Removes legacy smoothing options. |
| src/MiniPdf/Drawing/Drawing2D/RegionData.cs | Removes legacy region-data container. |
| src/MiniPdf/Drawing/Drawing2D/PixelOffsetMode.cs | Removes legacy pixel-offset options. |
| src/MiniPdf/Drawing/Drawing2D/PenType.cs | Removes legacy pen-fill categories. |
| src/MiniPdf/Drawing/Drawing2D/PenAlignment.cs | Removes legacy pen-alignment options. |
| src/MiniPdf/Drawing/Drawing2D/PathData.cs | Removes legacy path-data container. |
| src/MiniPdf/Drawing/Drawing2D/MatrixOrder.cs | Removes legacy matrix-order options. |
| src/MiniPdf/Drawing/Drawing2D/LineJoin.cs | Removes legacy line-join options. |
| src/MiniPdf/Drawing/Drawing2D/LinearGradientMode.cs | Removes legacy gradient directions. |
| src/MiniPdf/Drawing/Drawing2D/FlushIntention.cs | Removes legacy graphics-flush options. |
| src/MiniPdf/Drawing/Drawing2D/FillMode.cs | Removes legacy shape-fill modes. |
| src/MiniPdf/Drawing/Drawing2D/DashStyle.cs | Removes legacy dash styles. |
| src/MiniPdf/Drawing/Drawing2D/DashCap.cs | Removes legacy dash-cap options. |
| src/MiniPdf/Drawing/Drawing2D/CompositingQuality.cs | Removes legacy compositing-quality options. |
| src/MiniPdf/Drawing/Drawing2D/CompositingMode.cs | Removes legacy compositing modes. |
| src/MiniPdf/Drawing/Drawing2D/CombineMode.cs | Removes legacy region-combination modes. |
| src/MiniPdf/Drawing/Drawing2D/Blend.cs | Removes legacy gradient-blend model. |
| src/MiniPdf/Drawing/Codecs/JpegCodec.cs | Removes legacy JPEG codec adapter. |
| src/MiniPdf/Drawing/Codecs/Jpeg/ScanComponent.cs | Removes legacy JPEG scan-component model. |
| src/MiniPdf/Drawing/Codecs/Jpeg/FrameComponent.cs | Removes legacy JPEG frame-component model. |
| src/MiniPdf/Drawing/Codecs/Jpeg/ColorConverter.cs | Removes legacy JPEG color conversion. |
| src/MiniPdf/Drawing/Codecs/IImageCodec.cs | Removes legacy image-codec interface. |
Review effort: Balanced
Reuse the existing CJK font selection policy and report substitution rather than losing OLE previews when an exact family is unavailable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace incorporated Drawing code with owned managed metafile rendering. Preserve the existing CJK fallback policy after Ubuntu CI verification.
Summary
Replace the incorporated DRIT.Drawing implementation with owned managed metafile rendering and remove its 676 source/resource files and package references.
Public conversion signatures are unchanged. No third-party source, font binaries, test documents, generated PDFs, reports or NuGet packages are added to this PR.
Validation
dotnet test .\tests\MiniPdf.Tests\MiniPdf.Tests.csproj --configuration Release --framework net9.0 --no-restore --verbosity minimal -p:WarningLevel=0— passed: 641; failed: 0; skipped: 1. Re-run immediately before commit. The existing skip requires the generated classic XLSX corpus.dotnet pack .\src\MiniPdf\MiniPdf.csproj --configuration Release --no-restore --output .\artifacts\drit-replacement-regression\package --verbosity minimal -p:WarningLevel=0— passed for net462, netstandard2.0, net6.0, net8.0 and net9.0. All five packaged DLLs have noMiniSoftware.Drawingnamespace symbols; the old DRIT package notice entries are absent. Net9 runtime Drawing type count is zero.git diff --cached --check— passed.Full visual comparisons use Microsoft 365 primary references and LibreOffice auxiliary references, with all candidates and comparison images regenerated:
.\scripts\Run-DotNet-VisualBenchmark.ps1 -Suite issue -Format docx -SkipCandidate -SkipReference -ArtifactRoot 'artifacts\drit-replacement-regression\baseline\docx'— baseline report completed; exit 1 for 6 pre-existing cases below 0.95..\scripts\Run-DotNet-VisualBenchmark.ps1 -Suite issue -Format xlsx -SkipCandidate -SkipReference -ArtifactRoot 'artifacts\drit-replacement-regression\baseline\xlsx'— baseline report completed; exit 1 for 17 pre-existing cases below 0.95..\scripts\Run-DotNet-VisualBenchmark.ps1 -Suite issue -Format docx -SkipBuild -SkipReference -ArtifactRoot 'artifacts\drit-replacement-regression\final\docx'— final report completed, 28/28 converted, all references present; exit 1 for the same 6 pre-existing cases below 0.95..\scripts\Run-DotNet-VisualBenchmark.ps1 -Suite issue -Format xlsx -SkipBuild -SkipReference -ArtifactRoot 'artifacts\drit-replacement-regression\final\xlsx'— final report completed, 21/21 converted, all references present; exit 1 for the same 17 pre-existing cases below 0.95.Before/after regression gate: 49 cases, zero new invalid/missing PDFs, zero unexpected candidate page-count changes, zero missing referenced comparison images and zero
visual_avgdecreases greater than 0.002. The absolute 0.95 threshold was not lowered and is not claimed to pass.Large evidence is retained locally under
artifacts/drit-replacement-regression/, not committed. Three Word reference-generation COM disconnects were logged, but all 28 resulting PDFs were present and parsed successfully. CLI builds also report the pre-existing NU1903 warning for Microsoft.DotNet.ILCompiler 9.0.13; dependency upgrades are outside this rendering replacement.The first Ubuntu CI run exposed an unavailable SimSun family in the real XLSX OLE-preview test. The font resolver now reuses the repository's existing CJK fallback selection and reports the substitution explicitly, instead of dropping the preview or skipping the test. The full local suite was re-run after this correction: 641 passed, 1 existing skip.
Checklist
No new documents or binary assets are submitted. README files are unchanged; compatibility details are documented above. Local benchmark outputs are deliberately excluded from the push.