-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#19924Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms bettera: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyWeb applications specifically
Milestone
Description
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
- Handle basic measurements.
- Full support of text overflow and clipping (
maxLines,textOverflow). - Render multi-line text on canvas.
- Support
letterSpacingandbackgroundColor. - Correct algorithm for line break opportunities ([web] Implement the algorithm for finding line-break opportunities #45932).
- Correct measurement of emojis ([web] Text with emojis or Chinese characters is clipped #40221).
deckerst, maxnemoy, hillelcoren, jamesblasco, rpk98c and 16 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms bettera: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyWeb applications specifically