Conflict resolution
The order in which a run's own attributes, its character style and its paragraph style combine, what Swatch/None means there, and the cases that need care.
A run's effective value for each attribute comes from the first of three layers that sets it: the run itself, its character style, then its paragraph style.
In short One glyph's size can be set in four places: on its <CharacterStyleRange>, on
the character style the run applies, on the paragraph style its paragraph applies, and on the
roots those styles inherit from. For each attribute, take the first of these that sets it, in
that order. Each style layer is first resolved through its own BasedOn chain. A value that
means "nothing", such as Swatch/None for a colour, still counts as set.
The order of precedence
For a character attribute of a run, highest priority first:
- The run. An attribute on the
<CharacterStyleRange>itself. - The character style. The style in
AppliedCharacterStyle, resolved through itsBasedOnchain (see the cascade). - The paragraph style. The style in the paragraph's
AppliedParagraphStyle, resolved through its own chain. A paragraph style carries character defaults for exactly this reason.
Paragraph attributes (alignment, indents, spacing, keeps) have two layers: the
<ParagraphStyleRange> itself, then its paragraph style's chain.
Worked example
The second run of the local-override example applies
CharacterStyle/Emphasis (FontStyle="Bold", PointSize="12") inside a paragraph whose style
is the root (AppliedFont Open Sans, PointSize="12", FillColor="Color/Black"), and the range
itself sets PointSize="24":
| Attribute | Value | Comes from |
|---|---|---|
PointSize | 24 | 1 — the run |
FontStyle | Bold | 2 — the Emphasis character style |
AppliedFont | Open Sans | 3 — the paragraph style |
FillColor | Color/Black | 3 — the paragraph style |
Cases that need care
Swatch/Noneis a value. On a colour attribute it means "no paint", and it shadows a colour lower in the order exactly like any other value. A character style withStrokeColor="Swatch/None"removes an outline its paragraph style would have drawn.- Absent is not off. Some attributes default to on when nothing sets them,
LigaturesandHyphenationamong them. A run loses ligatures only when some layer setsLigatures="false". - Values outside the vocabulary. A
JustificationorCapitalizationvalue the reader does not know should be treated as unset, not as an error. - Missing or cyclic parents. A
BasedOnthat names no style, or loops, ends the walk; the values gathered so far stand.
In Paged: the three-layer order is applied as described.
Supported · verifiedSwatch/Noneon a text stroke, or on an object, table or cell colour, is read as unset rather than as "no paint", so a colour lower in the order shows through where InDesign would draw none. This is a known divergence.
Nested styles and conditions
Two constructs change the formatting or visibility of part of a paragraph on top of this order:
- Nested styles apply a character style to the start of each paragraph, up to a delimiter. They are defined on the paragraph style; see paragraph styles.
- Conditions hide or show runs. A run lists its conditions in
AppliedConditions; each<Condition>has aVisibleflag. See conditional text.
In Paged: a run is hidden before layout when any of its conditions is set
Visible="false". Supported · verified
Frequently asked questions
In what order are a run's attributes resolved?
The run's own attribute first, then its character style through its BasedOn chain, then its
paragraph style through its chain. The first layer that sets an attribute wins.
Does Swatch/None force "no paint"?
Yes. It is a real value and overrides a colour from a style lower in the order.
Does an attribute that no layer sets mean the feature is off?
Not always. Ligatures and Hyphenation, for example, are on unless some layer sets them to
false.
Can a paragraph range override a paragraph style?
Yes. Any paragraph attribute set on the <ParagraphStyleRange> wins over the paragraph style
for the paragraphs in that range.
Table and cell styles
The TableStyle and CellStyle elements — how a table style assigns a cell style to each region and dresses the table, and what a cell style carries.
Typography
What IDML's typographic attributes mean — fonts, spacing, OpenType features, composition, drop caps, tabs, lists, keeps and columns — and where each one is set.