-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bringing back line-at-a-time formatting #46
Comments
This was referenced Feb 14, 2022
Proposed approach:
|
travisleithead
added a commit
that referenced
this issue
May 9, 2022
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. Fixes #46 --- * Teaser for per-line formatting in input text model explainer * Revision to "thinking ahead" section * Add line-at-a-time sample * Bring back old "advanced scenario"! * Coordinate Systems text update * Add visual aid for coordinate section * Drop example and reflowFrom in favor of iterator approach * Align param 3 for format and lines * Metrics: update overview * Metrics: drop the proposal for custom lifetime behavior * Metrics updates primarily to coordinate spaces...
(Note the actual approach differs substantially from the proposed approach noted above.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By popular demand, and from several internal customer requests (both at Microsoft and at Google), we should support line-at-a-time rendering (see also: #41 which could be addressed by this.)
In recent discussion, it was suggested that something like a
might be a good starting point.
The text was updated successfully, but these errors were encountered: