Repository navigation
fix(docx): grow a Word list's item where its face holds its marker - #958
Merged
Merged
Conversation
- DocxGrownLines reads a Word list's item with its marker, a run of its first line in its level's properties over its paragraph mark's, where the level writes letters its face holds: not a number, a picture, an overridden level or one a numbering style defines. - DocxFontTable.ShippedLines.holds asks a shipped face's character map for a text's letters; Word sets a letter its face lacks in a face of its own, whose line is taller. - Tests: an item grows with a marker in its text's face and size, in its mark's face, not with a larger one or one its face lacks; the lowering tests keep their items exact by a marker Lato and Spectral lack.
DemchaAV
marked this pull request as draft
October 25, 2026 09:03
- The CHANGELOG said OrangeOps', SerifHeadline's and TealPulse's least lines stood lower because the space above did not take their gap, and within the quarter point a least line is held to. The export reckons them within 0.06pt of the page, and Word and LibreOffice stand them about a quarter point lower, the lowest 0.42pt; as exact lines the reckoning was as far off the other way. The entries now say so. - DocxGrownLines.levelOf's Javadoc names every level it does not read.
… stated DocxGrownLines asked a list marker's letters of the Normal style's face without checking that the document states one. A run naming no face is read only when it does, so the call could not be reached without it; the check now says so where the face is asked.
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
A line is written at a least height (
w:lineRule="atLeast"), which Word grows when a reader makes the text larger, where it is at least as tall as its runs' own line (#955, #956, #957). A Word list's item, whose marker Word draws, was never read:DocxGrownLines.reachOfgave any paragraph withw:numPrno reach, so every item kept an exact line. WithNormaltwo points larger, Word cut the tops off their letters on screen. The corpus has 140 such items, all in CV cells, 96 of them on lines at least as tall as their faces' own.Measured in Word 16 and LibreOffice 24.2 (CI's build), on items of 8pt Lato and 9pt Fira Sans Condensed beside the same paragraph unnumbered, exact and least, at the face's own line and 1.25pt taller:
So an item whose marker is set in a face that holds it stands its text where an unnumbered paragraph would.
What changed
DocxGrownLines.reachOfreads a Word list's item with its marker (withItsMarker): a run of the first line in the level'srProver the paragraph mark's (Run.over), its letters the level's text. No reach where:w:lvlOverride) or links a numbering style (numStyleLink,styleLink);%in its text) or a picture bullet;DocxFontTable.ShippedLines.holdsasks a shipped face's Unicode character map whether it holds every letter of a text. The map is read with fontbox from the face's own file, the one the package embeds, the first time a marker asks it, and the file is let go then: 0.4 to 3ms a face (Barlow, Lato, Fira Sans Condensed), once an export.document::getNumbering), since the part is written as lists come, and keep each level read: an item's lines are read several times.Line heightrow, the CHANGELOG, the older least-line entry's list clause, and the picture lines' entry, whoseTealPulsesentence named a cause the export's reckoning does not bear out.Verification
DocxGrownLinesTest,aWordListsItemIsReadWithItsMarkerInItsLevelsFaceOverItsMarks: a bullet in the text's face and size, or in the mark's, reaches as the unnumbered paragraph and may grow; a 20pt bullet reaches 20pt Lato's ascent and may not; a white bullet in a Barlow mark has no reach, in a Lato level over that mark it does.aWordListsMarkerNotSetInItsOwnFaceIsNotRead: an arrowhead Lato lacks, a level's number, a decimal level, a bold face not shipped, a raise, a picture bullet, a depth the list does not define, an override, a numbering style linked either way, a list the part does not hold and no numbering part give no reach.DocxGrownLinesExportTest: a Word list's item is written least with no position; one whose marker Lato lacks stays exact.DocxComposedListTest: items composed in a cell are least, as in the flow; a wrapped item's gap comes off the space above it and nothing is lowered, while an exact one is lowered as before.DocxListItemLowerTest,DocxLayerColumnsTest: the lowering of an item Word sets high is pinned on exact items, their marker one Lato and Spectral lack; their numbers are unchanged.anItemWhoseFaceHoldsItsBulletIsALeastLineAndNotLowered: the same item under Word's bullet is least, its space above as written, the paragraph under it taking nothing back.MidnightNavy2,NavySidebar3);SlateOrange's four set high are lowered a fifth of a point by the space under them, as a line set high by under half a point is. The report changes only in theirline heightcounts.restyle-body-through-normal:SerifHeadlinepasses;scripts/docx-visual/word-fidelity.ps1): BUILD SUCCESS. On the eight documents:OrangeOps' duties (17 lines in Word, 16 in LibreOffice) andSerifHeadline's items (8 and 7), 8pt Lato on lines of 9.7 to 10.15pt in a table's cell, stand about 0.25pt lower in both editors, the lowest 0.42pt low in Word. The export reckons their least line within 0.06pt of the page (printed fromletTheLinesGrowin a probe run), and Word and LibreOffice stand it about a quarter point lower. As exact lines the export reckoned them as much high, and they stood nearer the page, from 0.35pt high to 0.18pt low: the four-fifths seat of an exact line made up for the reckoning. The quarter-point check on a least line reads the same reckoning, so it does not hold these lines; each stands within half a point.TealPulse's duties, least since fix(docx): grow a line holding a picture where the picture stays within its text #957, are the same case (reckoned 0.04pt off, 0.29pt low in Word); that entry's wording is corrected here too.NavySidebar's,TerracottaRail's andProfessionalSidebar's items stand nearer../mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 823, render-pdf 339, render-docx 2182, testing 5, render-pptx 142, templates 127, qa 1830../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests.Lane: shared-engine (render-docx). No public API change. Word list items' line rules change in the file.