unity-game-enginefontstextmeshpro

TextMesh Pro soft hyphens not working as expected


I am having an issue with my text mesh pro objects and getting soft hyphens to work properly. I read that TMP uses \u00AD for soft hyphens but it is not working as expected. One of three things happen that are unexpected.

  1. If I add \u00AD to my text it always inserts a space character even when it does not need to wrap. Depending on the font this space is a little square (result 2 from screenshot)
  2. the word breaks where I place the \u00AD but does not show a "-" hyphen.
  3. depending on the font it never breaks.

enter image description here

In the screenshot I added \u00AD to all words where they can be split with soft hyphens. In the expected section I highlighted the softhyphens that are added correctly. As you can see from the two results the redwords show that the hyphens either show as a space or some square character depending on the font.

I thought the point of the soft hyphen was that a hyphen would be placed if and when the word needs to break, but if it does not need to break nothing would be placed there at all.

I modified my source fonts with FontForge to make sure that the hyphen gliph is set up to be used as the soft hyphen as well for both of these fonts but it is not being used properly. Should I be using something other than \u00AD to insert the soft hyphen?

Here is the source text from the screenshot.

As the ear\u00ADly morn\u00ADing sun peeked over the hori\u00ADzon, cast\u00ADing a gold\u00ADen glow across the dew-kissed mead\u00ADow, Sarah felt a sense of tran\u00ADquil\u00ADi\u00ADty wash over her. The gen\u00ADtle breeze car\u00ADried the sweet fra\u00ADgrance of wild\u00ADflow\u00ADers, min\u00ADgling with the earth\u00ADy scent of damp soil. Birds chirped joy\u00ADful\u00ADly in the trees, their me\u00ADlod\u00ADic songs add\u00ADing to the se\u00ADrene am\u00ADbi\u00ADance. Sit\u00ADting on a weath\u00ADered wood\u00ADen bench be\u00ADneath an an\u00ADcient oak tree, Sarah closed her eyes and lis\u00ADtened to the sym\u00ADpho\u00ADny of na\u00ADture around her. In that peace\u00ADful mo\u00ADment, she re\u00ADal\u00ADized how na\u00ADture had a way of sooth\u00ADing the soul and re\u00ADmind\u00ADing her of life’s sim\u00ADple pleas\u00ADures.

Solution

  • Looks like they fixed in in version 3.2.0-pre.3