Fill property not being respected on text
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 348
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
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:
```rs
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,
);
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository file or test. Start by obtaining the attached Typst-generated SVG and reproducing it with the shown Rust snippet, then compare the rendered text fills with the expected output. Done means the fill behavior is corrected or clearly narrowed to an SVG-spec issue, with a regression test for the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100