summaryrefslogtreecommitdiffstats
path: root/graphics/src
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src')
-rw-r--r--graphics/src/text.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/graphics/src/text.rs b/graphics/src/text.rs
index 217a23e2..0310ead7 100644
--- a/graphics/src/text.rs
+++ b/graphics/src/text.rs
@@ -17,6 +17,15 @@ use once_cell::sync::OnceCell;
use std::borrow::Cow;
use std::sync::{Arc, RwLock, Weak};
+/// The regular variant of the [Fira Sans] font.
+///
+/// It is loaded as part of the default fonts in Wasm builds.
+///
+/// [Fira Sans]: https://mozilla.github.io/Fira/
+#[cfg(all(target_arch = "wasm32", feature = "fira-sans"))]
+pub const FIRA_SANS_REGULAR: &'static [u8] =
+ include_bytes!("../fonts/FiraSans-Regular.ttf").as_slice();
+
/// Returns the global [`FontSystem`].
pub fn font_system() -> &'static RwLock<FontSystem> {
static FONT_SYSTEM: OnceCell<RwLock<FontSystem>> = OnceCell::new();
@@ -27,6 +36,10 @@ pub fn font_system() -> &'static RwLock<FontSystem> {
cosmic_text::fontdb::Source::Binary(Arc::new(
include_bytes!("../fonts/Iced-Icons.ttf").as_slice(),
)),
+ #[cfg(all(target_arch = "wasm32", feature = "fira-sans"))]
+ cosmic_text::fontdb::Source::Binary(Arc::new(
+ include_bytes!("../fonts/FiraSans-Regular.ttf").as_slice(),
+ )),
]),
version: Version::default(),
})