Remove iced_glow, glyph-brush, and wgpu_glyph dependencies
This commit is contained in:
parent
573d27eb52
commit
b9a9576207
47 changed files with 30 additions and 3846 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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}';
|
||||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,6 @@ mod transformation;
|
|||
mod viewport;
|
||||
|
||||
pub mod backend;
|
||||
pub mod font;
|
||||
pub mod gradient;
|
||||
pub mod image;
|
||||
pub mod layer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue