Update glyphon and cosmic-text

This commit is contained in:
Héctor Ramón Jiménez 2023-05-02 00:58:33 +02:00
parent 4bd290afe7
commit edf3432bf5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 20 additions and 5 deletions

View file

@ -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);