Upgrade to fontdue 0.8

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
This commit is contained in:
今何求 2023-11-29 17:52:27 +08:00 committed by GitHub
parent 3e71d1b559
commit 607bdbfcf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 5 deletions

View file

@ -58,7 +58,7 @@ linked_hash_set = "0.1.4"
image = { version = "0.24", optional = true }
resvg = { workspace = true, optional = true }
# font embedding
fontdue = { version = "0.7.1", optional = true }
fontdue = { workspace = true, optional = true }
[dev-dependencies]
i-slint-parser-test-macro = { path = "./parser-test-macro" }

View file

@ -200,7 +200,7 @@ fn embed_glyphs_with_fontdb<'a>(
fontdb.with_face_data(face_id, |font_data, face_index| {
let fontdue_font = match fontdue::Font::from_bytes(
font_data,
fontdue::FontSettings { collection_index: face_index, scale: 40. },
fontdue::FontSettings { collection_index: face_index, scale: 40., ..Default::default() },
) {
Ok(fontdue_font) => fontdue_font,
Err(fontdue_msg) => {
@ -321,7 +321,11 @@ fn get_fallback_fonts(fontdb: &sharedfontdb::FontDatabase) -> Vec<fontdue::Font>
.with_face_data(face_id, |face_data, face_index| {
fontdue::Font::from_bytes(
face_data,
fontdue::FontSettings { collection_index: face_index, scale: 40. },
fontdue::FontSettings {
collection_index: face_index,
scale: 40.,
..Default::default()
},
)
.ok()
})