w:cs (Use Complex Script Formatting)
Forces the run to be treated as complex-script text, applying complex-script font and formatting properties even for characters that would otherwise use Latin formatting.
Parent elements
Description
w:cs is a toggle property that marks a run as complex-script text. When active, the processor applies the complex-script properties (w:szCs, w:bCs, w:iCs, w:rFonts w:cs) to the run, overriding the Latin/East Asian properties, regardless of the Unicode categories of the characters in the run.
It is defined in ECMA-376 Part 1 §17.3.2.7.
This is useful when a run contains characters whose Unicode category alone does not trigger complex-script rendering, but that need complex-script shaping for other reasons.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
Forces complex-script rendering. Omit to inherit. |
Examples
<w:r>
<w:rPr>
<w:cs/>
<w:rFonts w:cs="Arial Unicode MS"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:t>Forced complex-script rendering.</w:t>
</w:r>
using DocumentFormat.OpenXml.Wordprocessing;
var run = new Run(
new RunProperties(
new ComplexScript(),
new RunFonts { ComplexScript = "Arial Unicode MS" },
new FontSizeComplexScript { Val = "24" }
),
new Text("Forced complex-script rendering.")
);
Notes
- Normally the processor automatically detects which characters are complex-script. Use
w:csonly when you need to override this detection. w:csdoes not control text direction; usew:rtlfor right-to-left direction.