Skip to content

Commit af8d9b4

Browse files
committed
Switch femtovg branch
1 parent 9f0b0e1 commit af8d9b4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

internal/renderers/femtovg/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ derive_more = { workspace = true }
3434
lyon_path = "1.0"
3535
pin-weak = "1"
3636
scoped-tls-hkt = "0.1"
37-
femtovg = { git = "https://github.com/slint-ui/femtovg", branch = "simon/draw-glyphs" }
37+
femtovg = { git = "https://github.com/slint-ui/femtovg", branch = "simon/draw-glyph-run" }
3838
ttf-parser = { workspace = true }
3939
unicode-script = { version = "0.5.4" } # Use the same version was femtovg's rustybuzz, to avoid duplicate crates
4040
imgref = { version = "1.6.1" }

internal/renderers/femtovg/itemrenderer.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,22 +215,21 @@ fn draw_glyphs<R: femtovg::Renderer + TextureImporter>(
215215
femtovg::PositionedGlyph {
216216
x: glyph.x,
217217
y: glyph.y + layout.y_offset,
218-
font_id,
219218
glyph_id: glyph.id,
220219
}
221220
});
222221

223222
match brush.stroke {
224223
Some(i_slint_core::items::TextStrokeStyle::Outside) => {
225-
canvas.stroke_glyphs(glyphs.clone(), paint).unwrap();
226-
canvas.fill_glyphs(glyphs, paint).unwrap();
224+
canvas.stroke_glyph_run(font_id, glyphs.clone(), paint).unwrap();
225+
canvas.fill_glyph_run(font_id, glyphs, paint).unwrap();
227226
}
228227
Some(i_slint_core::items::TextStrokeStyle::Center) => {
229-
canvas.fill_glyphs(glyphs.clone(), paint).unwrap();
230-
canvas.stroke_glyphs(glyphs, paint).unwrap();
228+
canvas.fill_glyph_run(font_id, glyphs.clone(), paint).unwrap();
229+
canvas.stroke_glyph_run(font_id, glyphs, paint).unwrap();
231230
}
232231
None => {
233-
canvas.fill_glyphs(glyphs, paint).unwrap();
232+
canvas.fill_glyph_run(font_id, glyphs, paint).unwrap();
234233
}
235234
}
236235
}

0 commit comments

Comments
 (0)