Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Integration: FontDb::system_fonts_cataloged builds on wasm (#394)

aionggef65f39b9390
diff --git a/crates/fonts/src/fontdb.rs b/crates/fonts/src/fontdb.rs
index f4f1dff1d..fad0b35cc 100644
--- a/crates/fonts/src/fontdb.rs
+++ b/crates/fonts/src/fontdb.rs
@@ -1013,7 +1013,10 @@ impl FontDb {
/// Whether the installed fonts are cataloged: a lookup by family name won't wait for the
/// scan (always true on wasm, which has none). See [`FontDb::scan_in_background`].
pub fn system_fonts_cataloged(&self) -> bool {
- cfg!(target_arch = "wasm32") || self.cataloged.get().is_some()
+ #[cfg(target_arch = "wasm32")]
+ return true;
+ #[cfg(not(target_arch = "wasm32"))]
+ self.cataloged.get().is_some()
}
/// Catalog the installed fonts on a background thread, so the first lookup by family name