Repository navigation
[web] Render soft hyphens on CanvasKit - #194339
Merged
auto-submit[bot] merged 1 commit intoOct 16, 2026
Merged
Conversation
CanvasKit's ParagraphStyle gained renderSoftHyphens in Skia 327c15e8176e, which rolled in with flutter#193884. Set it the same way the native engine does: render the hyphen unless hyphens is Hyphens.hidden. The hyphen tests now run on every web renderer, and the TextPainter.hyphens docs no longer need a web caveat.
dbebawy
force-pushed
the
soft-hyphen-canvaskit-193506
branch
from
October 15, 2026 18:29
8a9407f to
6145a21
Compare
dbebawy
marked this pull request as ready for review
October 15, 2026 21:04
Contributor
Author
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables support for soft hyphens in the CanvasKit renderer by exposing and setting the renderSoftHyphens property on SkParagraphStyleProperties. It also updates the documentation to reflect this support and enables previously skipped tests for hyphens on CanvasKit. There are no review comments, so no feedback is provided.
This was referenced Oct 16, 2026
Contributor
|
@LongCatIsLooong wanna check this one as well? Thanks! |
LongCatIsLooong
approved these changes
Oct 16, 2026
This was referenced Oct 17, 2026
This was referenced Oct 19, 2026
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
Makes `Hyphens` work on the CanvasKit renderer, following flutter#193850 for Skwasm. CanvasKit's `ParagraphStyle` gained `renderSoftHyphens` in Skia (https://skia-review.googlesource.com/c/skia/+/1378836), which rolled into Flutter with flutter#193884. `CkParagraphStyle` now sets it the same way the native engine and Skwasm do: soft hyphens render at a line break unless `Hyphens.hidden` is set. Because CanvasKit is the default renderer for `flutter build web`, text containing U+00AD in most web apps now shows a hyphen at soft-hyphen line breaks, matching native and Skwasm. This also covers a `--wasm` app that falls back to CanvasKit. With both web renderers supported, the hyphen tests in `paragraph_builder_test.dart` and the `TextPainter` hyphen tests no longer skip on the web, and the `TextPainter.hyphens` docs drop the web caveat. WebParagraph, which is experimental and off by default, still ignores `hyphens`; its TODO stays on flutter#193506. Part of flutter#193506. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant in-code documentation (doc comments with `///`). - [ ] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Makes
Hyphenswork on the CanvasKit renderer, following #193850 for Skwasm.CanvasKit's
ParagraphStylegainedrenderSoftHyphensin Skia (https://skia-review.googlesource.com/c/skia/+/1378836), which rolled into Flutter with #193884.CkParagraphStylenow sets it the same way the native engine and Skwasm do: soft hyphens render at a line break unlessHyphens.hiddenis set. Because CanvasKit is the default renderer forflutter build web, text containing U+00AD in most web apps now shows a hyphen at soft-hyphen line breaks, matching native and Skwasm. This also covers a--wasmapp that falls back to CanvasKit.With both web renderers supported, the hyphen tests in
paragraph_builder_test.dartand theTextPainterhyphen tests no longer skip on the web, and theTextPainter.hyphensdocs drop the web caveat. WebParagraph, which is experimental and off by default, still ignoreshyphens; its TODO stays on #193506.Part of #193506.
Pre-launch Checklist
///).