From 6cee207f77f0fa896b9916fad6d86fe05958319b Mon Sep 17 00:00:00 2001 From: aiongg <67543387+aiongg@users.noreply.github.com> Date: Sat, 7 Nov 2026 10:38:16 +0000 Subject: [PATCH] Fix [Bug] PPTX inherited symbol-font bullets render as literal characters Fixes #1935. - crates/text/src/symbol.rs - crates/text/src/shape.rs - crates/text/tests/autocraft_regression_1935.rs --- crates/text/src/symbol.rs | 4 +++- crates/text/tests/autocraft_regression_1935.rs | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 crates/text/tests/autocraft_regression_1935.rs diff --git a/crates/text/src/symbol.rs b/crates/text/src/symbol.rs index 77cb64995..5fee4e382 100644 --- a/crates/text/src/symbol.rs +++ b/crates/text/src/symbol.rs @@ -277,7 +277,7 @@ pub fn map_symbol_bullet(c: &str, font: Option<&str>) -> String { } // Only the legacy symbol fonts: "Noto Sans Symbols" and the like are Unicode fonts whose // characters (❑ ❖) are drawn as they are. Private-use codes are mapped only when no font is named. - if f.contains("wingdings") || f == "symbol" || (font.is_none() && ('\u{f000}'..='\u{f0ff}').contains(&first)) { + if f.contains("wingdings") || f.starts_with("monotype sorts") || f == "symbol" || (font.is_none() && ('\u{f000}'..='\u{f0ff}').contains(&first)) { let code = (first as u32) & 0xff; // Wingdings 2 and 3 put different shapes at the same codes. if f.starts_with("wingdings 2") { @@ -304,6 +304,8 @@ pub fn map_symbol_bullet(c: &str, font: Option<&str>) -> String { return m.to_string(); } let m = match code { + 0x6d if f.starts_with("monotype sorts") => '○', + 0xf0 if f.contains("wingdings") => '⇨', 0xa7 => '▪', 0xd8 => '➢', 0xfc => '✓', diff --git a/crates/text/tests/autocraft_regression_1935.rs b/crates/text/tests/autocraft_regression_1935.rs new file mode 100644 index 000000000..77f48211c --- /dev/null +++ b/crates/text/tests/autocraft_regression_1935.rs @@ -0,0 +1,12 @@ +use deckcraft_text::map_symbol_bullet; + +#[test] +fn monotype_sorts_m_bullet_is_open_circle() { + assert_eq!(map_symbol_bullet("m", Some("Monotype Sorts")), "\u{25CB}"); +} + +#[test] +fn wingdings_eth_bullet_is_right_arrow() { + assert_eq!(map_symbol_bullet("\u{f0}", Some("Wingdings")), "\u{21E8}"); + assert_eq!(map_symbol_bullet("\u{f0f0}", Some("Wingdings")), "\u{21E8}"); +}