You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support soft hyphenation (line breaks at U+00AD plus rendering a hyphen at the end of the line) #18443
I was surprised not to find a parameter to have automatic hyphenation in Text widgets (and the likes). I think it is a useful feature to get nice designs. Without it, justified text may be filled with ugly blank spaces if there are too many very long words.
Could text hyphenation be implemented in flutter, or does it sound like a bad idea for some reason ?
Thanks and congrats to the flutter team for the great job !
It seems that the word breaking and line breaking algorithms are present inside the engine. I'm wondering if they are wired up somehow or if they need to...
We are having huge issues in order to reach high fidelity without this feature.
Even manually inserting SHY (soft hyphens) doesn't help: the word and the line is correctly broken the right way but the hyphen symbol is not rendered before the line break.
Can someone please take a look? @Hixie@jason-simmons@chinmaygarde
Reacted by Jochen Pfeiffer, Michael Tamm and Jigar Patel
Currently we do not support hyphenation in Flutter text, but there are indeed hyphenation systems in minikin that we depend on. They are currently not wired up/integrated, but I believe hyphenation is something we would want to eventually support.
Reacted by ahzmie, Mark Kessler, Klas Petersson, Daniel Sperl, DenisGL, Ludwik Trammer, Marino, Richard and Z6P0
Please, this simple thing its actually a big deal, When we fetch from a service a string property to be displayed on a GridTile for example, there is no way to know when a word will break, its actually wrapping the word, an that's great, but the hyphen it's missing!
Reacted by Melanie Pittumbur, Edwin Liu and Mark Kessler
cc @chunhtai Your upcoming/recent ellipsis work may help alleviate some of the behavior that hyphenation is meant to address. In the current setup hyphenation would require packaging in large datasets with hyphenation information in it. Hyphenation may be able to be supported in future as we look at transitioning to Skia's text shaping library, which I believe hyphenation is planned for.
@GaryQian a rather simple solution would be to support hyphenation on strings where SHYs (soft-hyphens) are already present. Devs would need to take care of that part (it could either be a Dart library or a server-side solution), while the text rendering engine would just handle the insertion of the hyphens and the line breaks. Testing it with this string (taken from Wikipedia) you can see that incidentally on the web this behaviour is already supported, while on mobile the engine is already considering SHYs as good places to break words while the hyphens are not being added at the end of the lines where the breaks occur.
Activity
zoechi commentedon Jun 13, 2018
@Hixie
sroddy commentedon Jul 3, 2018
It seems that the word breaking and line breaking algorithms are present inside the engine. I'm wondering if they are wired up somehow or if they need to...
sroddy commentedon Sep 4, 2018
We are having huge issues in order to reach high fidelity without this feature.
Even manually inserting SHY (soft hyphens) doesn't help: the word and the line is correctly broken the right way but the hyphen symbol is not rendered before the line break.
Can someone please take a look?
@Hixie @jason-simmons @chinmaygarde
GaryQian commentedon Sep 14, 2018
Currently we do not support hyphenation in Flutter text, but there are indeed hyphenation systems in minikin that we depend on. They are currently not wired up/integrated, but I believe hyphenation is something we would want to eventually support.
dmvvilela commentedon Apr 29, 2019
darkmarthur commentedon May 18, 2019
Please, this simple thing its actually a big deal, When we fetch from a service a string property to be displayed on a GridTile for example, there is no way to know when a word will break, its actually wrapping the word, an that's great, but the hyphen it's missing!
2dxgujun commentedon Jul 12, 2019
+1
GaryQian commentedon Aug 19, 2019
cc @chunhtai Your upcoming/recent ellipsis work may help alleviate some of the behavior that hyphenation is meant to address. In the current setup hyphenation would require packaging in large datasets with hyphenation information in it. Hyphenation may be able to be supported in future as we look at transitioning to Skia's text shaping library, which I believe hyphenation is planned for.
sroddy commentedon Sep 13, 2019
@GaryQian a rather simple solution would be to support hyphenation on strings where SHYs (soft-hyphens) are already present. Devs would need to take care of that part (it could either be a Dart library or a server-side solution), while the text rendering engine would just handle the insertion of the hyphens and the line breaks. Testing it with this string (taken from Wikipedia) you can see that incidentally on the web this behaviour is already supported, while on mobile the engine is already considering SHYs as good places to break words while the hyphens are not being added at the end of the lines where the breaks occur.
pph7 commentedon Nov 13, 2019
I was also surprised to see that such a basic feature is not implemented in flutter. Ist there any timeline on this?
90 remaining items
Support soft hyphen (U+00AD) rendering with a Hyphens API
Support soft hyphen (U+00AD) rendering with a Hyphens API
Support soft hyphen (U+00AD) rendering with a Hyphens API
Support soft hyphen (U+00AD) rendering with a Hyphens API
Support soft hyphen (U+00AD) rendering with a Hyphens API
Clarify web hyphens TODOs; split render-wiring from custom-string
feat(reader): text-wrapping hyphenation + Compact line spacing
Support soft hyphen (U+00AD) rendering with a Hyphens API
Clarify web hyphens TODOs; split render-wiring from custom-string
Point web hyphens TODOs at flutter#193506
Support soft hyphen (U+00AD) rendering with a Hyphens API
Clarify web hyphens TODOs; split render-wiring from custom-string
Point web hyphens TODOs at flutter#193506
Support soft hyphen (U+00AD) rendering with a Hyphens API (flutter#18…