mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 05:24:44 +00:00
Right-to-left type on a path that overflows searched for the start of its text that fits with a binary search, which assumed that a longer start never fits once a shorter one does not. A letter tracked to a negative advance breaks that: with steps of 6, 6, -3 and 6 points in a 10 point span, the first three letters fit while the first two do not, and the search showed only the first letter. - Without hanging punctuation, and with no spacing or on a path of one straight segment, every start is measured in O(n log n): each glyph keeps its place in the whole text's visual order, except the trailing whitespace and controls that UAX #9 rule L1 sets to the paragraph's level. - With hanging punctuation, or spacing on a curve, when a letter has a negative advance, a start is a candidate only when its glyphs, in its own visual order and each at the least step it can take, reach no farther than the path's length. This lower bound holds with negative advances. - At most 32 candidates are arranged from the longest. When none of them fits, a binary search over the rest shows a start that fits, which is not always the longest. - With hanging punctuation, or spacing on a curve, text with no negative advance keeps the binary search. Right-aligned and centered type on a curve with Spacing was placed using the width its glyphs have at the start bracket, while the steps were measured where the line was placed, so a line that fits could end past the end bracket and lose glyphs. It is now placed using the width of the steps it has where it is placed.