API: Remove backend from GlyphRunBuilder?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.3k
- Forks
- 300
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
Apologies if I get anything wrong in this issue.
I'm writing a program that is generic over `vello_gpu` and `vello_cpu`. The fact that `GlyphRunBuilder` is generic over the backend is somewhat inconvenient for this use. After checking the code, it seems that the backend is not used until `fill_glyphs` / `stroke_glyphs` / `render_decoration` is called.
Would it be possible to have an API more like this, where the glyph run can be built independently? The backend would only be created on the proposed `Scene.prepare_glyph_run` call
```rust
let glyph_run = GlyphRunBuilder::new(font)
.normalized_coords(normalized_coords)
.font_size(font_size)
.etc(..)
.build();
let prepared = scene.prepare_glyph_run(glyph_run);
prepared.fill_glyphs();
prepared.stroke_glyphs();
```
I tried to read the glifo code and understand if this would be possible, sorry if it isn't.
Thank you for all the great work on vello!
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
Start by tracing GlyphRunBuilder and the glifo code paths used by fill_glyphs, stroke_glyphs, and render_decoration. Determine whether glyph runs can be built without a backend and define the API and tests needed for scene.prepare_glyph_run to create the backend-dependent prepared value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100