Repository navigation
test(qa): hold three body shape containers in the DOCX fidelity corpus - #970
Merged
Merged
Conversation
In the body, the DOCX export draws a shape container's outline as a shape of its size and writes its layers in the flow, held in from the edges of the block the container stands in. Three documents built for that join the synthetic family of the fidelity corpus: a note the page wraps inside a box 220pt wide, a clipped box holding more text than it has room for, and a card its text fills. Their baseline rows record the export as Word 16 and LibreOffice set it today: the note and the clipped text at other words than the page's, past the outline, and the paragraph under each box 12 and 20pt high; the card in place. A change that writes the text inside the outline finds it, moves the paragraph under each box nearer the page and rewrites the rows; the card holds such a change to keep it where it stands. The gate reads lines of text, so it does not see whether the text stays inside the outline, or whether the card grows when text is added to it; the corpus class and the CHANGELOG say so.
…line A shape container's layers are held in from the edges of the block it stands in, so in a container narrower than that block the right edge of their room runs past the outline: wrapped text runs past it, and centred or right-aligned text stands right of where the page sets it. The recipe and the CHANGELOG now say so, the passage on a paragraph's sides under a layer names the exception, and the fixtures' Javadoc names the paragraph above each box and the note's alignment as they are.
…from CI The three documents' rows, as LibreOffice 24.2 on CI's Linux image measured them in this branch's first run (artifact docx-fidelity-40373769086), where the DOCX Fidelity job failed on these three alone, each not yet in the baseline. The other rows stay as recorded.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
In the body, the DOCX export draws a shape container's outline as a shape of its size, where the page draws it, and writes its layers in the flow (each such container carries the report note "its layers are written inline"). The layers are held in by as far as their box stands in from the container's own edges, but from the edges of the block the container stands in, so in a container narrower than that block the right edge of their room runs that much further right, past the outline: text that wraps runs past it, and centred or right-aligned text stands right of where the page sets it. Measured in Word 16 and LibreOffice 24.2, that puts text past the outline and the block under the container over it.
The changes that write a container's text inside its outline need documents built to show it, held by the fidelity gate in both editors: each such change then moves them nearer the page, and no change can move them further unnoticed. No document of the corpus was built for it.
What changed
SyntheticDocxCorpustakes three documents, each a rounded shape container holding text in the body, with a paragraph above and under it; text in Lato, which the export embeds:narrow_container: a note set left in a block centred in a box 220pt wide, not clipped, which the page wraps over three lines inside it;clipped_container: a box 200 × 60pt clipped to its outline, holding 84pt of text, which the page sets from the box's top and cuts at its foot;rounded_card: a card 328 × 80pt, as wide as the page between its margins, its heading and three lines of text filling it, under the container's default clip. The export sets it where the page does today, so it holds a change that writes containers another way to keep it there; it is also the card whose growth an edit needs.word-windowsandlibreoffice-windowstake the three documents' rows alone, from the runs below; the other rows stay as recorded.libreoffice-linuxtakes them from this PR's first CI run (artifactdocx-fidelity-40373769086), where theDOCX Fidelityjob failed on these three alone, each not yet in the baseline. A comment under each file's header says where the rows were measured.-Dgraphcompose.docxFidelity.update=true.CONTRIBUTING.md: a shape container holding text joins the examples of a shapeSyntheticDocxCorpusholds, and a synthetic document's baseline holds it as the editors set it, a defect of the export included;Measured
Lines found of the page's, then the drift of the found lines (pt; negative is high):
synthetic-narrow_containersynthetic-clipped_containersynthetic-rounded_cardAgainst the outline, read off the editors' PDFs (the box filled with the surface colour, and each line's extent), Word and LibreOffice 24.2 alike:
edit-protocol-corpus.ps1,lengthen-a-paragraphanddrawings-follow-text) passes all three: the paragraph it lengthens grows and still ends above the paragraph under it, though past the outline: neither scenario reads the outline's extent against the text.Tests
scripts/docx-visual/word-fidelity.ps1(Word 16.0.20527) → the corpus test inwordmode passes on all 70 documents against the extendedword-windows. Before the rows were added, it failed on the three new documents alone, as not in the baseline.-Dgraphcompose.docxFidelity=libreoffice→ the three new documents pass against the extendedlibreoffice-windows.invoice-obsidianandproposal-indigofail as they do on2.5-dev(named in test(qa): hold the ways a page breaks inside a panel in the DOCX fidelity corpus #965): LibreOffice 26.8 sets each on two pages against the page's one, and this change exports both byte for byte as2.5-devdoes.narrow_container's rows, or withoutclipped_container's: the Word gate fails each as not in the baseline;rounded_card's rows: the LibreOffice gate fails it;rounded_card— the card's four lines and the two of the paragraph under it about 2pt further from the page, with seven presets that hold a shape container's text in the flow (cv-midnight_navy,cv-navy_sidebar,cv-serif_headline,invoice-consulting,invoice-consulting_long,proposal-editorial,proposal-northline); the narrow and the clipped box's paragraphs move nearer the page with it, which the gate lets through, as it should.2.5-dev; the report's notes 1491 → 1499, the eight added all on the three new documents.clean verifyof the reactor as CI runs it → BUILD SUCCESS (core 823, render-pdf 339, render-docx 2293, testing 5, render-pptx 142, templates 127, qa 1846); the four knowledge checks and core javadoc (0 warnings) pass; examples 93.Named, not fixed
CLIP_PATH) with nothing to cut. A clip written as an exact height would hold the clipped box's text inside its outline and keep the card from growing when it is edited: the two need telling apart where the clip is written.Lane: tests (qa) and documentation. No public API change, and no change to the export.