Character styles
The CharacterStyle element — identity, BasedOn, the attributes it usually sets, and how a range that applies a character style can still override one attribute.
A character style formats a run inside a paragraph, and usually sets only the few attributes that differ from the text around it.
In short A <CharacterStyle> is applied to a run through AppliedCharacterStyle on a
<CharacterStyleRange>. Unlike a paragraph style, it is sparse: a "Bold" style sets
FontStyle="Bold" and nothing else, and everything it leaves out comes from the paragraph
style. Character styles inherit through BasedOn like every other style and end at
[No character style], which sets nothing. As on paragraph styles, InDesign writes the font,
the parent and the leading as typed children of <Properties>.
Where they live
Character styles sit under <RootCharacterStyleGroup> in Resources/Styles.xml, optionally
inside <CharacterStyleGroup> folders. The root, CharacterStyle/$ID/[No character style], is
what a run applies when it wants nothing but its paragraph's formatting.
A character style's AppliedFont, BasedOn and Leading are typed children of its
<Properties> block, spelled exactly as on a paragraph style.
Attributes
| Attribute · CharacterStyle | Values | Paged | paged.set |
|---|---|---|---|
| Name | text | read · written | name |
| Self | CharacterStyle reference | read · written | |
| Imported | false | not read | |
| EmitCss | true | not read | |
| SplitDocument | false | not read | |
| StyleUniqueId | builtin / text | not read | |
| IncludeClass | true | not read | |
| ExtendedKeyboardShortcut | number-list | not read | |
| BasedOn in Properties | — | read · written | |
| KeyboardShortcut | number-list | not read | |
| PreviewColor in Properties | — | not read | |
| FillColor | Color reference | read · written | characterFillColor |
| FontStyle | text | read · written | characterFontStyle |
| AppliedFont in Properties | ref | read · written | characterFontFamily |
A few attributes need more than a name:
Capitalization—Normal,AllCaps,SmallCapsorCapToSmallCap.AllCapsshows the text in capitals without changing the stored characters.SmallCapsturns lowercase letters into small capitals and leaves capitals full height;CapToSmallCapturns capitals into small capitals too. InDesign uses the font's OpenType small capitals (smcp, plusc2scforCapToSmallCap) and scales ordinary capitals when the font has none.Position—Normal,Superscript,Subscript, and the OpenType variantsOTSuperscript,OTSubscript,OTNumerator,OTDenominator.SuperscriptandSubscriptshrink and shift the glyphs by the size and offset set in the document's text preferences.KerningMethod— InDesign writes$ID/Metrics,$ID/Opticalor$ID/None, with the$ID/prefix. See spacing and leading.Leading— a character attribute in InDesign: each line takes the largest leading among its runs. On a style it is the typed<Leading>child.- OpenType features —
Ligatures,OTFContextualAlternate,OTFDiscretionaryLigature,OTFFraction,OTFOrdinal,OTFSwash,OTFTitling,OTFSlashedZero,OTFFigureStyleandOTFStylisticSets. See composer and OpenType features.
In Paged: the character attributes above are applied, including small capitals through the font's
Supported · verified Supported · verified Supported · verifiedsmcpandc2sc(a font without them shows the letters unchanged, not scaled capitals),Positionwith InDesign's default size and offset (58.3 % and 33.3 %; the document's own settings are not read yet), andVerticalScale.KerningMethodvalues with the$ID/prefix are not recognised yet and fall back to metric kerning. Underline and strikethrough are drawn; their gap colours are not.
A local override beats the style
A run can apply a character style and set an attribute on its own range as well. The range's
value wins, for that range only. In the example below both runs apply Emphasis, which sets
PointSize="12"; the second range adds PointSize="24" and sets at 24 pt.
Two runs, one character style; the second range overrides PointSize locally.
The full order (the range, then the character style's chain, then the paragraph style's chain) is on conflict resolution.
Frequently asked questions
What is a character style for? Formatting a run inside a paragraph, such as a bold word or a coloured product name. It usually sets only the attributes that differ; the rest comes from the paragraph style.
How does a run reference a character style?
Through AppliedCharacterStyle on its <CharacterStyleRange>, set to the style's Self id. A
run that wants only its paragraph's formatting applies CharacterStyle/$ID/[No character style].
Can a character style set the leading?
Yes. In InDesign leading is a character attribute, and a character style can carry it as a typed
<Leading> child of <Properties>. A line takes the largest leading among its runs.
What does CapToSmallCap do?
It sets the whole run in small capitals, capitals included. SmallCaps turns only the lowercase
letters into small capitals and keeps capitals full height.
Paragraph styles
The ParagraphStyle element — identity, BasedOn parent, character defaults, paragraph geometry and the option families it carries, as InDesign writes them.
Object styles
The ObjectStyle element — the page-item analogue of a text style — its fill, stroke and corner attributes, its Enable switches, and the built-in [None] style.