Skip to content

Implement and enable canvas-based text measurement #33523

@mdebbar

Description

@mdebbar

Description

Today, we do text measurement using the DOM. That's too slow and we are stuck with whatever CSS supports. For example, we can't do multi-line text overflow correctly because CSS doesn't support it.

Early results are very promising in terms of correctness and performance.

This new implementation will also open the door to more improvements like rendering multi-line text in canvas (instead of using a <p> element).

How to enable

To enable the new experimental implementation, you could add the --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true flag to your flutter run command (it only works in release mode). Example:

flutter run -d web-server --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true

Tasks

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: typographyText rendering, possibly libtxtc: performanceRelates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.frameworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specifically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions