Update glyphon and cosmic-text
This commit is contained in:
parent
4bd290afe7
commit
edf3432bf5
5 changed files with 20 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue