Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ follow semantic versioning; release dates are ISO 8601.

### Public API

- **What follows a line holding only a drawn shape stands where the page sets it in DOCX.**
A shape is written as a picture a transparent frame larger than its ink on every side, and
Word makes a line of pictures and no text, grown to them, as tall as the pictures, frame
included.
`MonogramSidebar`'s contact icons stood in lines half a point taller than the page's, and
each contact under them half a point lower than the one above. The frame is now taken from
the space above the line and above what follows. `MonogramSidebar`'s lines more than 2pt off
fall from 17 to none in Word, its median from 0.79 to 0.29pt.
- **A panel bled to the paper's edge stands where the page puts it in Word.** A panel's
table indent places its text, and an indent of 0 was not written. A panel whose negative
margin takes its fill to the paper's edge and whose padding takes its text back to the
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/docx-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ it cannot work out for itself:

| What | Where it lands |
|---|---|
| Line height | `w:spacing w:lineRule="exact"` on every paragraph, cells and list items included — the height the engine measured, not a multiple Word would measure again against a substituted font. Word has one height for a paragraph's lines: it is the tallest line's text, or, where the page sets lines of different heights further apart than that, the page's mean distance between their baselines, with what a paragraph on one page then falls short of the page owed below it (not yet a list item's, or text set over the flow). In a paragraph of more than one line on one page, the spaces a `bulletOffset` sets before a line, written as an indent, do not count towards that line's text. A paragraph of lines as tall as their text, on one page, opening a table cell takes the gap above its first line from the cell's top padding, no more than steps its lines the page's distance apart — not in a row beside a merged cell or a cell opening with a table, whose margin Word would set the whole row at, nor in a panel. One with no room above it for the gap (opening a column, or a cell padded less) shares the gaps out over all its lines, so its lines stand a little closer than on the page. A paragraph the layout did not measure — one in a composed table cell — is left to the editor, and a line holding a picture above its text is written "at least" that height — except a paragraph of one line of text with room above for its pictures' reach, held exact at the page's height (see "Inline pictures"); in both the paragraph mark is set in the text's size and face, since the mark counts towards the last line's height. A line holding pictures and no text, where they fill the page's line, has its mark and its pictures' runs set at a point instead, so Word makes the line as tall as the pictures and no taller: in the paragraph's own size the mark's depth went under the picture (measured: `SlateOrange`'s skills, a 12.4pt icon beside each label, stood 0.2pt taller each in Word). A smaller picture in a line the page sets at its font's height keeps its mark, and so does a line holding a letter, a break, a tab, a field or a link's text. Both editors stand the baseline of an exact line four fifths of the way down it whatever the face (measured in Word and LibreOffice), and the page sets it the face's ascent below the line's top: where the two are half a point or more apart — a face with a deep descent, as Spectral's is — a paragraph's text is raised or lowered to the page's baseline by `w:position`, matched at its middle line; a list item's and a table text cell's are not yet. A picture among such text moves with it in Word; LibreOffice keeps a picture on its own baseline, where it stood before. Lines a container stacks tighter than their face — a title's lines a pitch apart — each end halfway between their letters and the next line's, since Word draws an exact line's text on screen only inside the line, and the last layer of a shape container, where its line runs past the foot, ends at the foot or below its letters |
| Line height | `w:spacing w:lineRule="exact"` on every paragraph, cells and list items included — the height the engine measured, not a multiple Word would measure again against a substituted font. Word has one height for a paragraph's lines: it is the tallest line's text, or, where the page sets lines of different heights further apart than that, the page's mean distance between their baselines, with what a paragraph on one page then falls short of the page owed below it (not yet a list item's, or text set over the flow). In a paragraph of more than one line on one page, the spaces a `bulletOffset` sets before a line, written as an indent, do not count towards that line's text. A paragraph of lines as tall as their text, on one page, opening a table cell takes the gap above its first line from the cell's top padding, no more than steps its lines the page's distance apart — not in a row beside a merged cell or a cell opening with a table, whose margin Word would set the whole row at, nor in a panel. One with no room above it for the gap (opening a column, or a cell padded less) shares the gaps out over all its lines, so its lines stand a little closer than on the page. A paragraph the layout did not measure — one in a composed table cell — is left to the editor, and a line holding a picture above its text is written "at least" that height — except a paragraph of one line of text with room above for its pictures' reach, held exact at the page's height (see "Inline pictures"); in both the paragraph mark is set in the text's size and face, since the mark counts towards the last line's height. A line holding pictures and no text, where they fill the page's line, has its mark and its pictures' runs set at a point instead, so Word makes the line as tall as the pictures and no taller: in the paragraph's own size the mark's depth went under the picture (measured: `SlateOrange`'s skills, a 12.4pt icon beside each label, stood 0.2pt taller each in Word). A smaller picture in a line the page sets at its font's height keeps its mark, and so does a line holding a letter, a break, a tab, a field or a link's text. A paragraph's own line of drawn shapes and no text written at least their reach, which Word grows to the pictures and the transparent frame each keeps around its ink, has that frame taken from the space above the line and above what follows, where it passes the height written: the ink stands where the page draws it, and what follows where the page sets it. Both editors stand the baseline of an exact line four fifths of the way down it whatever the face (measured in Word and LibreOffice), and the page sets it the face's ascent below the line's top: where the two are half a point or more apart — a face with a deep descent, as Spectral's is — a paragraph's text is raised or lowered to the page's baseline by `w:position`, matched at its middle line; a list item's and a table text cell's are not yet. A picture among such text moves with it in Word; LibreOffice keeps a picture on its own baseline, where it stood before. Lines a container stacks tighter than their face — a title's lines a pitch apart — each end halfway between their letters and the next line's, since Word draws an exact line's text on screen only inside the line, and the last layer of a shape container, where its line runs past the foot, ends at the foot or below its letters |
| Table columns | the resolved cell widths as `w:gridCol`, with `w:tblLayout` fixed so Word does not re-fit them |
| Row columns | where the layout placed each child, with the row's gap and padding folded into the neighbouring column and taken back out as that cell's margin. A column sized to its content (`DocumentRowColumn.auto()`) gets a point more, taken from the row's weight columns so the row keeps its width, for the reason a table's does: the editor's substitute font would wrap it — a table of contents' labels broke mid-word ("Intr" / "o") in LibreOffice without it. A row with no auto column, no weight column, or no stated columns (weights, an even split) is written as placed |

