I was doing some tests with skia-safe and winit to render a window with text although the text is not displayed in the window.
in the code a triangle and a text should be rendered the triangle is rendered the text is not.
this is my deps
[dependencies]
anyhow = "1.0.88"
clap = { version = "4.5.17", features = ["derive"] }
clap-verbosity-flag = "2.2.1"
colored = "2.1.0"
dirs = "5.0.1"
env_logger = "0.11.5"
gl = "0.14.0"
glutin = "0.32.1"
glutin-winit = "0.5.0"
mlua = { version = "0.9.9", features = ["lua54"] }
raw-window-handle = "0.6.2"
serde = { version = "1.0.210", features = ["derive"] }
skia-safe = { version = "0.78.0", features = ["all-linux"] }
toml = "0.8.19"
winit = "0.30.5"
this is my code
if draw_frame {
self.frame += 1;
let canvas = self.env.surface.canvas();
canvas.clear(Color::WHITE);
let mut paint = Paint::default();
paint.set_color(Color::BLACK);
paint.set_anti_alias(true);
let points = [
Point::new(100.0, 100.0),
Point::new(150.0, 50.0),
Point::new(200.0, 100.0),
];
let mut path = skia_safe::Path::new();
path.move_to(points[0]);
path.line_to(points[1]);
path.close();
canvas.draw_path(&path, &paint);
let font = Font::default();
let text = "Test";
let blob = TextBlob::new(text, &font).unwrap();
canvas.draw_text_blob(&blob, Point::new(100.0, 150.0), &paint);
self.env.gr_context.flush_and_submit();
self.env
.gl_surface
.swap_buffers(&self.env.gl_context)
.expect("Error: failed to swap buffers");
}