Repository navigation
test(qa): measure a DOCX fidelity line from its first letter, not from a space before it - #815
Merged
Merged
Conversation
…m a space before it
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
The DOCX fidelity gate reads each editor's PDF with
PdfLines. A line takes the baseline of the glyph that opens it, and a space opened one.Word writes a space for an empty paragraph. When one is drawn just before a line of text beside it, on a baseline a few points off, it opens that line and gives it the space's baseline. The text has not moved, but the gate measures it as moved. In
SlateOrangethe job titles measured −3.5pt that way, though Word sets them where the page does. An empty table cell beside a label made the same label measure 3.5pt high inSubscriptionInvoiceonce the cell's paragraph was a hairline.PdfLinesand itsLinesay a line stands where its first letter does; the code did not.What changed
PdfLines: a space opens no line. A blank glyph on another line ends the line before it and starts nothing. Within a line it is read as before, its letters out of the key.Baselines.
word-windowsandword-windows-linesare re-measured with it:SlateOrangeVioletGridOrangeOpsSerifHeadlineandSubscriptionInvoicemove by hundredths. No other row changes. LibreOffice re-measures byte for byte: it writes no space for an empty paragraph.CHANGELOG.md. A Tests entry.Verification
DocxFidelityGateTest.aLineStandsWhereItsFirstLetterDoesNotWhereASpaceBeforeItDoes. A PDFBox page draws a space, then "Label" 4pt lower beside it. The line keys "label", at the label's baseline and left edge. With the rule taken out, the test fails: the line takes the space's baseline.2.5-devmakes; only the reading of them moved../mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -amgives BUILD SUCCESS. qa runs 1814 tests.Known limits
Lane: test (qa fidelity gate).