diff options
author | 2023-01-06 23:29:38 +0100 | |
---|---|---|
committer | 2023-02-24 13:17:58 +0100 | |
commit | b9a9576207ddfc7afd89da30b7cfc7ca0d7e335c (patch) | |
tree | c0b4489f1e547fc335e6b82025891cefdc671274 /graphics | |
parent | 573d27eb52bbfacf1b06983b4282f00eb5265bdc (diff) | |
download | iced-b9a9576207ddfc7afd89da30b7cfc7ca0d7e335c.tar.gz iced-b9a9576207ddfc7afd89da30b7cfc7ca0d7e335c.tar.bz2 iced-b9a9576207ddfc7afd89da30b7cfc7ca0d7e335c.zip |
Remove `iced_glow`, `glyph-brush`, and `wgpu_glyph` dependencies
Diffstat (limited to '')
-rw-r--r-- | graphics/Cargo.toml | 7 | ||||
-rw-r--r-- | graphics/src/font.rs | 35 | ||||
-rw-r--r-- | graphics/src/font/source.rs | 45 | ||||
-rw-r--r-- | graphics/src/lib.rs | 1 |
4 files changed, 0 insertions, 88 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml index 13ab61d8..19d6af0c 100644 --- a/graphics/Cargo.toml +++ b/graphics/Cargo.toml @@ -26,9 +26,6 @@ dds = ["image_rs/dds"] farbfeld = ["image_rs/farbfeld"] canvas = ["lyon"] qr_code = ["qrcode", "canvas"] -font-source = ["font-kit"] -font-fallback = [] -font-icons = [] opengl = [] image_rs = ["kamadak-exif"] @@ -60,10 +57,6 @@ version = "0.12" optional = true default-features = false -[dependencies.font-kit] -version = "0.10" -optional = true - [dependencies.image_rs] version = "0.24" package = "image" diff --git a/graphics/src/font.rs b/graphics/src/font.rs deleted file mode 100644 index d55d0faf..00000000 --- a/graphics/src/font.rs +++ /dev/null @@ -1,35 +0,0 @@ -//! Find system fonts or use the built-in ones. -#[cfg(feature = "font-source")] -mod source; - -#[cfg(feature = "font-source")] -#[cfg_attr(docsrs, doc(cfg(feature = "font-source")))] -pub use source::Source; - -#[cfg(feature = "font-source")] -#[cfg_attr(docsrs, doc(cfg(feature = "font-source")))] -pub use font_kit::{ - error::SelectionError as LoadError, family_name::FamilyName as Family, -}; - -/// A built-in fallback font, for convenience. -#[cfg(feature = "font-fallback")] -#[cfg_attr(docsrs, doc(cfg(feature = "font-fallback")))] -pub const FALLBACK: &[u8] = include_bytes!("../fonts/Lato-Regular.ttf"); - -/// A built-in icon font, for convenience. -#[cfg(feature = "font-icons")] -#[cfg_attr(docsrs, doc(cfg(feature = "font-icons")))] -pub const ICONS: iced_native::Font = iced_native::Font::External { - name: "iced_wgpu icons", - bytes: include_bytes!("../fonts/Icons.ttf"), -}; - -/// The `char` representing a ✔ icon in the built-in [`ICONS`] font. -#[cfg(feature = "font-icons")] -#[cfg_attr(docsrs, doc(cfg(feature = "font-icons")))] -pub const CHECKMARK_ICON: char = '\u{F00C}'; - -/// The `char` representing a ▼ icon in the built-in [`ICONS`] font. -#[cfg(feature = "font-icons")] -pub const ARROW_DOWN_ICON: char = '\u{E800}'; diff --git a/graphics/src/font/source.rs b/graphics/src/font/source.rs deleted file mode 100644 index c0b50e1d..00000000 --- a/graphics/src/font/source.rs +++ /dev/null @@ -1,45 +0,0 @@ -use crate::font::{Family, LoadError}; - -/// A font source that can find and load system fonts. -#[allow(missing_debug_implementations)] -pub struct Source { - raw: font_kit::source::SystemSource, -} - -impl Source { - /// Creates a new [`Source`]. - pub fn new() -> Self { - Source { - raw: font_kit::source::SystemSource::new(), - } - } - - /// Finds and loads a font matching the set of provided family priorities. - pub fn load(&self, families: &[Family]) -> Result<Vec<u8>, LoadError> { - let font = self.raw.select_best_match( - families, - &font_kit::properties::Properties::default(), - )?; - - match font { - font_kit::handle::Handle::Path { path, .. } => { - use std::io::Read; - - let mut buf = Vec::new(); - let mut reader = std::fs::File::open(path).expect("Read font"); - let _ = reader.read_to_end(&mut buf); - - Ok(buf) - } - font_kit::handle::Handle::Memory { bytes, .. } => { - Ok(bytes.as_ref().clone()) - } - } - } -} - -impl Default for Source { - fn default() -> Self { - Self::new() - } -} diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index d39dd90c..41bef2c3 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -28,7 +28,6 @@ mod transformation; mod viewport; pub mod backend; -pub mod font; pub mod gradient; pub mod image; pub mod layer; |