implement TextLayout::image_bounds on web
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
This was left as a stub in #238, but should get done eventually.
Yes, there are methods for this, see https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics (which it might be valid to link). I think the image bounds methods are implemented on all browsers which can reasonably run Rust, but for good measure it's probably best to sense at runtime.
_Originally posted by @raphlinus in https://github.com/linebender/piet/pull/238#discussion_r458232664_
Contributor guide
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 at the web implementation of TextLayout::image_bounds left as a stub in #238, then compare the needed metrics with the MDN TextMetrics documentation. Verify browser support at runtime as suggested; done means the web backend provides image bounds rather than leaving this method stubbed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100