Work in progress — this reference is being written in the open. Unfinished pages are excluded from search engines.
Paged · IDML Reference
Styles

Character styles

The CharacterStyle element and its attributes — identity, BasedOn, font and size, fill, tracking — the RootCharacterStyleGroup, and how a range that applies a character style can still override one of its attributes locally.

Pro· reference

A character style formats a run — a span of text inside a paragraph — usually setting only the few attributes that differ from the surrounding text.

In short: A <CharacterStyle> overrides formatting on a run rather than a whole paragraph, so it typically carries just the handful of attributes that change — a bold face, a fill colour, some tracking — and inherits the rest from its BasedOn parent and, ultimately, from the paragraph style the run sits in. Every character style lives in <RootCharacterStyleGroup> inside Resources/Styles.xml and bottoms out at the uneditable [No character style] root. A run names its character style through AppliedCharacterStyle, but can also set an attribute directly on its range, where the local value wins over the style. This page lists the attributes our parser reads; the order they resolve in is covered under conflict resolution.

A character style formats a run — a span of text inside a paragraph — and unlike a paragraph style it usually sets only the few attributes that differ from the surrounding text. The rest is inherited: from the style's BasedOn parent, and ultimately from the paragraph style the run sits in. This page lists the attributes our parser reads off <CharacterStyle>; the order they resolve in is covered under conflict resolution.

Where they live

Each <CharacterStyle> sits inside <RootCharacterStyleGroup> (with optional intermediate <CharacterStyleGroup> nesting the parser flattens). The uneditable root is CharacterStyle/$ID/[No character style] — the bottom of every character cascade and the style a run applies when it wants nothing but the paragraph defaults.

<RootCharacterStyleGroup>
  <CharacterStyle Self="CharacterStyle/$ID/[No character style]"
                  Name="$ID/[No character style]"/>
  <CharacterStyle Self="CharacterStyle/Emphasis" Name="Emphasis"
                  FontStyle="Bold" PointSize="12"/>
</RootCharacterStyleGroup>

Attributes

AppliedFont may appear as an attribute or as an <AppliedFont> child inside <Properties>; Leading is read from the run/range rather than the style. StrokeColor set to the literal Swatch/None is normalised to unset, so a BasedOn chain can fall through to a real colour from a parent.

Attribute · CharacterStyleType / valuesSupportNotes
Selfstring idSupportedThe style id, e.g. "CharacterStyle/Emphasis". What a run references via AppliedCharacterStyle.
NamestringParsed, not yet renderedHuman-readable name; resolution keys on Self.
BasedOnstring idSupportedParent character style id, or the [No character style] root. Attribute or <BasedOn> Properties child.
AppliedFontstring (font family)SupportedFont family. Attribute or <AppliedFont> Properties child.
FontStylestring (e.g. "Bold", "Italic")SupportedNamed face within the family.
PointSizedouble (pt)SupportedType size in points.
FillColorstring (Color/Swatch id)SupportedGlyph fill; a reference into Resources/Graphic.xml.
FillTintdouble (0–100%)SupportedFill tint percentage; absent means full strength.
StrokeColorstring (Color/Swatch id)SupportedGlyph outline paint. "Swatch/None" normalises to unset.
StrokeWeightdouble (pt)SupportedOutline weight when StrokeColor resolves.
Trackingdouble (1/1000 em)SupportedInter-glyph spacing added to every advance.
CapitalizationNormal | SmallCaps | AllCaps | CapToSmallCapSupportedAllCaps uppercases before shaping.
BaselineShiftdouble (pt)SupportedLifts (+) or drops (−) glyphs relative to the baseline.
HorizontalScaledouble (%)Supported100 = identity; folded into the glyph affine.
VerticalScaledouble (%)Parsed, not yet rendered100 = identity; per-glyph y-scale not yet applied.
Skewdouble (deg)SupportedFaux-italic slant, folded into the glyph affine.
PositionNormal | Superscript | Subscript | OTSuperscript | OTSubscriptParsed, not yet renderedBaseline position; captured but not yet scaled/shifted.
UnderlinebooleanSupportedUnderline decoration.
StrikeThrubooleanSupportedStrike-through decoration.
LigaturesbooleanSupportedStandard + contextual OpenType ligatures (liga, clig). Default at the bottom of the cascade is true.
KerningMethodMetrics | Optical | NoneSupportedOptical falls back to Metrics until the outline-driven pass lands.

A local override beats the style

A run applies a character style by id, but it can also set an attribute directly on its <CharacterStyleRange>. That local value is not part of the style sheet and is not subject to BasedOn resolution — it simply wins. In the example below both runs apply the same Emphasis style (which sets PointSize="12"), but the second range adds PointSize="24" to itself; that run shapes at 24 pt while the first stays at the style's 12.

Two runs, one character style — the second range overrides PointSize locally.

Stories/Story_ustory.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
  <Story Self="ustory">
    <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
      <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Emphasis">
        <Content>Emphasis as defined, </Content>
      </CharacterStyleRange>
      <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Emphasis" PointSize="24">
        <Content>then PointSize overridden to 24 on the range.</Content>
      </CharacterStyleRange>
    </ParagraphStyleRange>
  </Story>
</idPkg:Story>

The full priority order — local value, then the applied character style's resolved chain, then the paragraph style's resolved chain — is laid out in conflict resolution. The run-level override attributes are the same names as the style attributes above; the parser reads them off the <CharacterStyleRange> itself.

Frequently asked questions

What is a character style for? A character style formats a run — a span of text inside a paragraph — and usually sets only the few attributes that differ from the surrounding text, such as a bold face or a different colour. Everything it does not set is inherited from its BasedOn parent and from the paragraph style the run sits in.

How does a run reference a character style? A run names its character style through AppliedCharacterStyle, whose value is the style's Self id. A run that wants nothing but the paragraph defaults applies the [No character style] root.

Can a run override an attribute set by its character style? Yes. A value set directly on the <CharacterStyleRange> is not part of the style sheet and is not subject to BasedOn resolution — it simply wins. In the example above, two runs apply the same Emphasis style but the second adds PointSize="24" to its range, so it shapes at 24 pt while the first stays at the style's 12.

Where does Leading come from if not the character style? Leading is read from the run or range rather than from the <CharacterStyle> element, so it is not one of the style attributes listed above.

On this page