Skip to content

Support soft hyphenation (line breaks at U+00AD plus rendering a hyphen at the end of the line) #18443

Description

@Mania-1024

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 !

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jun 13, 2018
  2. zoechi commented on Jun 13, 2018

    @zoechi
    Contributor
  3. added
    a: typographyText rendering, possibly libtxt
    c: new featureNothing broken; request for a new capability
    on Jun 13, 2018
  4. sroddy commented on Jul 3, 2018

    @sroddy
    Contributor

    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...

  5. sroddy commented on Sep 4, 2018

    @sroddy
    Contributor

    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

  6. added
    engineflutter/engine related. See also e: labels.
    on Sep 4, 2018
  7. GaryQian commented on Sep 14, 2018

    @GaryQian
    Contributor

    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.

  8. added this to the milestone on Feb 14, 2019
  9. dmvvilela commented on Apr 29, 2019

    @dmvvilela
  10. darkmarthur commented on May 18, 2019

    @darkmarthur

    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!

  11. 2dxgujun commented on Jul 12, 2019

    @2dxgujun

    +1

    image
    image

  12. GaryQian commented on Aug 19, 2019

    @GaryQian
    Contributor

    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.

  13. sroddy commented on Sep 13, 2019

    @sroddy
    Contributor

    @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.

    Margaret­Are­You­Grieving­Over­Goldengrove­Unleaving­Leaves­Like­The­Things­Of­Man­You­With­Your­Fresh­Thoughts­Care­For­Can­You­Ah­As­The­Heart­Grows­Older­It­Will­Come­To­Such­Sights­Colder­By­And­By­Nor­Spare­A­Sigh­Though­Worlds­Of­Wanwood­Leafmeal­Lie­And­Yet­You­Will­Weep­And­Know­Why­Now­No­Matter­Child­The­Name­Sorrows­Springs­Are­The­Same­Nor­Mouth­Had­No­Nor­Mind­Expressed­What­Heart­Heard­Of­Ghost­Guessed­It­Is­The­Blight­Man­Was­Born­For­It­Is­Margaret­You­Mourn­For
    
  14. pph7 commented on Nov 13, 2019

    @pph7

    I was also surprised to see that such a basic feature is not implemented in flutter. Ist there any timeline on this?

  15. 90 remaining items

  16. added a commit that references this issue on Oct 3, 2026
    3c54508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxtc: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions