Justification and line-breaking
The Justification values and their last lines, word and letter spacing, glyph scaling, the forced line break, and the hyphenation attributes.
Justification sets how a paragraph's lines sit in the column; the spacing and hyphenation attributes set how much the composer may stretch, squeeze and split words to get there.
In short Justification takes three ragged values (LeftAlign, CenterAlign,
RightAlign), four justified values that differ in how the last line is set
(LeftJustified, CenterJustified, RightJustified, FullyJustified) and two
binding-relative values. In justified text, the composer stretches word spaces within the
paragraph's MinimumWordSpacing…MaximumWordSpacing range and, if allowed, letter spacing and
glyph scaling too. Hyphenation adds break points inside words, governed by a family of
Hyphenate… attributes. The composer chooses the
breaks within these limits.
The Justification values
Justification is a paragraph attribute, on a <ParagraphStyleRange> or a paragraph style.
| Value | Lines | Last line |
|---|---|---|
LeftAlign | flush left, ragged right | same |
CenterAlign | centred | same |
RightAlign | flush right, ragged left | same |
LeftJustified | justified to both edges | flush left |
CenterJustified | justified to both edges | centred |
RightJustified | justified to both edges | flush right |
FullyJustified | justified to both edges | justified too, however short |
ToBindingSide | flush toward the spine | same |
AwayFromBindingSide | flush away from the spine | same |
ToBindingSide and AwayFromBindingSide follow the page: on a right-hand page the binding side
is the left, on a left-hand page the right. A paragraph's last line is the line before its
<Br/>, or the story's last line.
A line that holds a single word has no space to stretch. SingleWordJustification says how
such a line is set in justified text: FullyJustified (letter-spaced to fill the measure, the
value in almost every document of the census), LeftAlign, CenterAlign or RightAlign.
In Paged: the three ragged values and
LeftJustifiedare set as described.CenterJustifiedandRightJustifiedare set ragged, centred and flush right, instead of justified;FullyJustifiedis set likeLeftJustified, with a ragged last line; the binding-relative values are set left and right. These are known engine issues.
The forced line break
A forced line break is the character U+2028 inside <Content>, typed in InDesign with
Shift+Return. It ends the line but not the paragraph: no first-line indent, space before or list
number follows it. In justified text the line before a forced break is justified to the full
measure, because it is not the paragraph's last line. See
the paragraph model.
In Paged: U+2028 breaks the line inside the paragraph, and in justified text the line before it is justified.
Word spacing, letter spacing and glyph scaling
Three triples on the paragraph set how far justified text may stretch or squeeze:
| Attribute · ParagraphStyle | Values | Paged | paged.set |
|---|---|---|---|
| MinimumWordSpacing | integer | read · written | |
| DesiredWordSpacing | integer | read · written | |
| MaximumWordSpacing | integer / real | read · written | |
| MinimumLetterSpacing | integer | read · written | |
| DesiredLetterSpacing | integer | read · written | |
| MaximumLetterSpacing | integer | read · written | |
| MinimumGlyphScaling | integer | read · written | |
| DesiredGlyphScaling | integer | read · written | |
| MaximumGlyphScaling | integer | read · written | |
| SingleWordJustification | FullyJustified | LeftAlign | not read |
Word spacing is a percentage of the font's normal space (InDesign's defaults: 80, 100, 133). Letter spacing is a percentage added between characters (defaults 0, 0, 0). Glyph scaling is a horizontal scale of the glyphs (defaults 100, 100, 100). The desired values also apply to ragged text.
In Paged: all three ranges feed the composer. Supported · verified
Hyphenation
| Attribute · ParagraphStyle | Values | Paged | paged.set |
|---|---|---|---|
| Hyphenation | false | true | read · written | paragraphHyphenation |
| HyphenateWordsLongerThan | integer | read | |
| HyphenateAfterFirst | integer | read | |
| HyphenateBeforeLast | integer | read | |
| HyphenateLadderLimit | integer | read | |
| HyphenationZone | length (pt) | read · written | paragraphHyphenationZone |
| HyphenateCapitalizedWords | true | read | |
| HyphenateLastWord | true | read | |
| HyphenateAcrossColumns | true | read | |
| HyphenWeight | integer | read |
Hyphenation switches it on (it is on in InDesign's defaults). A word must have at least
HyphenateWordsLongerThan letters, and a break leaves at least HyphenateAfterFirst letters
before it and HyphenateBeforeLast after it. HyphenateLadderLimit caps how many consecutive
lines may end in a hyphen. HyphenationZone is a distance from the right edge within which ragged
text may end without hyphenating. HyphenWeight balances better spacing against fewer hyphens.
AppliedLanguage on the run picks the hyphenation dictionary.
In Paged: hyphenation uses TeX hyphenation patterns per language, not the dictionaries InDesign uses, so a word can occasionally break one syllable differently. The attributes above are read; the hyphenation zone applies to ragged text only, as in InDesign.
Supported · verified Supported · verified
Kinsoku
Japanese and Chinese text forbids some characters at the start or end of a line, such as closing
brackets and small kana at the start. KinsokuSet names the rule table and KinsokuType how a
line is adjusted to obey it.
In Paged: a built-in set of hard kinsoku rules is enforced when the paragraph sets
KinsokuType; named tables are not honoured yet. Parsed, partly rendered
Frequently asked questions
What is the difference between LeftJustified and FullyJustified?
Both justify every line to both edges. LeftJustified sets the last line flush left;
FullyJustified stretches the last line to the full measure too, however short it is.
What do CenterJustified and RightJustified mean?
Justified text whose last line is centred, or flush right, instead of flush left.
How is a forced line break written, and how is the line before it set?
As U+2028 inside <Content>. It ends the line without ending the paragraph, so in justified text
the line before it is justified like any other line that is not the last.
What does SingleWordJustification do?
It sets how a line holding a single word is placed in justified text: spread to fill the line, or
aligned left, centre or right.
Composer and OpenType features
The Composer attribute (Adobe Paragraph or Single-line Composer), Ligatures, Capitalization and the OTF… attributes that switch OpenType features on a run.
Drop caps and tabs
DropCapCharacters and DropCapLines, the tab character U+0009 in Content, and the TabList records — Alignment, AlignmentCharacter, Leader, Position.