Make FontSystem not self-referencing

This commit is contained in:
Edgar Geier 2023-03-01 02:50:10 +01:00
parent 0548d7ae59
commit 506a4194be
No known key found for this signature in database
GPG key ID: 7A65B51FD6B75EF5
10 changed files with 206 additions and 175 deletions

View file

@ -20,10 +20,10 @@ fn swash_image(
context: &mut ScaleContext,
cache_key: CacheKey,
) -> Option<SwashImage> {
let font = match font_system.get_font(cache_key.font_id) {
let font = match font_system.get_font(cache_key.font_key) {
Some(some) => some,
None => {
log::warn!("did not find font {:?}", cache_key.font_id);
log::warn!("did not find font {:?}", cache_key.font_key.id);
return None;
}
};
@ -63,10 +63,10 @@ fn swash_outline_commands(
) -> Option<Vec<swash::zeno::Command>> {
use swash::zeno::PathData as _;
let font = match font_system.get_font(cache_key.font_id) {
let font = match font_system.get_font(cache_key.font_key) {
Some(some) => some,
None => {
log::warn!("did not find font {:?}", cache_key.font_id);
log::warn!("did not find font {:?}", cache_key.font_key.id);
return None;
}
};