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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ follow semantic versioning; release dates are ISO 8601.

### Public API

- **A `bulletOffset` paragraph's wrapped lines keep the page's distance in DOCX.**
Word sets every line of a paragraph one height apart, and the export wrote the tallest. In
`EditorialProposal`'s bullets the wrapped line carries a prefix of spaces in the paragraph's
taller style, so the page sets it 13.05pt under the first and Word set it 13.8pt under, and
each item stood half a point to a point lower than the one above it. The prefix, written as
an indent, no longer counts towards the line; where the page's mean distance between the
lines is still more than the tallest, it is written instead, and what the paragraph then
falls short of the page is owed below it. In Word, `EditorialProposal`'s lines more than
2pt off fall from 21 to 17, and `NorthlineProposal`'s from 6 to none.
- **A paragraph's `bulletOffset` indents its lines in DOCX as it does on the page.**
The prefix was not written, so `EditorialProposal`'s bullets, whose wrapped lines the page
sets after three spaces, started those lines under the dot in Word, 11.6pt left of 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. 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 with no room above its first line for the gap between lines (one opening a cell or a column) 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 |
| 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
44 changes: 22 additions & 22 deletions qa/src/test/resources/docx-fidelity/libreoffice-linux-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -3742,11 +3742,11 @@ proposal-editorial 1:aaa2a6073d69 -45.38 refinedlogosuite&brandguidelines
proposal-editorial 1:d626f7532564 -45.38 color,typography&designsystem
proposal-editorial 1:018ec557a513 -45.38 websiteuxwireframes
proposal-editorial 1:5ed4970fa285 -45.38 high-fidelitywebsitedesigns
proposal-editorial 1:a579d6d1c12e -45.48 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d -45.13 mobile
proposal-editorial 1:8b712e7e93bf -44.40 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 -44.40 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb -44.40 launchchecklist&trainingsession
proposal-editorial 1:a579d6d1c12e -44.88 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d -45.28 mobile
proposal-editorial 1:8b712e7e93bf -45.40 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 -45.40 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb -45.40 launchchecklist&trainingsession
proposal-editorial 1:94d192b3a326 -46.32 timeline
proposal-editorial 1:02195b8e9896 -45.21 phase
proposal-editorial 1:c51faa148557 -45.21 focus
Expand Down Expand Up @@ -3794,15 +3794,15 @@ proposal-editorial 1:7ffd918ebc4a -44.36 £1,750
proposal-editorial 1:58656319146d -44.34 totalinvestment
proposal-editorial 1:4aadcd9bc785 -44.34 £19,250
proposal-editorial 1:51d2361f4fae -45.78 terms
proposal-editorial 1:99ffab766326 -45.40 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd -44.65 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a -44.47 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db -43.72 majordeliverable.
proposal-editorial 1:ffce6ed7e6e5 -43.54 finalfilesandhandoffdeliveredupo
proposal-editorial 1:566f68df6dd8 -42.79 finalpayment.
proposal-editorial 1:06ebb5670fa8 -43.21 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 -42.46 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb -42.48 fullpaymentisreceived.
proposal-editorial 1:99ffab766326 -44.80 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd -44.80 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a -44.82 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db -44.82 majordeliverable.
proposal-editorial 1:ffce6ed7e6e5 -44.84 finalfilesandhandoffdeliveredupo
proposal-editorial 1:566f68df6dd8 -44.84 finalpayment.
proposal-editorial 1:06ebb5670fa8 -45.16 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 -44.81 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb -45.23 fullpaymentisreceived.
proposal-editorial 1:c1514c6cdad1 -45.49 acceptance
proposal-editorial 1:893663b06769 -44.46 bysigningbelow,youagreetothescop
proposal-editorial 1:df16232de5b9 -44.47 acceptedby:
Expand Down Expand Up @@ -4041,14 +4041,14 @@ proposal-northline 1:58656319146d 0.74 totalinvestment
proposal-northline 1:4aadcd9bc785 0.74 £19,250
proposal-northline 1:51d2361f4fae 0.01 terms
proposal-northline 1:99ffab766326 0.18 50%depositisrequiredtosecurethe
proposal-northline 1:5414e5671cbd 0.95 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 1.13 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 1.90 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 2.08 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 2.85 finalpayment.
proposal-northline 1:06ebb5670fa8 2.43 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 3.20 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 3.20 paymentisreceived.
proposal-northline 1:5414e5671cbd 0.20 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 0.18 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 0.20 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 0.18 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 0.20 finalpayment.
proposal-northline 1:06ebb5670fa8 0.48 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 0.85 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 0.45 paymentisreceived.
proposal-northline 1:c1514c6cdad1 0.21 acceptance
proposal-northline 1:893663b06769 0.53 bysigningbelow,youagreetothescop
proposal-northline 1:df16232de5b9 0.52 acceptedby:
Expand Down
4 changes: 2 additions & 2 deletions qa/src/test/resources/docx-fidelity/libreoffice-linux.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ letter-nordic_clean 1 1 15 15 0.16 0.38 0
letter-panel 1 1 13 13 0.15 0.21 0
letter-sidebar_portrait 1 1 12 12 0.43 0.51 0
letter-timeline_minimal 1 1 15 15 1.32 1.52 0
proposal-editorial 2 2 132 129 43.72 45.38 72
proposal-editorial 2 2 132 129 43.95 45.38 72
proposal-indigo 1 1 72 70 0.57 27.88 16
proposal-modern 1 1 44 44 0.50 0.75 0
proposal-northline 2 2 132 132 0.28 0.77 5
proposal-northline 2 2 132 132 0.27 0.72 0
receipt-modern 1 1 57 57 0.26 0.29 0
rota-cobalt 1 1 154 151 0.55 1.24 0
44 changes: 22 additions & 22 deletions qa/src/test/resources/docx-fidelity/libreoffice-windows-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -3643,11 +3643,11 @@ proposal-editorial 1:aaa2a6073d69 -45.38 refinedlogosuite&brandguidelines
proposal-editorial 1:d626f7532564 -45.38 color,typography&designsystem
proposal-editorial 1:018ec557a513 -45.38 websiteuxwireframes
proposal-editorial 1:5ed4970fa285 -45.38 high-fidelitywebsitedesigns
proposal-editorial 1:a579d6d1c12e -45.48 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d -45.13 mobile
proposal-editorial 1:8b712e7e93bf -44.40 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 -44.40 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb -44.40 launchchecklist&trainingsession
proposal-editorial 1:a579d6d1c12e -44.88 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d -45.28 mobile
proposal-editorial 1:8b712e7e93bf -45.40 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 -45.40 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb -45.40 launchchecklist&trainingsession
proposal-editorial 1:94d192b3a326 -46.32 timeline
proposal-editorial 1:02195b8e9896 -45.06 phase
proposal-editorial 1:c51faa148557 -45.06 focus
Expand Down Expand Up @@ -3695,15 +3695,15 @@ proposal-editorial 1:7ffd918ebc4a -43.46 £1,750
proposal-editorial 1:58656319146d -43.29 totalinvestment
proposal-editorial 1:4aadcd9bc785 -43.29 £19,250
proposal-editorial 1:51d2361f4fae -45.18 terms
proposal-editorial 1:99ffab766326 -44.80 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd -44.05 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a -43.87 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db -43.12 majordeliverable.
proposal-editorial 1:ffce6ed7e6e5 -42.94 finalfilesandhandoffdeliveredupo
proposal-editorial 1:566f68df6dd8 -42.19 finalpayment.
proposal-editorial 1:06ebb5670fa8 -42.61 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 -41.86 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb -41.88 fullpaymentisreceived.
proposal-editorial 1:99ffab766326 -44.20 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd -44.20 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a -44.22 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db -44.22 majordeliverable.
proposal-editorial 1:ffce6ed7e6e5 -44.24 finalfilesandhandoffdeliveredupo
proposal-editorial 1:566f68df6dd8 -44.24 finalpayment.
proposal-editorial 1:06ebb5670fa8 -44.56 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 -44.21 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb -44.63 fullpaymentisreceived.
proposal-editorial 1:c1514c6cdad1 -44.29 acceptance
proposal-editorial 1:893663b06769 -43.26 bysigningbelow,youagreetothescop
proposal-editorial 1:df16232de5b9 -43.27 acceptedby:
Expand Down Expand Up @@ -3942,14 +3942,14 @@ proposal-northline 1:58656319146d 1.79 totalinvestment
proposal-northline 1:4aadcd9bc785 1.79 £19,250
proposal-northline 1:51d2361f4fae 0.61 terms
proposal-northline 1:99ffab766326 0.78 50%depositisrequiredtosecurethe
proposal-northline 1:5414e5671cbd 1.55 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 1.73 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 2.50 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 2.68 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 3.45 finalpayment.
proposal-northline 1:06ebb5670fa8 3.03 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 3.80 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 3.80 paymentisreceived.
proposal-northline 1:5414e5671cbd 0.80 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 0.78 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 0.80 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 0.78 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 0.80 finalpayment.
proposal-northline 1:06ebb5670fa8 1.08 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 1.45 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 1.05 paymentisreceived.
proposal-northline 1:c1514c6cdad1 1.41 acceptance
proposal-northline 1:893663b06769 1.73 bysigningbelow,youagreetothescop
proposal-northline 1:df16232de5b9 1.72 acceptedby:
Expand Down
4 changes: 2 additions & 2 deletions qa/src/test/resources/docx-fidelity/libreoffice-windows.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ letter-nordic_clean 1 1 15 15 0.16 0.38 0
letter-panel 1 1 13 13 0.15 0.21 0
letter-sidebar_portrait 1 1 12 12 0.43 0.51 0
letter-timeline_minimal 1 1 15 15 1.32 1.52 0
proposal-editorial 2 2 132 129 43.12 45.15 72
proposal-editorial 2 2 132 129 43.29 45.18 72
proposal-indigo 1 1 72 70 0.57 27.88 16
proposal-modern 1 1 44 44 0.41 0.75 0
proposal-northline 2 2 132 132 0.38 1.62 6
proposal-northline 2 2 132 132 0.38 1.47 0
receipt-modern 1 1 57 57 0.26 0.29 0
rota-cobalt 1 1 154 151 0.60 1.29 0
42 changes: 21 additions & 21 deletions qa/src/test/resources/docx-fidelity/word-windows-lines.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -3744,11 +3744,11 @@ proposal-editorial 1:aaa2a6073d69 0.10 refinedlogosuite&brandguidelines
proposal-editorial 1:d626f7532564 0.06 color,typography&designsystem
proposal-editorial 1:018ec557a513 0.14 websiteuxwireframes
proposal-editorial 1:5ed4970fa285 0.10 high-fidelitywebsitedesigns
proposal-editorial 1:a579d6d1c12e 0.38 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d 0.65 mobile
proposal-editorial 1:8b712e7e93bf 1.04 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 1.12 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb 1.08 launchchecklist&trainingsession
proposal-editorial 1:a579d6d1c12e 0.62 responsivedesignfordesktop,table
proposal-editorial 1:d524c1a0811d 0.17 mobile
proposal-editorial 1:8b712e7e93bf 0.08 contentstrategy&pagetemplates
proposal-editorial 1:e9bf06d9b130 0.04 developer-readyassets&specificat
proposal-editorial 1:e93e7ba95ceb 0.12 launchchecklist&trainingsession
proposal-editorial 1:94d192b3a326 0.47 timeline
proposal-editorial 1:02195b8e9896 0.50 phase
proposal-editorial 1:c51faa148557 0.50 focus
Expand Down Expand Up @@ -3796,13 +3796,13 @@ proposal-editorial 1:7ffd918ebc4a 2.20 £1,750
proposal-editorial 1:58656319146d 2.36 totalinvestment
proposal-editorial 1:4aadcd9bc785 2.36 £19,250
proposal-editorial 1:51d2361f4fae 1.66 terms
proposal-editorial 1:99ffab766326 1.06 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd 1.81 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a 1.96 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db 2.71 majordeliverable.
proposal-editorial 1:06ebb5670fa8 3.16 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 4.06 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb 4.04 fullpaymentisreceived.
proposal-editorial 1:99ffab766326 1.42 50%depositisrequiredtosecurethe
proposal-editorial 1:5414e5671cbd 1.33 projectandschedulethekick-off.
proposal-editorial 1:832db31f5c9a 1.36 includestworoundsofrevisionsper
proposal-editorial 1:5130aeada3db 1.39 majordeliverable.
proposal-editorial 1:06ebb5670fa8 1.12 ownershipofallfinaldeliverables
proposal-editorial 1:deda6d86d965 1.51 transferstoasterahealthco.after
proposal-editorial 1:aaa7d3e9affb 1.04 fullpaymentisreceived.
proposal-editorial 1:c1514c6cdad1 2.62 acceptance
proposal-editorial 1:893663b06769 2.26 bysigningbelow,youagreetothescop
proposal-editorial 1:df16232de5b9 2.41 acceptedby:
Expand Down Expand Up @@ -4040,15 +4040,15 @@ proposal-northline 1:7ffd918ebc4a 1.75 £1,750
proposal-northline 1:58656319146d 1.87 totalinvestment
proposal-northline 1:4aadcd9bc785 1.87 £19,250
proposal-northline 1:51d2361f4fae 0.82 terms
proposal-northline 1:99ffab766326 0.97 50%depositisrequiredtosecurethe
proposal-northline 1:5414e5671cbd 1.74 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 1.97 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 2.74 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 2.85 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 3.62 finalpayment.
proposal-northline 1:06ebb5670fa8 3.37 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 4.14 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 4.17 paymentisreceived.
proposal-northline 1:99ffab766326 0.85 50%depositisrequiredtosecurethe
proposal-northline 1:5414e5671cbd 0.90 projectandschedulethekick-off.
proposal-northline 1:832db31f5c9a 0.89 includestworoundsofrevisionsper
proposal-northline 1:5130aeada3db 0.82 majordeliverable.
proposal-northline 1:ffce6ed7e6e5 0.81 finalfilesandhandoffdeliveredupo
proposal-northline 1:566f68df6dd8 0.86 finalpayment.
proposal-northline 1:06ebb5670fa8 1.21 ownershipofallfinaldeliverables
proposal-northline 1:5312201597c1 1.50 transferstoasterahealthco.afterf
proposal-northline 1:d31e8d77a816 1.02 paymentisreceived.
proposal-northline 1:c1514c6cdad1 1.69 acceptance
proposal-northline 1:893663b06769 1.96 bysigningbelow,youagreetothescop
proposal-northline 1:df16232de5b9 1.82 acceptedby:
Expand Down
Loading
Loading