-
Notifications
You must be signed in to change notification settings - Fork 298
Fill property not being respected on text #1038
Copy link
Copy link
Open
Description
I apologize if another issue already covers this; I'm not super knowledgeable about the SVG spec, so I'm not quite sure what should cover this.
I've got an SVG with coloured text, generated by Typst:
(Hopefully you should be able to use the above to get back an SVG file? If not let me know and I'll figure out another way -- perhaps a zip file?)
As you can see in the GitHub preview, the text is white & red, however when rendered with resvg, I get:
I'm not entirely sure if this is an error on my part, or if this is a bug in resvg.
My code essentially amounts to:
let tree = Tree::from_data(svg.as_bytes(), &Options::default())?;
let mut buffer = Pixmap::new(...);
buffer.data_mut().fill(0); // resetting from a previous render
let size = tree.size();
let transform = Transform::from_scale(
buffer.width() as f32 / size.width(),
buffer.height() as f32 / size.height(),
);
resvg::render(
&tree,
transform,
&mut buffer,
);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels