The TextWrapping feature in Silverlight is described here. However, I'm trying to find out the details of their line-breaking algorithm.
Obviously a space will cause the text to break (or split), encouraging the text to wrap to the next line. And through trial and error I've found that these characters also cause a split:
But I doubt this is the full list. Has anyone found the full list of split characters (including Unicode)? Or do you have any clever suggestions for figuring this out that I haven't thought of yet? Trial and error can be slow.
TextWrapping = Wrap
will attempt to conform to the the standard Unicode Standard Annex #14 that Johannes has already linked.
However if using this approach the text still doesn't fit the width (due to very limited width or long words) then it'll break the word across two lines, it doesn't hyphnate or do anything clever. As soon a placing a letter would overrun the width and if it can't find something in the line that'll let it use the standard algorithm it'll continue the word on the next line.
I'd guess every character that qualifies as space or punctuation, excluding the explicitly non-breaking characters.
However, there is a specified algorithm for line breaking: Unicode Standard Annex #14: Unicode Line Breaking Algorithm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With