This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Web] Draw tab characters as single space#36107
Merged
auto-submit[bot] merged 6 commits intoflutter:mainfrom Sep 14, 2022
Merged
[Web] Draw tab characters as single space#36107auto-submit[bot] merged 6 commits intoflutter:mainfrom
auto-submit[bot] merged 6 commits intoflutter:mainfrom
Conversation
loic-sharma
commented
Sep 12, 2022
| } | ||
| } | ||
| return true; | ||
| } |
Member
Author
There was a problem hiding this comment.
This is a copy of:
engine/testing/dart/canvas_test.dart
Lines 116 to 133 in 3cfc77d
Please let me know if there's a way to deduplicate this by sharing code between lib/web_ui and testing/dart!
mdebbar
approved these changes
Sep 13, 2022
harryterkelsen
approved these changes
Sep 14, 2022
Contributor
harryterkelsen
left a comment
There was a problem hiding this comment.
LGTM. Do you know if replaceTabCharacters will use the font's tab glyph if one is available? Or does it do the replacement no matter what?
Member
Author
|
@hterkelsen It'll do the replacement no matter what, which is consistent with how the other platforms work now. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 14, 2022
Oleh-Sv
pushed a commit
to Oleh-Sv/engine
that referenced
this pull request
Sep 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes Flutter web render tabs as a single space. Previously, tabs rendered differently depending on your platform:
This change was tested on this repro...
Here was the tab tofu fix for Windows: #34389
Part of flutter/flutter#79153.
Background
Most fonts don't have a glyph for
\t, so the "unknown" glyph should be selected and a tofu should be drawn. However, some platforms will override this using their own platform-specific logic and select the glyph for a single space instead. For more information, see: https://bugs.chromium.org/p/skia/issues/detail?id=12334Skia added a feature to substitute tabs with a single space so that platforms could behave consistently. This feature was added to CanvasKit in version 0.37.0 (skia#574296). This change enables this new feature on Flutter web, thereby making tabs no longer render as a tofu.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.