Type on a path whose first paragraph is aligned Justify All places its line
from the start bracket, the same as Left, so a threaded story is now measured
with the paragraphs it needs rather than the whole rest. A 1,500-paragraph
story through 40 paths aligned Justify All was laid out over 2,135,202 bytes
while measuring and is now laid out over 20,583. The frames take the same
text as before.
Center, Right, Auto right to left, hanging punctuation, Dynamic Text and
horizontal right-to-left text are still measured with the whole rest: a
centered or right-aligned line starts where the width of all its glyphs puts
it, and negative tracking can make an advance negative.
Tests compare every frame's share with the whole-rest share for Justify All
with spacing, on closed paths, with negative tracking and with punctuation
ending paragraphs.
A threaded story measured each type-on-a-path frame, and each area frame
whose lines align to the center, the bottom or justify vertically, with
the whole rest of the story. A story of 1,500 one-line paragraphs through
40 such frames was laid out over about 2.1 million bytes while the frames
were measured.
- Area type without Shrink Text to Fit now takes the paragraph probe for
every vertical alignment. A reflow pass that places less text is
undone, so when the final layout stops before the last paragraph break
measured, every pass placed the same lines as with the whole rest.
- Type on a path takes it when its line starts at the start bracket: no
Dynamic Text, Optical Margin Alignment or Roman Hanging Punctuation,
the first paragraph aligned Left, Justify Left or Auto, and vertical
type or no right-to-left text in the rest of the story. The story is
scanned for right-to-left text once per distribution.
- Shrink Text to Fit, the other path settings and a share that ends in
the story's last paragraph are still measured with the whole rest.
The same 40 frames are now measured over 21,035 bytes (aligned to the
center) and 20,583 bytes (paths aligned Left). Each frame's share is
unchanged: the tests compare every slice with the whole-rest result for
both distribution entry points, across alignments, frame shapes, wraps,
path settings, right-to-left text, styles, lists and seeded stories.
Each measurement of a frame's share started from a copy of the whole frame, its own runs included, and then replaced the runs. The frame is now copied once without its own text, and each measurement copies that. A test counts the frame text copied to measure frames that already hold text.
Distributing a story through threaded frames measured every frame but the
last with the whole rest of the story, and copied that rest several times
per frame, so a long story through many frames cost frames times story
length.
- The rest of the story is a borrowed view of the given runs (run index,
byte offset, length). Each frame's share is copied once; the slices,
styles of empty shares and the run left once the story is used up are
the same as before.
- Area type without Shrink Text to Fit whose lines align to the top is
first measured with the text through the end of the paragraph that
reaches about twice the previous frame's share (at least 512 bytes),
doubling while the story goes on. The share is taken when its text
stops fitting before the last paragraph break measured; layout places
lines in order, stops at the first that does not fit and shapes each
paragraph on its own text. Type on a path, Shrink Text to Fit, other
vertical alignments and a share ending in the story's last paragraph
are measured with the whole rest.
Tests compare every slice with the earlier algorithm, kept in the tests,
for many kinds of frames, styles and paragraphs and 12 seeded stories.
A story of 1,500 paragraphs (55,892 bytes) through 40 frames was laid
out over 2,126,762 bytes while measuring and is now laid out over
21,035.
A paragraph format given to the empty paragraph after a frame's last
paragraph break was lost when the story flowed again: the paragraph is
shared with the next frame's first paragraph, and the next frame's old
style replaced it, in that frame and in the frames after it.
- The thread reflow also notes which frames' last paragraph changed
style, and story_paras_restyled keeps that style against the next
frame's unedited first paragraph, across unedited empty frames too.
When the same edit formats the next frame's first paragraph, that
format applies, as before.
- story_paras keeps its behavior for its other callers.
- Tests cover area type and type on a path on either side, a next frame
holding text, three frames, undo and redo, a format that changes
nothing, and numbered list counts.
When a frame's text ends with a paragraph break and the next frame is empty, restyling that empty frame was undone on reflow: an unedited empty frame after it gave the story's last paragraph its own style again. A restyled empty frame now keeps its style against unedited empty frames that follow it. Unedited empty frames before it, later frames with text and later restyled frames still give the paragraph their style, as before.