Skip to content

Commit 996ca4d

Browse files
committed
Merge pull request #1722
2 parents 6c1170a + a0956fe commit 996ca4d

8 files changed

Lines changed: 85 additions & 3 deletions

File tree

‎ROADMAP.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ app's JSON control channel (`deckcraft --control PORT`).
150150
| Date | What landed |
151151
|---|---|
152152
| 2026-11-02 | Native and PPTX saves retain optional table right-to-left direction, including explicit false and omission; two-save round-trip tests keep labeled columns in order |
153+
| 2026-11-02 | Text runs preserve alternate-language metadata independently from the main language through native and PPTX saves |
153154
| 2026-11-02 | File › About replaces the unused Account page, with version, project links, contributor/model credits and appearance preferences |
154155
| 2026-11-02 | Tiled picture fills in groups: a tile (`a:blipFill` with `a:tile`) keeps its size, offset and anchor in slide points whatever the group's child-coordinate scale, uniform or stretched unevenly, nested or flipped (also a group's own tile fill passed to its members, and a picture shape's own tile, with its shadow and reflection), and tiles with `rotWithShape="0"` keep their size in points at any zoom, as PowerPoint draws them (measured on its own PNG export of a synthetic probe deck: every grouped case within ~3/255 of the ungrouped control's own difference from PowerPoint, which is ~13/255 from resampling). Before, a group whose child space was ~1800 times smaller than its box showed one flat texel of the texture (a Venn diagram with paper-textured circles and a hatched intersection) |
155156
| 2026-10-31 | No Fill shape interiors allow selection and editing of underlying objects, even when a quick style remains; hit-testing uses the renderer’s fill resolution. Outlines, rotation, text targets and actual fills keep their hit behaviour (#1621) |
@@ -323,6 +324,7 @@ app's JSON control channel (`deckcraft --control PORT`).
323324

324325
| Date | Change | Summary |
325326
|---|---|---|
327+
| 2026-11-02 | trivial | Progress log: run alternate-language metadata round-trips through native and PPTX formats; product parity scores unchanged |
326328
| 2026-11-02 | trivial | File › About replaces Account; product links, credits and appearance retained |
327329
| 2026-11-02 | trivial | Progress log: tiled picture fills keep their size in scaled groups. Scores and milestone names unchanged |
328330
| 2026-10-31 | trivial | No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged |

‎crates/format/src/tests.rs‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,31 @@ fn chart_sidecars_are_optional_for_older_native_files() {
1111
assert_eq!(serde_json::from_value::<Chart>(json).expect("empty sidecar"), chart);
1212
}
1313

14+
#[test]
15+
fn alternate_run_language_survives_two_native_saves_and_absence() {
16+
use deckcraft_model::text::{Paragraph, Run, RunProps, TextBody};
17+
let mut p = defaults::new_presentation(None);
18+
Arc::make_mut(&mut p.slides[0]).shapes[0].text = Some(TextBody {
19+
paragraphs: vec![Paragraph {
20+
runs: vec![
21+
Run::with("bonjour", RunProps { lang: Some("en-US".into()), alt_lang: Some("fr-FR".into()), ..Default::default() }),
22+
Run::with(" plain", RunProps { lang: Some("en-US".into()), ..Default::default() }),
23+
],
24+
..Default::default()
25+
}],
26+
..Default::default()
27+
});
28+
let mut q = load(&save(&p).expect("save")).expect("load");
29+
for _ in 0..2 {
30+
let runs = &q.slides[0].shapes[0].text.as_ref().expect("text").paragraphs[0].runs;
31+
assert_eq!(runs[0].props.lang.as_deref(), Some("en-US"));
32+
assert_eq!(runs[0].props.alt_lang.as_deref(), Some("fr-FR"));
33+
assert_eq!(runs[1].props.lang.as_deref(), Some("en-US"));
34+
assert_eq!(runs[1].props.alt_lang, None);
35+
q = load(&save(&q).expect("save again")).expect("load again");
36+
}
37+
}
38+
1439
#[test]
1540
fn native_save_keeps_chart_relationships_and_payloads() {
1641
use deckcraft_model::chart::{Chart, ChartKept, ChartPart, ChartRel, ChartType};

‎crates/model/src/text.rs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ pub struct RunProps {
456456
/// Action on mouse over (Insert ▸ Action ▸ Mouse Over on selected text, `a:hlinkMouseOver`).
457457
pub hover: Option<Hyperlink>,
458458
pub lang: Option<String>,
459+
#[serde(deserialize_with = "bounded_language")]
460+
pub alt_lang: Option<String>,
459461
pub shadow: Option<crate::style::Shadow>,
460462
/// `a:innerShdw` on the run. Outer shadow stays in `shadow`.
461463
pub inner_shadow: Option<crate::style::Shadow>,
@@ -467,6 +469,13 @@ pub struct RunProps {
467469
pub no_proof: Option<bool>,
468470
}
469471

472+
fn bounded_language<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
473+
where
474+
D: serde::Deserializer<'de>,
475+
{
476+
Option::<String>::deserialize(deserializer).map(|lang| lang.map(|value| value.chars().take(256).collect()))
477+
}
478+
470479
impl RunProps {
471480
pub fn inherit(&mut self, p: &RunProps) {
472481
macro_rules! take {
@@ -493,6 +502,7 @@ impl RunProps {
493502
link,
494503
hover,
495504
lang,
505+
alt_lang,
496506
shadow,
497507
inner_shadow,
498508
glow,
@@ -695,6 +705,20 @@ mod tests {
695705
use super::*;
696706
use deckcraft_color::Rgba;
697707

708+
#[test]
709+
fn alternate_language_inherits_and_native_input_is_bounded() {
710+
let mut child = RunProps::default();
711+
child.inherit(&RunProps { lang: Some("en-US".into()), alt_lang: Some("fr-FR".into()), ..Default::default() });
712+
assert_eq!(child.lang.as_deref(), Some("en-US"));
713+
assert_eq!(child.alt_lang.as_deref(), Some("fr-FR"));
714+
715+
let oversized = "x".repeat(300);
716+
let json = serde_json::json!({"altLang": oversized});
717+
let props: RunProps = serde_json::from_value(json).expect("run props");
718+
assert_eq!(props.alt_lang.as_deref().map(str::len), Some(256));
719+
assert_eq!(serde_json::from_value::<RunProps>(serde_json::json!({})).expect("old run props"), RunProps::default());
720+
}
721+
698722
#[test]
699723
fn explicit_bullet_follow_text_resets_block_inheritance() {
700724
let parent = ParaProps {

‎crates/pptx/src/read/dml.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ fn typeface(e: &El) -> Option<String> {
553553
pub fn rpr(imp: &mut Imp, part: &Part, r: &El) -> RunProps {
554554
let mut p = RunProps {
555555
lang: r.attr("lang").map(String::from),
556+
alt_lang: r.attr("altLang").map(|lang| lang.chars().take(256).collect()),
556557
size: r.f64("sz").map(|s| (s / 100.0).clamp(1.0, 4000.0)),
557558
bold: r.bool("b"),
558559
italic: r.bool("i"),

‎crates/pptx/src/write/dml.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ fn typeface(w: &mut W, tag: &str, f: &Option<String>) {
629629
pub fn rpr(w: &mut W, x: &mut Exp, o: &mut Out, tag: &str, r: &RunProps) {
630630
let a = A::new()
631631
.o("lang", r.lang.as_deref().filter(|l| !l.is_empty()))
632+
.o("altLang", r.alt_lang.as_deref().filter(|l| !l.is_empty()))
632633
.o("sz", r.size.map(|s| (s.clamp(1.0, 4000.0) * 100.0).round() as i64))
633634
.b("b", r.bold)
634635
.b("i", r.italic)

‎crates/pptx/tests/it/roundtrip.rs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,32 @@ fn literal_line_ends_in_run_text_read_as_breaks_and_survive_save() {
15451545
assert_eq!(runs_of(&round(&a), "one"), want, "save and reopen keep the runs");
15461546
}
15471547

1548+
#[test]
1549+
fn alternate_run_language_survives_pptx_saves_and_absence() {
1550+
let mut p = defaults::new_presentation(None);
1551+
let first = p.slides[0].id;
1552+
let slide = p.slide_mut(first).expect("slide");
1553+
slide.shapes[0].text = Some(TextBody {
1554+
paragraphs: vec![Paragraph {
1555+
runs: vec![
1556+
Run::with("bonjour", RunProps { lang: Some("en-US".into()), alt_lang: Some("fr-FR".into()), ..Default::default() }),
1557+
Run::with(" plain", RunProps { lang: Some("en-US".into()), ..Default::default() }),
1558+
],
1559+
..Default::default()
1560+
}],
1561+
..Default::default()
1562+
});
1563+
let mut q = round(&p);
1564+
for _ in 0..2 {
1565+
let runs = &q.slides[0].shapes[0].text.as_ref().expect("text").paragraphs[0].runs;
1566+
assert_eq!(runs[0].props.lang.as_deref(), Some("en-US"));
1567+
assert_eq!(runs[0].props.alt_lang.as_deref(), Some("fr-FR"));
1568+
assert_eq!(runs[1].props.lang.as_deref(), Some("en-US"));
1569+
assert_eq!(runs[1].props.alt_lang, None);
1570+
q = round(&q);
1571+
}
1572+
}
1573+
15481574
#[test]
15491575
fn color_pulse_keeps_its_effect_colour_and_duration() {
15501576
let mut p = defaults::new_presentation(None);

‎docs/file-format-parity.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# File-format parity with PowerPoint
22

33
> **Last reviewed:** 2026-11-02 · **Last updated:** 2026-11-02 · **Change:** minor (optional table RTL direction survives native and two PPTX saves; scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
4+
> **Last reviewed:** 2026-11-02 · **Last updated:** 2026-11-02 · **Change:** minor (run alternate-language metadata round-trips through native and PPTX formats; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: seven owned PPTX corpus files, embedded fonts, EMF/WMF clip regions, threaded comments (#70), chart trendlines and workbooks (#335), SmartArt written as a diagram, tags and custom XML kept, picture export DPI; duplicated rows and headers folded; previous: trivial, lines in scaled groups, #233) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
45
56
Every format PowerPoint reads or writes, DeckCraft's support, fidelity and how it is tested.
67
Gaps are itemized in [gaps.md](gaps.md#file-formats). Dimension score: **~58% ready**
@@ -82,7 +83,7 @@ the round trip even though DeckCraft doesn't model it.
8283
| Shapes: preset geometry (~180 presets), custom geometry, groups, connectors | yes | yes | Presets re-derived in `crates/geom/src/preset.rs` (and `preset/extra.rs`). Outlines, dashes, arrowheads and ink inside a group, and text, keep their size in points whatever the group's child-coordinate scale (#233). |
8384
| Fills: solid, gradient, picture (stretch/tile/crop), pattern, group | yes | yes | |
8485
| Lines: dash, compound, caps, joins, arrowheads | yes | yes | |
85-
| Text: runs, paragraphs, bullets, numbering, levels, autofit, columns, vertical, RTL, script fonts, fields, hyperlinks | yes | yes | Round-trip tests incl. `justLow`, date fields and paragraph `defRPr` (the defaults a placeholder's runs inherit, including a link). A click or hover action keeps its sound, `endSnd`, and a custom show's "Show and return". Gradient and outline on a run, autofit, columns, vertical and RTL text, tab stops and line spacing round-trip (`corpus_style.rs`) |
86+
| Text: runs, paragraphs, bullets, numbering, levels, autofit, columns, vertical, RTL, script fonts, fields, hyperlinks | yes | yes | Run `lang` and `altLang` are independently retained through native and PPTX saves; other round-trip tests cover `justLow`, date fields and paragraph `defRPr` (the defaults a placeholder's runs inherit, including a link). A click or hover action keeps its sound, `endSnd`, and a custom show's "Show and return". Gradient and outline on a run, autofit, columns, vertical and RTL text, tab stops and line spacing round-trip (`corpus_style.rs`) |
8687
| Effects: shadow, glow, soft edges, reflection | yes | yes | On a run, inner shadow, reflection and soft edges are kept along with the outer shadow and glow |
8788
| 3-D: `scene3d`, `sp3d` | kept | kept | A bevel preset with no `sp3d` of its own is written back on shapes and theme effect styles. Bevels, cameras, face lighting and extrusion sides draw approximately |
8889
| Text warp (`prstTxWarp`) | yes | yes | All 40 presets rendered (`crates/geom/src/warp.rs`); adjust values (`avLst`) round-trip |
@@ -120,6 +121,7 @@ the round trip even though DeckCraft doesn't model it.
120121
| Date | Change | Summary |
121122
|---|---|---|
122123
| 2026-11-02 | minor | Optional table RTL direction is read and written as `a:tblPr/@rtl`; native and two PPTX saves preserve true, false and absent values with distinguishable column text |
124+
| 2026-11-02 | minor | Text runs preserve alternate-language metadata in native and PPTX round trips |
123125
| 2026-10-18 | minor | Native chart payloads use referenced ZIP members and share media byte/item limits; old inline sidecars remain readable. Synthetic tests cover multi-megabyte layout, all shape owners, shared budgets, missing/corrupt members and invalid references. Scores and milestone scope unchanged |
124126
| 2026-10-15 | trivial | Native `.deckcraft` files serialize a nonempty chart `kept` sidecar (relationships, part names, content types and bytes). Older files without it still load; empty sidecars are omitted. Headless PPTX → edit → native save/reopen → PPTX checks keep the workbook and drawing bytes; editing chart data still drops the stale workbook |
125127
| 2026-10-15 | trivial | PPTX interactive timing sequences keep later On Click steps and paragraph click builds (`trigger_steps.rs`); mixed starts and independent buttons survive import/edit/save/reopen |

‎docs/gaps.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Where DeckCraft falls short of PowerPoint
22

3-
> **Last reviewed:** 2026-10-30 · **Last updated:** 2026-11-01 · **Change:** trivial (locked No Fill and no-outline click-through regression coverage added; No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
3+
> **Last reviewed:** 2026-11-02 · **Last updated:** 2026-11-02 · **Change:** trivial (text run alternate-language metadata now survives native and PPTX saves; per-run language editing and proofing gaps remain; scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
44
55
Every known shortfall, one entry each, ranked by how much it stops someone who presents with
66
PowerPoint from switching. This is the work list: pick from the top. Numbers are summarized in
@@ -368,6 +368,7 @@ Detail in [localization-parity.md](localization-parity.md).
368368

369369
| Date | Change | Summary |
370370
|---|---|---|
371+
| 2026-11-02 | trivial | Run alternate-language metadata now survives native and PPTX saves; UI and proofing gaps remain; scores unchanged |
371372
| 2026-10-31 | trivial | No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged |
372373
| 2026-10-30 | minor | Slide-show click targets use each shape’s own animation state; scale and rotation test added |
373374
| 2026-10-28 | trivial | Automatic lists now run independently of Replace text as you type; proofing gap description updated |
@@ -427,7 +428,7 @@ Detail in [localization-parity.md](localization-parity.md).
427428
| 2026-10-13 | minor | AutoCorrect options: case rules, fractions, ellipsis, a larger built-in list and your own entries (`text.autocorrect`, Tools ▸ AutoCorrect) |
428429
| 2026-10-14 | trivial | Notes spelling menu, Review › Language with Do Not Check Spelling, repeated words |
429430
| 2026-10-14 | trivial | Spelling squiggles in table cells and notes, and on the web |
430-
| 2026-10-14 | minor | Spelling squiggles while typing, Add to Dictionary, per-run languages and compounds |
431+
| 2026-10-14 | minor | Spelling squiggles while typing, Add to Dictionary, per-run language editing and compounds; run language metadata now round-trips |
431432
| 2026-10-14 | minor | Spelling checks with installed Hunspell dictionaries and suggests corrections |
432433
| 2026-10-13 | minor | Animation preview plays the current slide on the editor canvas; the pane gap keeps the timeline, preview from the selected effect, and the remaining effects |
433434
| 2026-10-14 | minor | A two-finger twist rotates the selected shapes. Pinch-zoom is still open |

0 commit comments

Comments
 (0)