Skip to content

feat(canvas): typography API — canvas_text_ex and canvas_measure_text#40

Merged
niklabh merged 1 commit into
mainfrom
feat/typography-api
May 3, 2026
Merged

feat(canvas): typography API — canvas_text_ex and canvas_measure_text#40
niklabh merged 1 commit into
mainfrom
feat/typography-api

Conversation

@niklabh
Copy link
Copy Markdown
Owner

@niklabh niklabh commented May 3, 2026

Extends the canvas text path with explicit font family, weight (100..=900), style (normal/italic/oblique), and horizontal alignment. Adds synchronous text measurement (width, ascent, descent) backed by GPUI's WindowTextSystem, injected into HostState for the duration of each on_frame call. Ships a typography-demo example showcasing weight and style variants plus a measurement-driven underline.

Existing canvas_text and DrawCommand::Text paths are unchanged.

Extends the canvas text path with explicit font family, weight
(100..=900), style (normal/italic/oblique), and horizontal alignment.
Adds synchronous text measurement (width, ascent, descent) backed by
GPUI's WindowTextSystem, injected into HostState for the duration of
each on_frame call. Ships a typography-demo example showcasing weight
and style variants plus a measurement-driven underline.

Existing canvas_text and DrawCommand::Text paths are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@niklabh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 46 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cd02949-1f3a-4d8d-8732-3560f5f68c3f

📥 Commits

Reviewing files that changed from the base of the PR and between 95218a5 and e6fc45b.

⛔ Files ignored due to path filters (5)
  • oxide-landing/audio_player.wasm is excluded by !**/*.wasm
  • oxide-landing/events_demo.wasm is excluded by !**/*.wasm
  • oxide-landing/hello_oxide.wasm is excluded by !**/*.wasm
  • oxide-landing/index.wasm is excluded by !**/*.wasm
  • oxide-landing/timer_demo.wasm is excluded by !**/*.wasm
📒 Files selected for processing (6)
  • Cargo.toml
  • examples/typography-demo/Cargo.toml
  • examples/typography-demo/src/lib.rs
  • oxide-browser/src/capabilities.rs
  • oxide-browser/src/ui.rs
  • oxide-sdk/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/typography-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 29 minutes and 46 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@niklabh niklabh merged commit 0935d52 into main May 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant