From 2a3b3e666140d76ecdd5edfd5d4d3808c83d03b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20K=C3=B6kden?= Date: Wed, 7 Oct 2026 21:23:57 +0200 Subject: [PATCH] Fonts: read Microsoft Office's bundled fonts on macOS --- crates/fonts/src/fontdb.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/fonts/src/fontdb.rs b/crates/fonts/src/fontdb.rs index f67ff59..8fdc744 100644 --- a/crates/fonts/src/fontdb.rs +++ b/crates/fonts/src/fontdb.rs @@ -356,6 +356,13 @@ pub fn system_font_dirs() -> Vec { } } } + // Microsoft Office bundles its fonts (Calibri, Cambria, …) inside each app; read them in + // place from the first installed one (they share the same set). + let office = ["Microsoft Word", "Microsoft Excel", "Microsoft PowerPoint", "Microsoft Outlook"] + .iter() + .map(|app| std::path::PathBuf::from(format!("/Applications/{app}.app/Contents/Resources/DFonts"))) + .find(|p| p.is_dir()); + dirs.extend(office); } else if cfg!(windows) { let root = std::env::var_os("WINDIR").map(std::path::PathBuf::from).unwrap_or_else(|| "C:\\Windows".into()); dirs.push(root.join("Fonts"));