Expand Down
40 changes: 20 additions & 20 deletions qa/src/test/resources/docx-fidelity/libreoffice-linux-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -815,26 +815,26 @@ cv-modern_professional 1:ec9d3622395e -7.77 workeligibility:eligibletoworkin
cv-modern_professional 1:dd20ae01c3cf -7.77 opensource:maintainerofgraphcomp
cv-modern_professional 1:33c35e9d236d -7.77 speaking:jvmsummit2024,devoxxuk2
cv-monogram_sidebar 0:093e7d5fdbaa 2.70 contact
cv-monogram_sidebar 0:89674e6f130e 3.35 +442055551000
cv-monogram_sidebar 0:e0f850305ded 3.87 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 4.39 london,uk
cv-monogram_sidebar 0:84308bea4540 4.91 linkedin
cv-monogram_sidebar 0:c0b0109d9439 5.43 github
cv-monogram_sidebar 0:68bf0109c6f8 5.40 education
cv-monogram_sidebar 0:0ad1957d6bab 5.50 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 5.53 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 5.54 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 5.51 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 5.54 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 5.55 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 5.52 skills
cv-monogram_sidebar 0:d5680c2e2769 5.67 java21
cv-monogram_sidebar 0:19a67c2a5369 5.69 kotlin
cv-monogram_sidebar 0:95bfacd3a466 5.71 groovy
cv-monogram_sidebar 0:11a4a60b518b 5.73 python
cv-monogram_sidebar 0:4ec7c53222c8 5.75 sql
cv-monogram_sidebar 0:57529f20c3ad 5.77 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 5.79 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:89674e6f130e 2.85 +442055551000
cv-monogram_sidebar 0:e0f850305ded 2.87 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 2.89 london,uk
cv-monogram_sidebar 0:84308bea4540 2.91 linkedin
cv-monogram_sidebar 0:c0b0109d9439 2.93 github
cv-monogram_sidebar 0:68bf0109c6f8 2.90 education
cv-monogram_sidebar 0:0ad1957d6bab 3.00 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 3.03 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 3.04 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 3.01 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 3.04 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 3.05 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 3.02 skills
cv-monogram_sidebar 0:d5680c2e2769 3.17 java21
cv-monogram_sidebar 0:19a67c2a5369 3.19 kotlin
cv-monogram_sidebar 0:95bfacd3a466 3.21 groovy
cv-monogram_sidebar 0:11a4a60b518b 3.23 python
cv-monogram_sidebar 0:4ec7c53222c8 3.25 sql
cv-monogram_sidebar 0:57529f20c3ad 3.27 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 3.29 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:136c67657614 2.57 jordan
cv-monogram_sidebar 0:8ba35ebe3d5c 2.58 rivera
cv-monogram_sidebar 0:2d58f0cadc2d 2.76 platformengineer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cv-midnight_navy 1 1 86 80 2.72 3.24 76
cv-minimal_underlined 2 2 59 57 0.69 13.40 9
cv-mint_editorial 2 2 59 59 0.27 0.60 0
cv-modern_professional 2 2 61 59 0.12 0.59 5
cv-monogram_sidebar 1 1 53 50 3.57 5.69 50
cv-monogram_sidebar 1 1 53 50 2.90 3.57 50
cv-navy_sidebar 1 1 71 71 2.81 3.03 71
cv-nordic_clean 1 1 63 58 0.22 0.52 0
cv-orange_ops 1 1 108 99 0.32 0.53 0
Expand Down
40 changes: 20 additions & 20 deletions qa/src/test/resources/docx-fidelity/libreoffice-windows-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -814,26 +814,26 @@ cv-modern_professional 1:ec9d3622395e -7.77 workeligibility:eligibletoworkin
cv-modern_professional 1:dd20ae01c3cf -7.77 opensource:maintainerofgraphcomp
cv-modern_professional 1:33c35e9d236d -7.77 speaking:jvmsummit2024,devoxxuk2
cv-monogram_sidebar 0:093e7d5fdbaa 2.70 contact
cv-monogram_sidebar 0:89674e6f130e 3.35 +442055551000
cv-monogram_sidebar 0:e0f850305ded 3.87 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 4.39 london,uk
cv-monogram_sidebar 0:84308bea4540 4.91 linkedin
cv-monogram_sidebar 0:c0b0109d9439 5.43 github
cv-monogram_sidebar 0:68bf0109c6f8 5.40 education
cv-monogram_sidebar 0:0ad1957d6bab 5.50 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 5.53 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 5.54 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 5.51 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 5.54 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 5.55 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 5.52 skills
cv-monogram_sidebar 0:d5680c2e2769 5.67 java21
cv-monogram_sidebar 0:19a67c2a5369 5.69 kotlin
cv-monogram_sidebar 0:95bfacd3a466 5.71 groovy
cv-monogram_sidebar 0:11a4a60b518b 5.73 python
cv-monogram_sidebar 0:4ec7c53222c8 5.75 sql
cv-monogram_sidebar 0:57529f20c3ad 5.77 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 5.79 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:89674e6f130e 2.85 +442055551000
cv-monogram_sidebar 0:e0f850305ded 2.87 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 2.89 london,uk
cv-monogram_sidebar 0:84308bea4540 2.91 linkedin
cv-monogram_sidebar 0:c0b0109d9439 2.93 github
cv-monogram_sidebar 0:68bf0109c6f8 2.90 education
cv-monogram_sidebar 0:0ad1957d6bab 3.00 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 3.03 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 3.04 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 3.01 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 3.04 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 3.05 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 3.02 skills
cv-monogram_sidebar 0:d5680c2e2769 3.17 java21
cv-monogram_sidebar 0:19a67c2a5369 3.19 kotlin
cv-monogram_sidebar 0:95bfacd3a466 3.21 groovy
cv-monogram_sidebar 0:11a4a60b518b 3.23 python
cv-monogram_sidebar 0:4ec7c53222c8 3.25 sql
cv-monogram_sidebar 0:57529f20c3ad 3.27 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 3.29 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:136c67657614 2.57 jordan
cv-monogram_sidebar 0:8ba35ebe3d5c 2.58 rivera
cv-monogram_sidebar 0:2d58f0cadc2d 2.76 platformengineer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cv-midnight_navy 1 1 86 80 2.72 3.24 76
cv-minimal_underlined 2 2 59 57 0.69 13.40 9
cv-mint_editorial 2 2 59 59 0.27 0.60 0
cv-modern_professional 2 2 61 59 0.12 0.59 5
cv-monogram_sidebar 1 1 53 50 3.57 5.69 50
cv-monogram_sidebar 1 1 53 50 2.90 3.57 50
cv-navy_sidebar 1 1 71 71 2.81 3.03 71
cv-nordic_clean 1 1 63 58 0.20 0.57 0
cv-orange_ops 1 2 108 5 77.92 77.92 5
Expand Down
40 changes: 20 additions & 20 deletions qa/src/test/resources/docx-fidelity/word-windows-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -816,26 +816,26 @@ cv-modern_professional 1:ec9d3622395e -7.77 workeligibility:eligibletoworkin
cv-modern_professional 1:dd20ae01c3cf -7.74 opensource:maintainerofgraphcomp
cv-modern_professional 1:33c35e9d236d -7.69 speaking:jvmsummit2024,devoxxuk2
cv-monogram_sidebar 0:093e7d5fdbaa 0.00 contact
cv-monogram_sidebar 0:89674e6f130e 0.63 +442055551000
cv-monogram_sidebar 0:e0f850305ded 1.11 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 1.59 london,uk
cv-monogram_sidebar 0:84308bea4540 2.21 linkedin
cv-monogram_sidebar 0:c0b0109d9439 2.69 github
cv-monogram_sidebar 0:68bf0109c6f8 2.73 education
cv-monogram_sidebar 0:0ad1957d6bab 2.81 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 2.81 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 2.92 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 2.81 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 2.84 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 2.95 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 2.80 skills
cv-monogram_sidebar 0:d5680c2e2769 2.92 java21
cv-monogram_sidebar 0:19a67c2a5369 2.92 kotlin
cv-monogram_sidebar 0:95bfacd3a466 3.04 groovy
cv-monogram_sidebar 0:11a4a60b518b 3.03 python
cv-monogram_sidebar 0:4ec7c53222c8 3.03 sql
cv-monogram_sidebar 0:57529f20c3ad 3.03 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 3.06 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:89674e6f130e 0.15 +442055551000
cv-monogram_sidebar 0:e0f850305ded 0.15 jordan.rivera@example.com
cv-monogram_sidebar 0:fbeea547d99e 0.15 london,uk
cv-monogram_sidebar 0:84308bea4540 0.15 linkedin
cv-monogram_sidebar 0:c0b0109d9439 0.17 github
cv-monogram_sidebar 0:68bf0109c6f8 0.21 education
cv-monogram_sidebar 0:0ad1957d6bab 0.29 msccomputerscience
cv-monogram_sidebar 0:47ce0218bbea 0.29 universityofmanchester
cv-monogram_sidebar 0:3fa772117260 0.40 2019-2021
cv-monogram_sidebar 0:b6749d0b616b 0.29 bscsoftwareengineering
cv-monogram_sidebar 0:89ad9656f393 0.32 imperialcollegelondon
cv-monogram_sidebar 0:30f9262640a0 0.43 2015-2019
cv-monogram_sidebar 0:32c1cf49a2fe 0.40 skills
cv-monogram_sidebar 0:d5680c2e2769 0.40 java21
cv-monogram_sidebar 0:19a67c2a5369 0.52 kotlin
cv-monogram_sidebar 0:95bfacd3a466 0.52 groovy
cv-monogram_sidebar 0:11a4a60b518b 0.51 python
cv-monogram_sidebar 0:4ec7c53222c8 0.51 sql
cv-monogram_sidebar 0:57529f20c3ad 0.51 pdfbox
cv-monogram_sidebar 0:1814aacb6d5a 0.54 apachepoi(docx/xlsx)
cv-monogram_sidebar 0:136c67657614 0.36 jordan
cv-monogram_sidebar 0:8ba35ebe3d5c 0.43 rivera
cv-monogram_sidebar 0:2d58f0cadc2d -0.07 platformengineer
Expand Down
2 changes: 1 addition & 1 deletion qa/src/test/resources/docx-fidelity/word-windows.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cv-midnight_navy 1 1 86 80 0.15 0.58 0
cv-minimal_underlined 2 2 59 59 0.62 0.89 0
cv-mint_editorial 2 2 59 59 0.13 0.31 0
cv-modern_professional 2 2 61 59 0.20 0.77 5
cv-monogram_sidebar 1 1 53 50 0.79 2.95 17
cv-monogram_sidebar 1 1 53 50 0.29 0.79 0
cv-navy_sidebar 1 1 71 69 0.13 0.22 0
cv-nordic_clean 1 1 63 58 0.22 0.61 0
cv-orange_ops 1 1 108 99 0.42 0.71 0
Expand Down
Loading
Loading