Skip to content

Commit e9311c2

Browse files
committed
Update azul dependency
1 parent ccb7583 commit e9311c2

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ xmlparser = { version = "0.13.6", default-features = false, 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 = { path = "../azul/css", default-features = false, features = ["parser"], optional = true }
40-
azul-core = { path = "../azul/core", default-features = false, features = ["std"], optional = true }
41-
azul-layout = { path = "../azul/layout", default-features = false, features = ["std", "text_layout", "font_loading", "xml"], optional = true }
39+
azul-css = { git = "https://github.com/fschutt/azul", rev = "3fe83b9d4c8004ebe96ea0a77660c777fcd05bc8", default-features = false, features = ["parser"], optional = true }
40+
azul-core = { git = "https://github.com/fschutt/azul", rev = "3fe83b9d4c8004ebe96ea0a77660c777fcd05bc8", default-features = false, features = ["std"], optional = true }
41+
azul-layout = { git = "https://github.com/fschutt/azul", rev = "3fe83b9d4c8004ebe96ea0a77660c777fcd05bc8", 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/font.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ impl ParsedFont {
13351335

13361336
let mut index_to_cid: BTreeMap<u16, u16> = BTreeMap::new();
13371337

1338-
let mut font_type = FontType::default();
1338+
let font_type;
13391339
let glyph_records_decoded = if font.glyph_table_flags.contains(GlyphTableFlags::CFF)
13401340
&& provider.sfnt_version() == tag::OTTO
13411341
{
@@ -2246,8 +2246,8 @@ mod azul_convert {
22462246

22472247
pub(super) fn convert_to_azul_parsed_font(
22482248
font: &crate::font::ParsedFont,
2249-
) -> azul_layout::text2::shaping::ParsedFont {
2250-
azul_layout::text2::shaping::ParsedFont {
2249+
) -> azul_layout::parsedfont::ParsedFont {
2250+
azul_layout::parsedfont::ParsedFont {
22512251
font_metrics: convert_font_metrics(&font.font_metrics),
22522252
num_glyphs: font.num_glyphs,
22532253
hmtx_data: font.hmtx_data.clone(),
@@ -2344,21 +2344,26 @@ mod azul_convert {
23442344

23452345
fn convert_glyph_records(
23462346
records: &BTreeMap<u16, crate::font::OwnedGlyph>,
2347-
) -> BTreeMap<u16, azul_layout::text2::shaping::OwnedGlyph> {
2347+
) -> BTreeMap<u16, azul_layout::parsedfont::OwnedGlyph> {
23482348
records
23492349
.iter()
23502350
.map(|(k, v)| {
23512351
(
23522352
*k,
2353-
azul_layout::text2::shaping::OwnedGlyph {
2354-
bounding_box: azul_layout::text2::shaping::OwnedGlyphBoundingBox {
2353+
azul_layout::parsedfont::OwnedGlyph {
2354+
phantom_points: None,
2355+
unresolved_composite: Vec::new(),
2356+
bounding_box: azul_core::app_resources::OwnedGlyphBoundingBox {
23552357
max_x: v.bounding_box.max_x,
23562358
max_y: v.bounding_box.max_y,
23572359
min_x: v.bounding_box.min_x,
23582360
min_y: v.bounding_box.min_y,
23592361
},
23602362
horz_advance: v.horz_advance,
2361-
outline: v.outline.as_ref().map(|o| convert_glyph_outline(o)),
2363+
outline: match v.outline.as_ref().map(|o| convert_glyph_outline(o)) {
2364+
Some(s) => vec![s],
2365+
None => Vec::new(),
2366+
},
23622367
},
23632368
)
23642369
})
@@ -2367,15 +2372,15 @@ mod azul_convert {
23672372

23682373
fn convert_glyph_outline(
23692374
outline: &crate::font::GlyphOutline,
2370-
) -> azul_layout::text2::shaping::GlyphOutline {
2371-
azul_layout::text2::shaping::GlyphOutline {
2375+
) -> azul_core::app_resources::GlyphOutline {
2376+
azul_core::app_resources::GlyphOutline {
23722377
operations: convert_glyph_outline_operations(&outline.operations),
23732378
}
23742379
}
23752380

23762381
fn convert_glyph_outline_operations(
23772382
ops: &[crate::font::GlyphOutlineOperation],
2378-
) -> azul_layout::text2::shaping::GlyphOutlineOperationVec {
2383+
) -> azul_core::app_resources::GlyphOutlineOperationVec {
23792384
ops.iter()
23802385
.map(to_azul_glyph_outline_operation)
23812386
.collect::<Vec<_>>()
@@ -2385,12 +2390,8 @@ mod azul_convert {
23852390
/// Convert from printpdf GlyphOutlineOperation to azul_layout GlyphOutlineOperation
23862391
fn to_azul_glyph_outline_operation(
23872392
op: &crate::font::GlyphOutlineOperation,
2388-
) -> azul_layout::text2::shaping::GlyphOutlineOperation {
2389-
use azul_layout::text2::shaping::{
2390-
GlyphOutlineOperation as AzulOp, OutlineCubicTo, OutlineLineTo, OutlineMoveTo,
2391-
OutlineQuadTo,
2392-
};
2393-
2393+
) -> azul_core::app_resources::GlyphOutlineOperation {
2394+
use azul_core::app_resources::{GlyphOutlineOperation as AzulOp, OutlineQuadTo, OutlineLineTo, OutlineCubicTo, OutlineMoveTo};
23942395
use crate::font::GlyphOutlineOperation as PdfOp;
23952396

23962397
match op {

0 commit comments

Comments
 (0)