This PR adds a new capability to FormattedText construction in order to provide "line-at-a-time" formatting: lines. Rather than formatting all of the constructed text in one shot (via format), the new capability instead performs partial formatting enough to identify the next line break given the specified inline size contraint. The mechanism to generate the lines conforms to the JavaScript iterator protocol. The output of each step of the iterator is a FormattedTextLine instance, and it is the responsibility of the caller to collect and place these lines as desired. Unlike format, results of the iterator are not collected under a single "container" object, and so FormattedText container-specific functionality will not be available for line metrics generated via this method.
Finally, the coordinate spaces section has been re-written: two coordinate spaces are introduced--one for easily handling pointer input, and one for easily handling relative line metrics regardless of writing mode/direction.
This PR adds a new capability to
FormattedText
construction in order to provide "line-at-a-time" formatting:lines
. Rather than formatting all of the constructed text in one shot (viaformat
), the new capability instead performs partial formatting enough to identify the next line break given the specified inline size contraint. The mechanism to generate the lines conforms to the JavaScript iterator protocol. The output of each step of the iterator is aFormattedTextLine
instance, and it is the responsibility of the caller to collect and place these lines as desired. Unlikeformat
, results of the iterator are not collected under a single "container" object, and so FormattedText container-specific functionality will not be available for line metrics generated via this method.Finally, the coordinate spaces section has been re-written: two coordinate spaces are introduced--one for easily handling pointer input, and one for easily handling relative line metrics regardless of writing mode/direction.
Fixes #46