mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 21:17:48 +00:00
A paragraph whose characters differ in line metrics (type size, font, leading, vertical scale, or an inline graphic taller than the text) was broken with the Single-line Composer in area type of a shape other than a rectangle, or with text wrap. The every-line composer now composes it there too. - The composer takes each line's width from a measure that follows where the lines above it went (`composer::Measure`, `compose_with`). The fixed widths by line number are one such measure. - In a frame whose lines are not all as wide, each line the composer tries is placed from the pen the lines above it left, at its own tallest metrics, as the line loop places it (`layout/shaped.rs`). Starts with the same placement are shared, and each start keeps the placements it was tried with. - A line too long for its room does not end the search from its start while a glyph after it could make the line taller and set it lower, where the frame may be wider. - The line loop places a composed line in such a frame at the line's tallest metrics, so it gets the room the composer measured for it. - The search for one paragraph stops after 1,000,000 lines tried or 2,000,000 baseline steps. The searches of all the paragraphs of one frame share a budget of 2,000,000 lines and 4,000,000 steps, kept apart from the line loop's own steps. A paragraph whose search stops is broken line by line. A paragraph the frame has no room for is broken line by line too, and overflows as before. Tests: crates/text/src/tests/combos.rs (a stepped frame, a frame that widens, text wrap with two spans on a baseline, overflow, a long paragraph) and crates/text/src/layout/wrapping_tests.rs (the composer with a measure, and the shared search budget).