Hello,
for a current project which is featuring lots of text, the client would like to have the text hyphenated automatically. I am using a slightly modified version of
NHyphenator to automatically add soft-hyphenation symbols (any of
­,
[sh] or the
soft hyphen UTF-8 symbol) to a string before inserting it into a UILabel.
What is am missing now is that a UILabel automatically hyphenates the text at the correct positions, i.e. where a complete word does not fit into a row, but a part of a word containing ­ symbols still fits into a row.
Here is an example:
Original Text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Hyphenated Text using [sh] as hyphenation symbol:
Lo[sh]rem ip[sh]sum do[sh]lor sit amet, con[sh]sec[sh]te[sh]tur adi[sh]pi[sh]scing elit, sed do eiusmod tem[sh]por incidi[sh]dunt ut la[sh]bore et do[sh]lore mag[sh]na ali[sh]qua.What I need now is UILabel to understand [sh] symbols and to hyphenate the text at these positions where appropriate:
Lorem ipsum dolor sit amet, con-
sectetur adipiscing elit, sed do
eiusmod tempor incididunt ut la-
bore et dolore magna aliqua.My questions:
- Has anybody needed or implemented this feature?
- Would it be possible to add this feature to UILabel?
- If not, can you give me some hints where to look/change the code to do this?
I am happy for any hints on this. Thanks for developing NGUI!
Kind regards,
claus