Skip to content

[WIP] Text engine Refactor #585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft

[WIP] Text engine Refactor #585

wants to merge 40 commits into from

Conversation

wouterlucas
Copy link
Contributor

@wouterlucas wouterlucas commented Jun 10, 2025

Related to #483

Work in progress:

  • Stage / init cleanup (done)
  • Canvas text engine rewrite
  • SDF text engine rewrite
  • Text Loader rewrite
  • Update tests
  • Validation
  • Benchmarks

wouterlucas and others added 19 commits June 7, 2025 22:44
Lets resolve fonts a little quicker.
Going to a distributed font handler instead of a central one that did both
Pureify the old TrFontManager that had a bunch of unused complicated code for weighting.
…Face, and updating FontFamilyMap to use FontFace directly
- Added `calculateRenderInfo.ts` for calculating text rendering metrics and layout.
- Implemented `draw.ts` for rendering text onto canvas with support for highlights and shadows.
- Removed the deprecated `LightningTextTextureRenderer.ts` to streamline text rendering.
Copy link
Collaborator

@jfboeve jfboeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks promising

wouterlucas and others added 11 commits July 15, 2025 22:22
6x slowdown:

with this PR: create: 268.96ms ±18.12
without: create: 743.60ms ±38.26

for reference:
beta 9: create: 426.59ms ±40.61

This does include `{ willReadFrequently: true }` as it did have a
serious impact on perf in Chrome - we will need to test on a WPE device
to get the impact on a real device. I'd imagine GPU vs CPU rendering to
be of a bigger impact there.
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.

2 participants