GNOME Bugzilla – Bug 580275
Display hyphen when line breaks at soft hyphen
Last modified: 2018-05-22 12:50:42 UTC
Currently, PangoLayout breaks lines at U+00AD SOFT HYPHEN, treating it as an invisible line-break point. That character is usually understood to mean a point where a hyphen should be inserted if the line is broken at that point. It would improve pango's text rendering if it was able to insert hyphens when lines were broken at a soft hyphen.
I have been working to solve this bug. My current approach is to hyphenate all intraword breaks. I believe that I have most of the logic for this in place, but am currently unsure where it would be best to actually insert the hyphen text into the layout. From discussions with Owen Taylor on IRC, he was unsure whether it would be best to insert the hyphen into an existing run and risk some font weirdness if the font being used doesn't include a glyph for the hyphen character, or to create a new run, which would have no actual text associated with it. Feedback on this would be appreciated. I am also thinking that it may be necessary to be able to specify that a particular PangoLayout should not hyphenate any text. For example, gedit or anjuta text views hyphenating text could confuse developers. I am not sure how best to handle this problem.
(In reply to comment #1) > > From discussions with Owen Taylor on IRC, he was unsure whether it would be > best to insert the hyphen into an existing run and risk some font weirdness if > the font being used doesn't include a glyph for the hyphen character, or to > create a new run, which would have no actual text associated with it. Feedback > on this would be appreciated. Check ellipsize.c. The logic would be very similar IMO. > I am also thinking that it may be necessary to be able to specify that a > particular PangoLayout should not hyphenate any text. For example, gedit or > anjuta text views hyphenating text could confuse developers. I am not sure how > best to handle this problem. Correct. Perhaps a pango_layout_[sg]et_hyphenate().
*** Bug 648718 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/155.