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 1/2] 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}"); +} From 77d0ad61c222b9b3f94081a8c427dff97b6684df Mon Sep 17 00:00:00 2001 From: aiongg <67543387+aiongg@users.noreply.github.com> Date: Sat, 7 Nov 2026 10:53:38 +0000 Subject: [PATCH 2/2] Apply review fixes - crates/text/src/symbol.rs --- crates/text/src/symbol.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/text/src/symbol.rs b/crates/text/src/symbol.rs index 5fee4e382..5a33b04cd 100644 --- a/crates/text/src/symbol.rs +++ b/crates/text/src/symbol.rs @@ -3,7 +3,7 @@ use super::{FontFace, UnicodeSegmentation}; /// Is `family` a symbol font (characters at U+F000 + code)? pub(crate) fn is_symbol_font(family: &str) -> bool { let f = family.to_ascii_lowercase(); - f.starts_with("wingdings") || f == "symbol" || f.starts_with("webdings") || f.starts_with("marlett") + f.starts_with("wingdings") || f == "symbol" || f.starts_with("webdings") || f.starts_with("marlett") || f.starts_with("monotype sorts") } /// Does `face` draw the symbol-font character `c` (a U+F0xx private-use code)? Either directly at @@ -277,7 +277,11 @@ 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.starts_with("monotype sorts") || f == "symbol" || (font.is_none() && ('\u{f000}'..='\u{f0ff}').contains(&first)) { + if f.contains("wingdings") + || (f.starts_with("monotype sorts") && ((first as u32) < 0x100 || ('\u{f000}'..='\u{f0ff}').contains(&first))) + || 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") {