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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ past the paragraph's left and first-line indents. When a tab's left or default
stop leaves no room for the next word before the line's end, the tab and that
word start the next line. A line left holding only tabs keeps their runs'
height. Centred, right and decimal stops keep their field on the line.
A negative left or right indent widens a body paragraph's lines into the
margin, as Word does; table cells still clamp it to zero until they clip their
content at the cell edge (#2261).

DOCX section body text supports top, centered and bottom page alignment,
including paragraph after-spacing and page breaks. Continuous sections use their
Expand Down
Binary file added assets/bugfixes/issue-2233/after.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/bugfixes/issue-2233/before.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/bugfixes/issue-2233/gt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 125 additions & 0 deletions assets/bugfixes/issue-2233/layout-audit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"pages": [
{
"lines": {
"gt": 3,
"out": 3,
"matched": 3,
"missing": 0,
"extra": 0,
"deviant": 0,
"missing_text": [],
"extra_text": []
},
"baseline": {
"mean_abs_dy": 0.04504733333331975,
"worst_dy": 0.08896000000002857,
"worst_dy_signed": 0.08896000000002857,
"worst_line": "Aboutprovidinginformation"
},
"dx0": {
"mean_abs": 0.07666666666666326,
"worst": 0.10499999999998977
},
"width": {
"mean_abs_pct": 0.15638470487368875,
"worst_pct": 0.31213315474126385
},
"instances": {
"compared": 3,
"large_shift_threshold": 5.0,
"large_shift_count": 0,
"large_shifts": [],
"fine_shift_threshold": 0.5,
"fine_shift_count": 0,
"fine_shifts": []
},
"visibility": {
"mismatch_count": 0,
"mismatches": [],
"unmatched_hidden_gt": 0,
"unmatched_hidden_out": 0,
"unmatched_hidden_gt_text": [],
"unmatched_hidden_out_text": []
},
"visible_fills": {
"mismatch_count": 0,
"mismatches": []
},
"pitch": {
"pairs": 2,
"worst_delta": 0.12546999999999287
},
"wraps": {
"count": 0,
"samples": []
},
"topology": {
"groups": 0,
"gt_lines": 0,
"out_lines": 0,
"samples": []
},
"reflow": {
"gt_lines": 0,
"out_lines": 0,
"samples": []
},
"rects": {
"gt_count": 0,
"out_count": 0,
"canonical_gt_count": 0,
"canonical_out_count": 0,
"matched": 0,
"unmatched_gt": 0,
"unmatched_out": 0,
"mean_center_delta": 0.0,
"geometry_threshold": 0.5,
"raw_geometry_mismatch_count": 0,
"raw_geometry_mismatch_samples": [],
"coverage_equivalent_count": 0,
"coverage_unmodeled_count": 0,
"geometry_mismatch_count": 0,
"geometry_mismatch_samples": [],
"samples": [],
"x": {
"mean_abs": 0.0,
"worst": 0.0
},
"y": {
"mean_abs": 0.0,
"worst": 0.0
},
"width": {
"mean_abs": 0.0,
"worst": 0.0
},
"height": {
"mean_abs": 0.0,
"worst": 0.0
},
"edges": {
"left": {
"mean_abs": 0.0,
"worst": 0.0
},
"top": {
"mean_abs": 0.0,
"worst": 0.0
},
"right": {
"mean_abs": 0.0,
"worst": 0.0
},
"bottom": {
"mean_abs": 0.0,
"worst": 0.0
}
}
},
"noise_floor": 0.12
}
],
"gt_pages": 1,
"out_pages": 1
}
215 changes: 215 additions & 0 deletions assets/bugfixes/issue-2233/render-clusters-page-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"clusters": [
{
"area_pt2": 30.4128,
"bbox_pt": {
"height": 9.6,
"width": 8.64,
"x": 85.44,
"y": 60.0
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Recipient' (R, e, c, i) differs only in glyph outlines at the same positions, Word's embedded Times New Roman against this host's metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.01pt from Word's."
},
"id": "p1-5dc5304100ba",
"region": "top-left"
},
{
"area_pt2": 30.4128,
"bbox_pt": {
"height": 7.2,
"width": 5.76,
"x": 95.04,
"y": 62.88
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Recipient' (R, e, c, i) differs only in glyph outlines at the same positions, Word's embedded Times New Roman against this host's metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.01pt from Word's."
},
"id": "p1-132d48374563",
"region": "top-left"
},
{
"area_pt2": 28.8,
"bbox_pt": {
"height": 9.6,
"width": 6.72,
"x": 136.8,
"y": 155.52
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Dear recipient' (D, e, a, r, i, p) differs only in glyph outlines at the same positions, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.03pt and its baseline 0.04pt from Word's, unchanged by this fix."
},
"id": "p1-0762ad287736",
"region": "top-left"
},
{
"area_pt2": 28.3392,
"bbox_pt": {
"height": 7.2,
"width": 4.8,
"x": 101.76,
"y": 155.52
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Dear recipient' (D, e, a, r, i, p) differs only in glyph outlines at the same positions, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.03pt and its baseline 0.04pt from Word's, unchanged by this fix."
},
"id": "p1-be741a945e83",
"region": "top-left"
},
{
"area_pt2": 27.8784,
"bbox_pt": {
"height": 7.2,
"width": 6.24,
"x": 227.04,
"y": 78.72
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-1031b376123d",
"region": "top"
},
{
"area_pt2": 24.8832,
"bbox_pt": {
"height": 10.08,
"width": 6.72,
"x": 130.08,
"y": 78.72
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-413d1972e343",
"region": "top-left"
},
{
"area_pt2": 23.5008,
"bbox_pt": {
"height": 7.2,
"width": 5.76,
"x": 101.28,
"y": 62.88
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Recipient' (R, e, c, i) differs only in glyph outlines at the same positions, Word's embedded Times New Roman against this host's metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.01pt from Word's."
},
"id": "p1-a08c2c33abd1",
"region": "top-left"
},
{
"area_pt2": 23.5008,
"bbox_pt": {
"height": 7.68,
"width": 6.24,
"x": 94.08,
"y": 75.84
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-5c2de5b5fd65",
"region": "top-left"
},
{
"area_pt2": 23.5008,
"bbox_pt": {
"height": 7.2,
"width": 6.24,
"x": 109.44,
"y": 78.72
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-5e660269328d",
"region": "top-left"
},
{
"area_pt2": 20.736,
"bbox_pt": {
"height": 10.56,
"width": 4.8,
"x": 104.16,
"y": 75.36
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-b18b0ac62282",
"region": "top-left"
},
{
"area_pt2": 20.5056,
"bbox_pt": {
"height": 8.64,
"width": 6.24,
"x": 178.56,
"y": 79.68
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'About providing information', the paragraph this fix moves 71pt left, now covers Word's glyphs (A, b, o, u, p, r, n, g, a, t) with outline-only differences, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.10pt and its baseline 0.09pt from Word's."
},
"id": "p1-6aeadbc09d9c",
"region": "top-left"
},
{
"area_pt2": 20.2752,
"bbox_pt": {
"height": 6.24,
"width": 6.24,
"x": 95.04,
"y": 155.52
},
"disposition": {
"class": "glyph-edge-rasterization",
"kind": "accepted-rendering",
"note": "Inspected in the 150 DPI diff and 600 DPI GT/after crops: 'Dear recipient' (D, e, a, r, i, p) differs only in glyph outlines at the same positions, Times New Roman drawn as the metric-compatible Liberation Serif; its start is 0.03pt and its baseline 0.04pt from Word's, unchanged by this fix."
},
"id": "p1-4b56a2ad43f4",
"region": "top-left"
}
],
"dpi": 150,
"duplicate_disposition_cluster_ids": [],
"errors": [],
"fuzz_percent": 5,
"minimum_area_pt2": 20.0,
"page": 1,
"passed": true,
"renderer_observations": [],
"schema_version": 1,
"strict": true,
"summary": {
"dispositioned": 12,
"duplicate": 0,
"total": 12,
"undispositioned": 0,
"unknown": 0
},
"undispositioned_cluster_ids": [],
"unknown_disposition_cluster_ids": []
}
4 changes: 2 additions & 2 deletions crates/office2pdf/src/render/typst_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6420,8 +6420,8 @@ fn border_line_style_to_typst(style: BorderLineStyle) -> &'static str {
/// Both are always written. An absent `w:spacing` means Word draws no gap, not
/// that Typst should fall back to its 1.2em default, so `None` maps to `0pt`.
/// A `(left, right)` inset narrows the picture's measure to its paragraph's
/// indents. A negative one widens it into the margin, as Word does; text still
/// clamps a negative `w:left` or `w:right` at the margin (issue #2233).
/// indents. A negative one widens it into the margin, as Word does, the same
/// way a body paragraph's negative indent widens its text lines (issue #2233).
fn write_image_block_open(
out: &mut String,
spacing: Option<ImageParagraphSpacing>,
Expand Down
Loading
Loading