From b0926335619f463b9781703a34071b356a191c42 Mon Sep 17 00:00:00 2001 From: midasdf <205497066+midasdf@users.noreply.github.com> Date: Thu, 22 Oct 2026 00:24:30 +0900 Subject: [PATCH] =?UTF-8?q?Print:=20Japanese=20Envelope=20#4=20is=2090?= =?UTF-8?q?=C3=97205=20mm=20and=20add=20B6=20(ISO)=20to=20the=20Size=20men?= =?UTF-8?q?u?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 長形4号 is a 90×205 mm envelope (90×225 mm is 長形40号, a different one), so the paper table gave it a height 20 mm too tall — and XLSX paper id 74, the PDF MediaBox and the print preview all followed it. Use 205 mm (581.10 pt) and pin the corrected size with a dedicated assertion; the ROADMAP progress row is corrected too. 長形40号 is not added: it is a different envelope. The Page Layout ▸ Size menu stopped at `B5 (ISO)` and never offered `B6 (ISO)`, which the engine and the command docs support; add it. --- ROADMAP.md | 2 +- crates/engine/src/cmd/print.rs | 10 ++++++++-- crates/ui-egui/src/ribbon.rs | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 65fea18b7..fc7c337d1 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -132,7 +132,7 @@ Ranked; estimates in Opus 5.5 agent-hours. Detail and the full beta-gate list in | Date | What landed | |---|---| -| 2026-10-21 | Page Setup paper sizes match Japanese Excel: `B4`/`B5`/`B6` are the JIS sizes (ISO B4/B5/B6 stay reachable by name), so a Japanese B5 worksheet prints at 182×257 mm; Japanese Postcard (100×148 mm), Double Postcard (148×200 mm), Envelope #3/#4 (120×235/90×225 mm), Kaku #2/#3 (240×332/216×277 mm) and A6 are added, both sizes reach the PDF page (`file.exportPdf`/`file.print` MediaBox) and the size survives an XLSX round-trip; the Page Layout Size menu lists them. `B4`/`B5` used to be the ISO sizes, which is changed here | +| 2026-10-21 | Page Setup paper sizes match Japanese Excel: `B4`/`B5`/`B6` are the JIS sizes (ISO B4/B5/B6 stay reachable by name), so a Japanese B5 worksheet prints at 182×257 mm; Japanese Postcard (100×148 mm), Double Postcard (148×200 mm), Envelope #3/#4 (120×235/90×205 mm), Kaku #2/#3 (240×332/216×277 mm) and A6 are added, both sizes reach the PDF page (`file.exportPdf`/`file.print` MediaBox) and the size survives an XLSX round-trip; the Page Layout Size menu lists them. `B4`/`B5` used to be the ISO sizes, which is changed here | | 2026-10-12 | Rows auto-fit oversized fonts: opening a file and whole-row/column formatting grow non-custom rows to their tallest font (#833) | | 2026-10-12 | Number formats: parsing a format code is linear in its length (long runs of `[`, `,` or `/` no longer take quadratic time), and an unclosed `[` is a literal when splitting sections as well as when tokenizing (#810) | | 2026-10-12 | Number formats: a fraction denominator with 65,536 zeros no longer crashes; format codes are capped at 255 characters like Excel (longer codes display as General, `TEXT` gives `#VALUE!`) (#807) | diff --git a/crates/engine/src/cmd/print.rs b/crates/engine/src/cmd/print.rs index 663e59a49..43119b0b0 100644 --- a/crates/engine/src/cmd/print.rs +++ b/crates/engine/src/cmd/print.rs @@ -97,7 +97,8 @@ fn known_paper(name: &str) -> Option<(f32, f32)> { "japanesepostcard" | "postcard" => (283.46, 419.53), "japanesedoublepostcard" | "doublepostcard" => (419.53, 566.93), "japaneseenvelope#3" | "chou#3" => (340.16, 666.14), - "japaneseenvelope#4" | "chou#4" => (255.12, 637.80), + // 長形4号 is 90×205 mm; 90×225 mm is 長形40号, a different envelope, so it stays out. + "japaneseenvelope#4" | "chou#4" => (255.12, 581.10), "japaneseenvelopekaku#2" | "kaku#2" => (680.31, 941.10), "japaneseenvelopekaku#3" | "kaku#3" => (612.28, 785.20), _ => return None, @@ -2095,13 +2096,18 @@ mod tests { ("Japanese Postcard", 283.46, 419.53), ("japanese double postcard", 419.53, 566.93), ("Japanese Envelope #3", 340.16, 666.14), - ("chou #4", 255.12, 637.80), + ("chou #4", 255.12, 581.10), ("Japanese Envelope Kaku #2", 680.31, 941.10), ("kaku #3", 612.28, 785.20), ] { let got = paper_size(name); assert!((got.0 - w).abs() < 0.01 && (got.1 - h).abs() < 0.01, "{name}: {got:?}"); } + // 長形4号 is 90×205 mm (90×225 mm is 長形40号), so its height is 205 mm = 581.10 pt — not the + // 225 mm it once had. + let chou4 = paper_size("Japanese Envelope #4"); + assert_eq!((chou4.0, chou4.1), (255.12, 581.10)); + assert_eq!(chou4, paper_size("chou #4")); // Unknown names keep the old Letter fallback. assert_eq!(paper_size("Napkin"), (612.0, 792.0)); } diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 513274869..0f313f865 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -1684,6 +1684,7 @@ fn page_layout(app: &mut SheetApp, ui: &mut Ui) { "Japanese Envelope Kaku #3", "B4 (ISO)", "B5 (ISO)", + "B6 (ISO)", ] { if ui.button(p).clicked() { act(app, "pageLayout.size", json!({"paper": p}));