You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PDF fidelity (color spaces, functions, shadings, clip edge) and downstream-reported defects (PPTX footer/EMF, Visio theme/splines) - #49
PDF fidelity pass plus fixes for defects reported by a downstream consumer of beta.12.
PDF
CalGray, CalRGB and Lab convert to sRGB (CalRGB previously rendered as DeviceRGB, so documents using it
change color). ICCBased still uses /Alternate or /N; ICC profile application is out of scope.
Separation and DeviceN (including /None and /All) through tint-transform functions; Indexed over any base.
FunctionType 4 (PostScript calculator) and multi-input FunctionType 0, with hard caps on instructions, stack,
nesting and sample tables. DeviceN image conversion is memoized and has a per-image work budget
(pdf-image-tint-budget).
Shading: any non-Pattern color space, stitching /Bounds as hard stops, interpolated mesh function lookup.
Clip fix: a fill edge lying on a rectangle-union clip edge was under-covered (coverage x coverage). Rectangle
clips are now split into disjoint pieces and fills are clipped geometrically. Single-rectangle clips keep the
analytic path.
PPTX
Non-placeholder text boxes honor their own lstStyle (footer date no longer wraps off the slide).
A slide with an EMF/WMF picture now renders the rest of the slide. OnUnsupportedPictureSkipped reports the
skip and StrictUnsupportedPictures restores the throw (pptx-image-metafile). EMF rendering is out of scope.
Visio
Bare THEMEVAL() resolves to the "No Style" values instead of gray (fills, line, text color), the themed Font resolves to the theme minor typeface (Calibri), PolylineTo/NURBSTo/SplineStart/SplineKnot are
flattened, and group children with their own master get their master merged. Non-solid fills are reported
as vsdx-fill-pattern-N.
Tests/Hygiene
Stopwatch assertions in SvgCodecTests and the WaitAsync guards in PdfDocumentTests are replaced with
deterministic counters.
Type of Change
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Documentation update
Code quality improvement
Related Issues
Closes #
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
Code builds successfully and all tests pass: pwsh ./build.ps1 (passed, 0 warnings, 0 errors)
Code produces zero warnings
Code Quality
New code has appropriate XML documentation comments
Static analyzer warnings have been addressed
Quality Checks
Please run the following checks before submitting:
All linters pass: pwsh ./lint.ps1 (exit 0)
Testing
Added unit tests for new functionality
Updated existing tests if behavior changed
All tests follow the AAA (Arrange, Act, Assert) pattern
Test coverage is maintained or improved
Documentation
Updated README.md (if applicable)
Updated docs/ documentation (if applicable)
Added code examples for new features (if applicable)
Updated requirements.yaml (if applicable)
Additional Notes
Local code review and formal review of the affected review sets were run; their findings (including an
unbounded per-pixel DeviceN tint evaluation and an orphan requirement) are fixed in this branch.
Known gaps: EMF/WMF rendering, ICC profile application, Visio quick-style properties and InfiniteLine,
mesh /None transparency, and rectangle-union clips still use coverage products for images and for curved or
very large clips. Thin (0.33 unit) bars show a separate over-ink widening that was not investigated.
Not verified: Visio output was compared visually at low resolution against Visio's reference render; spline
and polyline rows have only synthetic tests; the downstream consumer's slide-not-drawn test was not run.
All test files are synthetic; no customer files are committed.
Remove Stopwatch assertions from SvgCodecTests in favor of an internal
SvgCodec.RenderDiagnostics (work charged, budget rejections, effects
surfaces/pixels allocated) reached via internal LoadWithDiagnostics.
Replace the linear-scan WaitAsync guard with a LinearScanStepCount linear
bound; drop WaitAsync from the int.MaxValue loop tests. Update
requirements, verification and design docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…es keep full ink (M5)
A W* clip made only of several rectangles was a dense mask whose edge coverage
was multiplied into the fill's, losing up to ~40% ink where a fill edge
coincides with the clip edge. Decompose rectangle-union clips into disjoint
pieces and clip fills geometrically to them; add regression tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…slide-number box)
A master's date + slide-number text box is an ordinary non-placeholder shape
whose 12pt size lives only in its own txBody lstStyle. RenderShape passed a
null list style for non-placeholder shapes, so the text fell back to the 18pt
default, wrapped to a second line and ran off the slide bottom.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A slide's own EMF/WMF <p:pic> now raises a distinct 'pptx-image-metafile' feature
and is skipped by default (rest of slide renders); skips are reported via
PptxRenderOptions.OnUnsupportedPictureSkipped and StrictUnsupportedPictures keeps
the previous throw. EMF/WMF rendering remains a known gap.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nor font
The vsdx-document model still said themed values fall back to a neutral
default; describe the No Style StyleSheet and theme minor Latin resolution
added in 6276205 and bdace6a.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d resolve group-child masters
Resolve the previously skipped curve geometry rows into line segments
(clamped rational B-spline sampled with de Boor), honoring xType/yType
and degree, with hard caps on control points (1024), degree (25) and
flattened segments (4096). Unevaluable splines degrade to a polyline and
report vsdx-geometry-spline-approximated; malformed or over-cap rows are
skipped and reported.
A group child with its own Master reference and no MasterShape match now
resolves against that master, so stencil shapes nested in groups (for
example a pump symbol) inherit their geometry and line weight.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tern-N
A gradient/hatch FillPattern (above 1) is still drawn solid with the
foreground color, but is now reported through the existing
UnsupportedFeatureHandler channel with a distinct token instead of
degrading silently. The unresolved themed-color message now names both
the theme and the No Style fallback. No public API changes; geometry
rows still unsupported or approximated were already reported with the
distinct vsdx-geometry-row-<Type> and vsdx-geometry-spline-approximated
tokens.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Report orphan SplineStart rows, validate NURBSTo and PolylineTo cells before
appending geometry, and skip malformed rows atomically with a diagnostic.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
For a mesh with /Function, the vertices' parameter is interpolated first, but this lookup blends already-converted 8-bit Rgba32 entries. With a nonlinear color space (for example, CalGray with a valid low /Gamma near the dark end), averaging the two converted colors can differ substantially from converting the function's interpolated components at that parameter. Retain function outputs in the lookup and convert after interpolation, or evaluate the function at the pixel parameter, so color-space conversion occurs in the correct order.
The added claim that the charge covers every allocated surface is not true for filters: ComputeEffectsPipelineWorkUnits charges primitiveCount × regionArea for a filter, but the pipeline also allocates its initial content surface. For a single feFlood, diagnostics count two region-sized surfaces while only one area's work is charged; repeatedly applying it can allocate about twice the surfaces implied by the 50-million-unit cumulative bound. Include one content-buffer unit when a filter applies (without changing the separate per-primitive cost), and adjust the budget/diagnostics tests accordingly.
When NURBSTo or PolylineTo appears before any MoveTo, its new switch arm skips the row without calling ReportUnsupported (the analogous SplineKnot arm reports orphan rows). This hides missing geometry from the unsupported-feature handler and strict mode. Report vsdx-geometry-row-NURBSTo or vsdx-geometry-row-PolylineTo from the respective no-open-subpath branches, and cover both cases with regression tests.
- SVG: filter work charge includes the content buffer (and SourceAlpha) without counting toward the primitive cap
- Vsdx: report subpath-continuing rows that appear before any MoveTo
- Tests, docs and reqstream updated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addressed the two review-body findings in ac1d521: (1) SVG filters are now charged one content-buffer unit (plus one for a shared SourceAlpha buffer when used) in the per-filter and cumulative budgets, without counting toward the primitive cap; budget and diagnostics tests updated. (2) Visio rows that need an open subpath (NURBSTo, PolylineTo, LineTo, RelLineTo, ArcTo, EllipticalArcTo, RelCubBezTo, RelQuadBezTo, SplineStart) are now reported as vsdx-geometry-row-{Type} when they appear before any MoveTo, with a regression theory covering all nine.
Media type tokens are case-insensitive, but IsMetafileContentType compares them with case-sensitive patterns. An OPC part declared as IMAGE/X-EMF therefore raises pptx-image-format instead of pptx-image-metafile, so the new default Render path throws instead of skipping that picture. Compare the four metafile media types with StringComparison.OrdinalIgnoreCase and include a mixed-case content type in the regression test.
Reject invalid spline degree instead of defaulting to 3
BeginSpline validates X/Y/A/B/C but reads the required degree cell D with GetDouble("D", 3d), which substitutes 3 when D is missing, malformed, or non-finite. Such a SplineStart can therefore draw an unintended curve without reporting vsdx-geometry-row-SplineStart, contrary to the new malformed-row handling. Require a finite D before creating the accumulator, keep clamping valid out-of-range degrees, and add a regression case for an invalid D.
Addressed the two review-body findings in c324e4f: (1) PPTX media types are now normalized (parameters dropped, trimmed, case-insensitive) before the metafile and raster decoder checks, so IMAGE/X-EMF takes the metafile skip path; mixed-case regression cases added. (2) Visio SplineStart now requires a finite degree cell D; a missing or non-finite D is reported as vsdx-geometry-row-SplineStart and skipped, while valid degrees are still clamped. Regression test added.
A malformed stitching function can reach this new hard-stop logic because ResolveStitchingFunction only checks the length of /Bounds. For example, duplicate or out-of-order bounds can make a subfunction unreachable, while a non-finite bound is dropped here but still used by Evaluate to choose a subfunction. The renderer can silently paint incorrect colors instead of rejecting the malformed function. Validate finite, strictly increasing bounds inside a finite, increasing /Domain when resolving the function.
Re "Validate stitching bounds before rendering malformed functions": fixed in 93a627e. Type 3 stitching functions now reject a non-finite or reversed /Domain, non-finite /Bounds, decreasing /Bounds, and bounds outside /Domain with InvalidDataException. Equal consecutive bounds remain accepted (used for hard color stops). Tests added for each case.
/Encode is checked for length but not for finite values. An overflowing PDF number can decode as infinity; StitchingFunction.Evaluate then passes a non-finite remapped input to its selected branch, potentially yielding invalid colors instead of rejecting the malformed function. Require every encode value to be finite, as the multi-input sampled-function parser already does.
feDropShadow still costs just one unit here, but ApplyFeDropShadow builds its own full-size alpha, blur, offset, flood, composite, and cropped output surfaces. The new per-filter and cumulative charges therefore undercount repeated drop shadows by several region-sized allocations, so documents can do substantially more work than the limits allow. Give this compound primitive a weighted charge based on its actual work and add a budget regression test; its internal scratch surfaces are distinct from the shared SourceAlpha input checked by FilterUsesSourceAlpha.
…ted Markdown (#148)
* Sync DEMA Agents files (Agents 5fb794e)
Copy the updated agent definitions, canvasnet skill, and shared standards, add the C++ standards, and merge the template-level AGENTS.md changes (C++ standards rows, LintMark configuration and tooling mentions) while keeping the CanvasNet-specific sections.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Switch Markdown linting to LintMark
Add the demaconsulting.lintmark 0.1.0-beta.2 tool and .lintmark.yaml (template #49, with the CanvasNet ignores carried over from .markdownlint-cli2.yaml), run it from lint.ps1 and fix.ps1 instead of markdownlint-cli2, drop the node/npm VersionMark captures and the Node.js setup of the quality job, and capture the LintMark version there. package.json keeps only the pinned mermaid and mermaid-cli used by the tools/visual-diff developer scripts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move inline spell-check directives into TextLint overrides
Adopt the template #45 .textlint.yaml guidance (where an exception belongs, overrides), add lintmark to the words, and replace the inline cspell directives of the seven Mermaid link-check test files, the StateModel verification design, the PngSuite tests, and the two fuzz random tests with overrides scoped to exactly those files (the fuzz hex literals are already covered by the hexadecimal-literal pattern). Narrow the Mermaid math-vector and entity-marker patterns that were global to the upstream vector files that need them, and scope the C++ standard terms to the C++ standards.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Keep the LintMark and TextLint configuration comments stable under yamlfix
Reword the comments that yamlfix re-indented (a nested '#' in the fragment-markdown note and the override examples) and wrap the AGENTS.md technologies line to the 120-column LintMark limit.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Exclude build output and test results from LintMark
The test projects copy their fixture READMEs into bin/, so a local lint after a build reported them; ignore bin/, obj/, and TestResults/ as .textlint.yaml already does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Format Markdown with LintMark
Apply 'dotnet lintmark --fix' repository-wide: asterisk emphasis, compact tables with blank lines around them, dash bullets, and paragraphs re-wrapped to the 120-column limit. No wording changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rewrite the over-wide tables of the user guides
Turn the tables whose rows exceed the 120-column LintMark limit into definition lists ('**term**: text', '**key** (default value): meaning', or a term with sub-bullets for a matrix), with a lead-in where the table header carried meaning; shorten or split rows, or move a detail into the sentence after the table, where only a few rows were a little too wide. Update the sentences that pointed at a converted table, and drop the markdownlint MD013 comments that LintMark no longer needs (it exempts tables from the line length).
The help-card parity tests (HelpTopicsTests) now read the definition lists of the Mermaid guide's syntax, relation, tag, setting, and code sections and the tool guide's Flatten Reference and File Access Reference sections instead of their tables; the comparison with the cards is unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rewrite the over-wide tables of the design documents
Turn the tables whose rows exceed the 120-column LintMark limit into definition lists: each external interface with its direction and format in parentheses, each limit or setting with its default, and a term with labeled sub-bullets where a table had several descriptive columns; add a lead-in where the header carried meaning, and update the sentences that pointed at a converted table. Where only a row or two were too wide, shorten them, split them, or move a detail into a note or sentence after the table (canvas-net.md, image-pipeline.md, scad-parser.md, scad-evaluator.md, discovery-commands.md).
Also drop the markdownlint MD013 comments that LintMark no longer needs, and re-wrap the three paragraphs LintMark could not wrap (a code span too long for one line in title-builder.md, and irregular continuation lines in legend-builder.md and scale-resolver.md). No wording changes beyond those.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Re-wrap two verification paragraphs that LintMark could not wrap
Collapse the stray runs of spaces and the irregular continuation indentation in time-calendar.md and sandboxed-file-resolver.md so LintMark can wrap them to 120 columns; whitespace only.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rewrite the over-wide tables of the test fixture READMEs
Turn the fixture tables whose rows exceed the 120-column LintMark limit (long file names and upstream URLs) into definition lists, keeping every file name, URL, and description, and drop the markdownlint MD013 comments that LintMark no longer needs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
PDF fidelity pass plus fixes for defects reported by a downstream consumer of beta.12.
PDF
change color). ICCBased still uses
/Alternateor/N; ICC profile application is out of scope./Noneand/All) through tint-transform functions; Indexed over any base.nesting and sample tables. DeviceN image conversion is memoized and has a per-image work budget
(
pdf-image-tint-budget)./Boundsas hard stops, interpolated mesh function lookup.clips are now split into disjoint pieces and fills are clipped geometrically. Single-rectangle clips keep the
analytic path.
PPTX
lstStyle(footer date no longer wraps off the slide).OnUnsupportedPictureSkippedreports theskip and
StrictUnsupportedPicturesrestores the throw (pptx-image-metafile). EMF rendering is out of scope.Visio
THEMEVAL()resolves to the "No Style" values instead of gray (fills, line, text color), the themedFontresolves to the theme minor typeface (Calibri),PolylineTo/NURBSTo/SplineStart/SplineKnotareflattened, and group children with their own master get their master merged. Non-solid fills are reported
as
vsdx-fill-pattern-N.Tests/Hygiene
SvgCodecTestsand theWaitAsyncguards inPdfDocumentTestsare replaced withdeterministic counters.
Type of Change
Related Issues
Closes #
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
pwsh ./build.ps1(passed, 0 warnings, 0 errors)Code Quality
Quality Checks
Please run the following checks before submitting:
pwsh ./lint.ps1(exit 0)Testing
Documentation
Additional Notes
Local code review and formal review of the affected review sets were run; their findings (including an
unbounded per-pixel DeviceN tint evaluation and an orphan requirement) are fixed in this branch.
Known gaps: EMF/WMF rendering, ICC profile application, Visio quick-style properties and
InfiniteLine,mesh
/Nonetransparency, and rectangle-union clips still use coverage products for images and for curved orvery large clips. Thin (0.33 unit) bars show a separate over-ink widening that was not investigated.
Not verified: Visio output was compared visually at low resolution against Visio's reference render; spline
and polyline rows have only synthetic tests; the downstream consumer's slide-not-drawn test was not run.
All test files are synthetic; no customer files are committed.
Supersedes PDF fidelity (color spaces, functions, shadings, clip edge) and downstream-reported defects (PPTX footer/EMF, Visio theme/splines) #48, which GitHub closed when its head branch was renamed to remove a product name. Review findings raised there are already addressed in this branch.