diff options
Diffstat (limited to '')
-rw-r--r-- | examples/checkbox/src/main.rs | 3 | ||||
-rw-r--r-- | tiny_skia/Cargo.toml | 2 | ||||
-rw-r--r-- | tiny_skia/src/text.rs | 9 | ||||
-rw-r--r-- | wgpu/Cargo.toml | 2 | ||||
-rw-r--r-- | wgpu/src/text.rs | 9 |
5 files changed, 20 insertions, 5 deletions
diff --git a/examples/checkbox/src/main.rs b/examples/checkbox/src/main.rs index c5f3c134..5852e978 100644 --- a/examples/checkbox/src/main.rs +++ b/examples/checkbox/src/main.rs @@ -1,6 +1,6 @@ use iced::executor; use iced::font::{self, Font}; -use iced::widget::{checkbox, column, container}; +use iced::widget::{checkbox, column, container, text}; use iced::{Application, Command, Element, Length, Settings, Theme}; const ICON_FONT: Font = Font::with_name("icons"); @@ -59,6 +59,7 @@ impl Application for Example { font: ICON_FONT, code_point: '\u{e901}', size: None, + shaping: text::Shaping::Basic, }); let content = column![default_checkbox, custom_checkbox].spacing(22); diff --git a/tiny_skia/Cargo.toml b/tiny_skia/Cargo.toml index 32645ac1..400eee6a 100644 --- a/tiny_skia/Cargo.toml +++ b/tiny_skia/Cargo.toml @@ -24,7 +24,7 @@ features = ["tiny-skia"] [dependencies.cosmic-text] git = "https://github.com/hecrj/cosmic-text.git" -rev = "ad111a1df10d5da503620f4b841de5d41ebd4e73" +rev = "b85d6a4f2376f8a8a7dadc0f8bcb89d4db10a1c9" [dependencies.twox-hash] version = "1.6" diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index a63da193..58079cc0 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -229,6 +229,13 @@ fn to_stretch(stretch: font::Stretch) -> cosmic_text::Stretch { } } +fn to_shaping(shaping: Shaping) -> cosmic_text::Shaping { + match shaping { + Shaping::Basic => cosmic_text::Shaping::Basic, + Shaping::Advanced => cosmic_text::Shaping::Advanced, + } +} + #[derive(Debug, Clone, Default)] struct GlyphCache { entries: FxHashMap< @@ -396,7 +403,7 @@ impl Cache { .family(to_family(key.font.family)) .weight(to_weight(key.font.weight)) .stretch(to_stretch(key.font.stretch)), - matches!(key.shaping, Shaping::Basic), + to_shaping(key.shaping), ); let _ = entry.insert(buffer); diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 254d32d6..6934ae49 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -44,7 +44,7 @@ path = "../graphics" [dependencies.glyphon] version = "0.2" git = "https://github.com/hecrj/glyphon.git" -rev = "446cf0803065b52ba5fb9a30fe0addb6d7b5f9d9" +rev = "504aa8a9a1fb42726f02fa244b70119e7ca25933" [dependencies.encase] version = "0.3.0" diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index fc126125..ad7bdc8d 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -311,6 +311,13 @@ fn to_stretch(stretch: font::Stretch) -> glyphon::Stretch { } } +fn to_shaping(shaping: Shaping) -> glyphon::Shaping { + match shaping { + Shaping::Basic => glyphon::Shaping::Basic, + Shaping::Advanced => glyphon::Shaping::Advanced, + } +} + struct Cache { entries: FxHashMap<KeyHash, glyphon::Buffer>, recently_used: FxHashSet<KeyHash>, @@ -369,7 +376,7 @@ impl Cache { .family(to_family(key.font.family)) .weight(to_weight(key.font.weight)) .stretch(to_stretch(key.font.stretch)), - matches!(key.shaping, Shaping::Basic), + to_shaping(key.shaping), ); let _ = entry.insert(buffer); |