Skip to content

Text wrapper not properly working with soft hyphens #457

@Janneman84

Description

@Janneman84

The linebreak logic doesn't seem to be designed to handle soft hyphens. These are characters that indicate where a word may be split in order to prevent a big gap as the end of a line.

http://www.fileformat.info/info/unicode/char/ad/index.htm

In my language composed words are written as one, so "computer screen" becomes "computerscreen". You understand that words can get potentially very long, like "computers­creen­size­measurement­accuracy­category" or something. I put some soft hyphens in this word so it breaks if it doesn't fit on one line so you probably see a dash now, try resizing the text field.

Typing soft hyphens is annoying because you can't usually see them, so it's advised to use unicode, like in JS you can type "I have a very big computer\u00ADscreen."

so Instead of this:
I have a very big
computerscreen.

you get:
I have a very big computer-
screen.

Long story short: in PDFKit all soft hyphen characters are typed as a dash and not just the one at the end of a line. It probably takes a bit of puzzling to get the sizing algorithms working correctly.

Is this something someone would like to look a little more in to?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions