paged.IDML Reference
Styles

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.

Tier: ProProIIIexplanation

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:

  1. The run. An attribute on the <CharacterStyleRange> itself.
  2. The character style. The style in AppliedCharacterStyle, resolved through its BasedOn chain (see the cascade).
  3. 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":

AttributeValueComes from
PointSize241 — the run
FontStyleBold2 — the Emphasis character style
AppliedFontOpen Sans3 — the paragraph style
FillColorColor/Black3 — the paragraph style

Cases that need care

  • Swatch/None is 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 with StrokeColor="Swatch/None" removes an outline its paragraph style would have drawn.
  • Absent is not off. Some attributes default to on when nothing sets them, Ligatures and Hyphenation among them. A run loses ligatures only when some layer sets Ligatures="false".
  • Values outside the vocabulary. A Justification or Capitalization value the reader does not know should be treated as unset, not as an error.
  • Missing or cyclic parents. A BasedOn that names no style, or loops, ends the walk; the values gathered so far stand.

In Paged: the three-layer order is applied as described. Swatch/None on 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.

Supported · verified

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 a Visible flag. 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.

On this page