If this is the first call to this Text LayoutManager, initialize ipdTotal and record that this breakposs is the first in iFlags.
If leading spaces must be suppressed, suppress all leading space characters U+20. Return if this finished the text.
For the remaining leading space characters,
If this is a space U+20 or a non-breaking space U+A0,
count it;
if this is the first character and this is the first breakposs,
if the context has leading spaces, add it (or halfWS?);
else add it (or halfWS?) to the pending space, and add the pending space to the space ipd.
add the space width to the word ipd.
set the pending space to halfWS.
if this is a non-breaking space U+A0, register it in bSawNonSuppressible.
Else (other space characters),
register it in bSawNonSuppressible.
add the pending space to the space ipd, and clear the pending space.
add the character width to the word ipd.
If this finishes the text,
register whether there were any nonsuppressible spaces (bSawNonSuppressible) in iFlags.
pass all the info to makeBreakPoss and _return_ its breakposs.
Else,
add pending space.
If hypenation is on, get the size of the next syllable:
get the size of the next syllable,
if successful, add the flags BreakPoss.CAN_BREAK_AFTER and BreakPoss.CAN_BREAK_AFTER in iFlags,
add the syllable length to the word ipd.
Else look for a legal line-break: breakable white-space and certain characters such as '-' which can serve as word breaks; don't look for hyphenation points here though,
for all following characters:
If this is a newline character U+0A, or if textInfo.bWrap and this is a breakable space, or if this is one of the linebreak characters ("-/") and it is the first character or the preceding character is a letter or a digit,
add the flag BreakPoss.CAN_BREAK_AFTER to iFlags,
if this is not a space U+20,
move the counter to the next character,
if this is a newline U+0A, add the flag BreakPoss.FORCE to iFlags,
else add the character width to the word ipd.
if the rest of the text consists of spaces U+20, register that the rest is suppressible at a line break (BreakPoss.REST_ARE_SUPPRESS_AT_LB) in iFlags,
pass all the info to makeBreakPoss and _return_ its breakposs.
Else add the character width to the word ipd,
and continue with the cycle for the next character.
At the end of the text, pass all the info to makeBreakPoss and _return_ its breakposs.