Drawstring

g.DRAWSTRING someLongString , xPos , yPos, Width, false

This is supposed to draw the string and create a new line when it hits certain characters (such as a space) if the next section won’t fit on the same line

However, I cannot find a list of what those characters actually are.
a SPACE of course makes sense, as any other “whitespace” [tab, linefeed]
but I’ve seen it break between two “%%” where there was MORE than enough space for the 2nd “%”

I have a need to be able to analyze a string, and determine where/how DrawSTring would handle it, to store that information to create a specical command file.

The LR is not too verbose on this command

This is strange…
After doing some experimenting with a string that exceeded the specifed width

WWWWxWWWW

I replaced “x” with all the punctuation to see the results (and yes the width still exceeded the line in each case]
and this is what I found

  • \+$% would all break the line just before one of these characters
  • ?/|-! space would always break the line just AFTER one of these characters

yet comma and period had no effect at all

is there ANYWHERE this is documented?

My guess is this is being handled by the operating system text layout engine and not Xojo.

It is probably the Unicode Line Breaking Algorithm…

http://unicode.org/reports/tr14/

This looks like the typographic line breaking rules. In typography, comma and period must be followed by a thin space. That would explain why the line wrapping does not take place in these cases when there is no thin space.

After reading the link Kevin posted, and some experimenting I got a piece of code working to do exactly what I needed…

Thanks