linebender / linebender/piet

implement TextLayout::image_bounds on web

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

piet-web
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.