Skip to content

API reference / Common / Engine types / TextCharacterProperties

Interface: TextCharacterProperties ​

Character-level properties (a:rPr, CT_TextCharacterProperties) — the unified a:rPr / w:rPr / x:rPr superset: per-script typefaces, size, bold/italic, letter spacing, underline/strike, fill/highlight/shading, effects, caps/emphasis, the super/subscript baseline_align, style_ref, east_asian_layout, language, border, hyperlink, and the Macintosh shadow / condense / extend flags a spreadsheet run carries.

Representation. A sparse, key-sorted set: only the properties a span specifies are held, each as a [TextCharacterProperty] value (Bold(true), Size(18.0)). An absent key means unspecified — inherit down the style / placeholder chain. This keeps an unstyled span near-free and the type small as it flows through the command / operation / selection-edit enums (no 34 inline Options, no large_enum_variant tax on its carriers). set / clear / overlay maintain the one-entry-per-[TextCharacterPropertyKey], sorted invariant, so equal property sets compare equal (the span coalescing relies on it) and lookup is a binary search. On the wire the properties are an array of specified properties — { "props": [{ "bold": true }, { "size": 18 }] } (each a tagged [TextCharacterProperty]) — deserialized back through set so the sorted, one-per-key invariant holds.

This is the text-character-properties design doc's full union.

Properties ​

PropertyDescription
props
TextCharacterProperty[]
The specified properties, one per [TextCharacterPropertyKey], kept sorted by key. Private: set / clear maintain the sorted, one-per-key invariant that a plain == and the binary-search lookups depend on.
propertiesChange?
RevisionChange<TextCharacterProperties>
w:rPrChange — what these properties were before a revision. It sits beside them, as the schema keeps it (EG_RPrContent is EG_RPrBase* then rPrChange?), so nothing that reads a property learns about it. The type has a slot CT_RPrOriginal doesn't, inside previous, which nothing fills.