From cbf93700e6e229afc79691e5f588ad7e1fc7ee03 Mon Sep 17 00:00:00 2001 From: Oliwer Urbaniak Date: Sun, 25 Oct 2026 01:30:42 +0200 Subject: [PATCH 1/6] fix(styles): pair w:bCs and w:iCs with w:b and w:i in built-in styles (#4198) --- ROADMAP.md | 2 + crates/doc/src/styles.rs | 69 ++++++++++++++++++++++++-------- crates/docx/tests/it/fixtures.rs | 23 +++++++++++ crates/engine/src/cmd/para.rs | 4 +- crates/engine/src/tests_bidi.rs | 24 +++++++++++ docs/file-format-parity.md | 3 +- 6 files changed, 106 insertions(+), 19 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 1666964f0f..beec3e9ab8 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -138,6 +138,7 @@ Ranked, to beta (detail and remaining milestones in [docs/roadmap.md](docs/roadm ## Progress log +- 2026-10-25: Built-in styles and table styles write `w:bCs` beside `w:b` and `w:iCs` beside `w:i` in `word/styles.xml`, and `styles.modify` sets complex-script bold and italic alongside Latin when not given separately, so Arabic and Hebrew table headers and styled emphasis open bold or italic in Word and LibreOffice (#4198). - 2026-10-25: Text Highlight Color shows the last colour as the button's bar in the ribbon and mini toolbar; after No Color it shows the pen without a misleading yellow bar, and the button removes highlighting (#4087). - 2026-10-23: cu20we: DrawingML flat, square and round line caps are imported, saved, displayed and exported to PDF; absent or unknown caps default to flat. VML end caps (including shapetype inheritance) are preserved through DOCX save. Ink and metafile stroke handling remain separate. Synthetic DOCX, raster and PDF regressions cover the change; no new native Word comparison. - 2026-10-23: cu20we: paragraph-relative box floats start above effective space before; header, footer, cell and text-box layout regressions pass. Framed paragraph positioning is unchanged; no new native Word comparison. @@ -618,6 +619,7 @@ Footer page-table height and body wrapping are corrected. Other pagination gaps | Date | Change | Summary | |---|---|---| +| 2026-10-25 | trivial | Progress log: built-in styles and table styles write `w:bCs` beside `w:b` and `w:iCs` beside `w:i` (#4198) | | 2026-10-25 | trivial | Progress log: Text Highlight Color buttons show the remembered colour, or no colour bar after No Color (#4087) | | 2026-10-23 | minor | A command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it. | | 2026-10-23 | trivial | cu20we: preserve and render outline caps across DOCX/VML, screen and PDF; synthetic regressions; readiness estimates unchanged | diff --git a/crates/doc/src/styles.rs b/crates/doc/src/styles.rs index f9932bf38c..531d4df117 100644 --- a/crates/doc/src/styles.rs +++ b/crates/doc/src/styles.rs @@ -544,7 +544,7 @@ impl StyleSheet { outline_level: Some(i as u8), ..para() }, - chr: CharProps { font: Some(font.into()), size: Some(size), italic, color: color(c), ..chr() }, + chr: CharProps { font: Some(font.into()), size: Some(size), italic, italic_cs: italic, color: color(c), ..chr() }, priority: Some(9 + n as u32), quick: n <= 3, ..p_style() @@ -582,17 +582,27 @@ impl StyleSheet { builtin: true, ..Default::default() }; - add(c_style("SubtleEmphasis", "Subtle Emphasis", 19, CharProps { italic: Some(true), color: color(Rgb(0x40, 0x40, 0x40)), ..chr() })); - add(c_style("Emphasis", "Emphasis", 20, CharProps { italic: Some(true), ..chr() })); - add(c_style("IntenseEmphasis", "Intense Emphasis", 21, CharProps { italic: Some(true), color: color(HEADING_BLUE), ..chr() })); - add(c_style("Strong", "Strong", 22, CharProps { bold: Some(true), ..chr() })); + add(c_style( + "SubtleEmphasis", + "Subtle Emphasis", + 19, + CharProps { italic: Some(true), italic_cs: Some(true), color: color(Rgb(0x40, 0x40, 0x40)), ..chr() }, + )); + add(c_style("Emphasis", "Emphasis", 20, CharProps { italic: Some(true), italic_cs: Some(true), ..chr() })); + add(c_style( + "IntenseEmphasis", + "Intense Emphasis", + 21, + CharProps { italic: Some(true), italic_cs: Some(true), color: color(HEADING_BLUE), ..chr() }, + )); + add(c_style("Strong", "Strong", 22, CharProps { bold: Some(true), bold_cs: Some(true), ..chr() })); add(Style { id: "Quote".into(), name: "Quote".into(), based_on: Some("Normal".into()), next: Some("Normal".into()), para: ParaProps { align: Some(Align::Center), space_before: Some(8.0), ..para() }, - chr: CharProps { italic: Some(true), color: color(Rgb(0x40, 0x40, 0x40)), ..chr() }, + chr: CharProps { italic: Some(true), italic_cs: Some(true), color: color(Rgb(0x40, 0x40, 0x40)), ..chr() }, priority: Some(29), quick: true, ..p_style() @@ -612,7 +622,7 @@ impl StyleSheet { borders: Some(Borders { top: Some(blue_line), bottom: Some(blue_line), ..Default::default() }), ..para() }, - chr: CharProps { italic: Some(true), color: color(HEADING_BLUE), ..chr() }, + chr: CharProps { italic: Some(true), italic_cs: Some(true), color: color(HEADING_BLUE), ..chr() }, priority: Some(30), quick: true, ..p_style() @@ -622,9 +632,14 @@ impl StyleSheet { "IntenseReference", "Intense Reference", 32, - CharProps { bold: Some(true), small_caps: Some(true), spacing: Some(0.25), color: color(HEADING_BLUE), ..chr() }, + CharProps { bold: Some(true), bold_cs: Some(true), small_caps: Some(true), spacing: Some(0.25), color: color(HEADING_BLUE), ..chr() }, + )); + add(c_style( + "BookTitle", + "Book Title", + 33, + CharProps { bold: Some(true), bold_cs: Some(true), italic: Some(true), italic_cs: Some(true), spacing: Some(0.25), ..chr() }, )); - add(c_style("BookTitle", "Book Title", 33, CharProps { bold: Some(true), italic: Some(true), spacing: Some(0.25), ..chr() })); add(Style { id: "ListParagraph".into(), name: "List Paragraph".into(), @@ -644,7 +659,7 @@ impl StyleSheet { based_on: Some("Normal".into()), next: Some("Normal".into()), para: ParaProps { space_after: Some(10.0), line_spacing: Some(LineSpacing::Multiple(1.0)), ..para() }, - chr: CharProps { italic: Some(true), size: Some(9.0), color: color(Rgb(0x0E, 0x28, 0x41)), ..chr() }, + chr: CharProps { italic: Some(true), italic_cs: Some(true), size: Some(9.0), color: color(Rgb(0x0E, 0x28, 0x41)), ..chr() }, priority: Some(35), ..p_style() }); @@ -884,9 +899,9 @@ fn table_styles() -> Vec