Skip to content

Commit 27ed99c

Browse files
committed
Update rust-fontconfig and azul version
1 parent a181ed7 commit 27ed99c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ serde = { version = "1" }
3030
serde_derive = { version = "1" }
3131
flate2 = "1.0.35" # for decompression of builtin fonts
3232
# feature=html, independent of feature=wasm
33-
rust-fontconfig = { version = "0.1.13", default-features = false, optional = true }
33+
rust-fontconfig = { version = "1.0.0", default-features = false, features = ["std", "parsing"], optional = true }
3434
xmlparser = { version = "0.13.6", default-features = false, optional = true }
3535
serde_json = { version = "1", optional = true }
3636
web-sys = { version = "0.3.77", optional = true, default-features = false, features = ["ImageData", "Window", "Document", "Blob", "CanvasRenderingContext2d", "HtmlCanvasElement", "HtmlImageElement", "ImageBitmap", "BlobPropertyBag"]}
3737
wasm-bindgen-futures = { version = "0.4.50", optional = true, default-features = false }
3838
kuchiki = { version = "0.8.1", optional = true }
39-
azul-css = { git = "https://github.com/fschutt/azul", rev = "2f75a527", default-features = false, features = ["parser"], optional = true }
40-
azul-core = { git = "https://github.com/fschutt/azul", rev = "2f75a527", default-features = false, features = ["std"], optional = true }
41-
azul-layout = { git = "https://github.com/fschutt/azul", rev = "2f75a527", default-features = false, features = ["std", "text_layout", "font_loading", "xml"], optional = true }
39+
azul-css = { git = "https://github.com/fschutt/azul", rev = "193ed827", default-features = false, features = ["parser"], optional = true }
40+
azul-core = { git = "https://github.com/fschutt/azul", rev = "193ed827", default-features = false, features = ["std"], optional = true }
41+
azul-layout = { git = "https://github.com/fschutt/azul", rev = "193ed827", default-features = false, features = ["std", "text_layout", "font_loading", "xml"], optional = true }
4242
weezl = "0.1.8"
4343

4444
[target.'cfg(target_family = "wasm")'.dependencies]

src/html.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ pub(crate) fn xml_to_pages(
217217
fn get_fc_cache(fonts: &BTreeMap<String, Vec<u8>>) -> FcFontCache {
218218
let mut fc_cache = FcFontCache::default();
219219
fc_cache
220-
.with_memory_fonts(&get_system_fonts())
221-
.with_memory_fonts(&[
220+
.with_memory_fonts(get_system_fonts())
221+
.with_memory_fonts(vec![
222222
get_fcpat(BuiltinFont::TimesRoman),
223223
get_fcpat(BuiltinFont::TimesBold),
224224
get_fcpat(BuiltinFont::TimesItalic),
@@ -235,7 +235,7 @@ fn get_fc_cache(fonts: &BTreeMap<String, Vec<u8>>) -> FcFontCache {
235235
get_fcpat(BuiltinFont::ZapfDingbats),
236236
])
237237
.with_memory_fonts(
238-
&fonts
238+
fonts
239239
.iter()
240240
.filter_map(|(id, bytes)| {
241241
// let bytes = base64::prelude::BASE64_STANDARD.decode(font_base64).ok()?;
@@ -244,6 +244,7 @@ fn get_fc_cache(fonts: &BTreeMap<String, Vec<u8>>) -> FcFontCache {
244244
..Default::default()
245245
};
246246
let font = FcFont {
247+
id: id.to_string(),
247248
bytes: bytes.clone(),
248249
font_index: 0,
249250
};
@@ -257,7 +258,9 @@ fn get_fc_cache(fonts: &BTreeMap<String, Vec<u8>>) -> FcFontCache {
257258
#[test]
258259
fn test_default_font() {
259260
let fc_cache = get_fc_cache(&BTreeMap::new());
260-
println!("default font: {:?}", fc_cache.query(&FcPattern::default()));
261+
let mut msg = Vec::new();
262+
println!("default font: {:?}", fc_cache.query(&FcPattern::default(), &mut msg));
263+
println!("{msg:#?}");
261264
}
262265

263266
fn xml_to_pages_inner(
@@ -381,6 +384,7 @@ fn get_system_fonts() -> Vec<(FcPattern, FcFont)> {
381384
..Default::default()
382385
},
383386
FcFont {
387+
id: id.to_string(),
384388
bytes: subset_font.bytes.clone(),
385389
font_index: 0,
386390
},
@@ -408,6 +412,7 @@ fn get_fcpat(b: BuiltinFont) -> (FcPattern, FcFont) {
408412
..Default::default()
409413
},
410414
FcFont {
415+
id: b.get_id().to_string(),
411416
bytes: subset_font.bytes.clone(),
412417
font_index: 0,
413418
},

0 commit comments

Comments
 (0)