summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 20:30:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 20:30:46 +0200
commitf0480854a9cd76f443848dbfa14256089b56abfe (patch)
treec19af18f58e3bdb1cc4bf53e9b207b253b3ab99e /graphics
parente0c4f1a08e756f11c30a99cd739fe78267e5040b (diff)
downloadiced-f0480854a9cd76f443848dbfa14256089b56abfe.tar.gz
iced-f0480854a9cd76f443848dbfa14256089b56abfe.tar.bz2
iced-f0480854a9cd76f443848dbfa14256089b56abfe.zip
Move built-in fonts to `iced_graphics`
Diffstat (limited to '')
-rw-r--r--graphics/Cargo.toml2
-rw-r--r--graphics/fonts/Icons.ttf (renamed from glow/src/text/icons.ttf)bin4912 -> 4912 bytes
-rw-r--r--graphics/fonts/Lato-Regular.ttf (renamed from wgpu/fonts/Lato-Regular.ttf)bin75136 -> 75136 bytes
-rw-r--r--graphics/fonts/OFL.txt (renamed from wgpu/fonts/OFL.txt)0
-rw-r--r--graphics/src/font.rs12
5 files changed, 14 insertions, 0 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml
index c937763c..61f1f6d4 100644
--- a/graphics/Cargo.toml
+++ b/graphics/Cargo.toml
@@ -7,6 +7,8 @@ edition = "2018"
[features]
canvas = ["lyon"]
font-source = ["font-kit"]
+font-fallback = []
+font-icons = []
[dependencies]
bytemuck = "1.2"
diff --git a/glow/src/text/icons.ttf b/graphics/fonts/Icons.ttf
index 1c832f86..1c832f86 100644
--- a/glow/src/text/icons.ttf
+++ b/graphics/fonts/Icons.ttf
Binary files differ
diff --git a/wgpu/fonts/Lato-Regular.ttf b/graphics/fonts/Lato-Regular.ttf
index 33eba8b1..33eba8b1 100644
--- a/wgpu/fonts/Lato-Regular.ttf
+++ b/graphics/fonts/Lato-Regular.ttf
Binary files differ
diff --git a/wgpu/fonts/OFL.txt b/graphics/fonts/OFL.txt
index dfca0da4..dfca0da4 100644
--- a/wgpu/fonts/OFL.txt
+++ b/graphics/fonts/OFL.txt
diff --git a/graphics/src/font.rs b/graphics/src/font.rs
index 3890beba..a490e609 100644
--- a/graphics/src/font.rs
+++ b/graphics/src/font.rs
@@ -8,3 +8,15 @@ pub use source::Source;
pub use font_kit::{
error::SelectionError as LoadError, family_name::FamilyName as Family,
};
+
+#[cfg(feature = "font-fallback")]
+pub const FALLBACK: &[u8] = include_bytes!("../fonts/Lato-Regular.ttf");
+
+#[cfg(feature = "font-icons")]
+pub const ICONS: iced_native::Font = iced_native::Font::External {
+ name: "iced_wgpu icons",
+ bytes: include_bytes!("../fonts/Icons.ttf"),
+};
+
+#[cfg(feature = "font-icons")]
+pub const CHECKMARK_ICON: char = '\u{F00C}';