From 3054babe0e9ff2a9b246ab2a8f22c278142bdde6 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 11 Oct 2026 16:14:41 -0400 Subject: [PATCH] Text boxes: their typefaces count as used workbook fonts, so an installed one is bound; restore image_ext's doc comment (review fix-up for #401) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lib.rs | 2 ++ crates/xlsx/src/drawing.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 202fcc40c..9ef0d50b9 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -300,6 +300,8 @@ impl SheetApp { names.extend(d.wb.styles.iter().map(|(_, s)| s.font.name.clone())); names.push(d.wb.theme.major_font.clone()); names.push(d.wb.theme.minor_font.clone()); + // Text boxes and shapes name their own typefaces. + names.extend(d.wb.sheets.iter().flat_map(|sh| sh.shapes.iter().filter_map(|s| s.format.font.clone()))); } names } diff --git a/crates/xlsx/src/drawing.rs b/crates/xlsx/src/drawing.rs index 342234165..076148a53 100644 --- a/crates/xlsx/src/drawing.rs +++ b/crates/xlsx/src/drawing.rs @@ -433,7 +433,6 @@ pub fn write_drawing(sheet: &Sheet, theme: &Theme, objs: &[Obj<'_>]) -> String { s } -/// File extension for an image MIME type. /// A text run's `a:rPr` attributes (size, bold, italic) and children in schema order (outline, /// fill, typeface). fn run_props(f: &ShapeFormat, theme: &Theme) -> (String, String) { @@ -463,6 +462,7 @@ fn run_props(f: &ShapeFormat, theme: &Theme) -> (String, String) { (attrs, body) } +/// File extension for an image MIME type. pub fn image_ext(mime: &str, data: &[u8]) -> &'static str { match mime.to_ascii_lowercase().as_str() { "image/png" => "png",