Поделиться через


RunFonts Class

Defines the RunFonts Class.When the object is serialized out as xml, its qualified name is w:rFonts.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.RunFonts

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Декларация
Public Class RunFonts _
    Inherits OpenXmlLeafElement
'Применение
Dim instance As RunFonts
public class RunFonts : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 редакция 1]

17.3.2.26 rFonts (Run Fonts)

This element specifies the fonts which shall be used to display the text contents of this run. Within a single run, there can be up to four types of content present which shall each be allowed to use a unique font:

  • ASCII (i.e., the first 128 Unicode code points)

  • High ANSI

  • Complex Script

  • East Asian

The use of each of these fonts shall be determined by the Unicode character values of the run content, unless manually overridden via use of the cs element (§17.3.2.7).

If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then the text shall be displayed in any default font which supports that set of characters.

[Example: Consider a single text run with both Arabic and English text, as follows:

English ???????

This content can be expressed in a single WordprocessingML run:

<w:r>
<w:t>English ???????</w:t>
</w:r>

Although it is in the same run, the contents are in different font faces by specifying a different font for ASCII and CS characters in the run:

<w:r>
<w:rPr>
<w:rFonts w:ascii="Courier New" w:cs="Times New Roman" />
</w:rPr>
<w:t>English ???????</w:t>
</w:r>

This text run must therefore use the Courier New font for all characters in the range U+0000 to U+007F, and must use the Times New Roman font for all characters in the Complex Script range. end example]

Parent Elements

rPr (§17.3.1.29); rPr (§17.3.1.30); rPr (§17.5.2.28); rPr (§17.9.25); rPr (§17.7.9.1); rPr (§17.7.5.4); rPr (§17.3.2.28); rPr (§17.5.2.27); rPr (§17.7.6.2); rPr (§17.3.2.27)

Attributes

Description

ascii (ASCII Font)

Specifies a font which shall be used to format all characters in the Unicode range (U+0000-U+007F) within the parent run.

If the asciiTheme attribute is also specified, then this attribute shall be ignored and that value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in any default font which supports these characters.

[Example: Consider a run of text consisting of characters in this range, which must be displayed using the Courier New font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:ascii="Courier New" />
</w:rPr>

The ascii attribute specifies that the run must use the Courier New font for all text in thisrange. end example]

The possible values for this attribute are defined by the ST_String simple type (§22.9.2.13).

asciiTheme (ASCII Theme Font)

Specifies a theme font which shall be used to format all characters in the Unicode range (U+0000-U+007F) within the parent run. This theme font is a reference to one of the predefined theme fonts, located in the document's Theme part,which allows for font information to be set centrally in the document.

If the ascii attribute is also specified, then that attribute shall be ignored and this value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in the font specified by the ascii attribute.

[Example: Consider a run of ASCII text which must be displayed using the majorASCII theme font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:asciiTheme="majorAscii" />
</w:rPr>

The ascii attribute specifies that the run must use the majorAscii theme font as defined in the document's themes part for all text in this range. end example]

The possible values for this attribute are defined by the ST_Theme simple type (§17.18.96).

cs (Complex Script Font)

Specifies a font which shall be used to format all characters in a complex script Unicode range within the parent run.

If the csTheme attribute is also specified, then this attribute shall be ignored and that value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in any default font which supports complex script content.

[Example: Consider a run of Arabic text which must be displayed using the Arial Unicode MS font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:cs="Arial Unicode MS" />
</w:rPr>

The cs attribute specifies that the run must use the Arial Unicode MS font for all text in a complex script range. end example]

The possible values for this attribute are defined by the ST_String simple type (§22.9.2.13).

cstheme (Complex Script Theme Font)

Specifies a theme font which shall be used to format all characters in a complex script Unicode range within the parent run. This theme font is a reference to one of the predefined theme fonts, located in the document's Theme part,which allows for font information to be set centrally in the document.

If the cs attribute is also specified, then that attribute shall be ignored and this value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in the font specified by the cs attribute.

[Example: Consider a run of Arabic text which must be displayed using the majorBidi theme font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:csTheme="majorBidi" />
</w:rPr>

The csTheme attribute specifies that the run must use the majorBidi theme font as defined in the document's themes part for all text in a complex script range. end example]

The possible values for this attribute are defined by the ST_Theme simple type (§17.18.96).

eastAsia (East Asian Font)

Specifies a font which shall be used to format all characters in an East Asian Unicode range within the parent run.

If the eastAsiaTheme attribute is also specified, then this attribute shall be ignored and that value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in any default font which supports East Asian content.

[Example: Consider a run of Japanese text which must be displayed using the MS Mincho font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
<w:rFonts w:eastAsia="MS Mincho" />
</w:rPr>

The eastAsia attribute specifies that the run must use the MS Mincho font for all text in an East Asian range. end example]

The possible values for this attribute are defined by the ST_String simple type (§22.9.2.13).

eastAsiaTheme (East Asian Theme Font)

Specifies a theme font which shall be used to format all characters in an East Asian Unicode range within the parent run. This theme font is a reference to one of the predefined theme fonts, located in the document's Theme part,which allows for font information to be set centrally in the document.

If the eastAsia attribute is also specified, then that attribute shall be ignored and this value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in the font specified by the eastAsia attribute.

[Example: Consider a run of Japanese text which must be displayed using the minorEastAsia theme font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:eastAsiaTheme="minorEastAsia" />
</w:rPr>

The eastAsiaTheme attribute specifies that the run must use the minorEastAsia theme font as defined in the document's themes part for all text in an East Asian range. end example]

The possible values for this attribute are defined by the ST_Theme simple type (§17.18.96).

hAnsi (High ANSI Font)

Specifies a font which shall be used to format all characters in a Unicode range within the parent run which does not fall into one of the three categories defined above, which is called the high ANSI range in WordprocessingML.

If the hAnsiTheme attribute is also specified, then this attribute shall be ignored and that value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in any default font which supports high ANSI content.

[Example: Consider a run of text which falls into a high ANSI range, and must be displayed using the Bauhaus 93 font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
<w:rFonts w:hAnsi="Bauhaus 93" />
</w:rPr>

The hAnsi attribute specifies that the run must use the Bauhaus 93 font for all text in a high ANSI range. end example]

The possible values for this attribute are defined by the ST_String simple type (§22.9.2.13).

hAnsiTheme (High ANSI Theme Font)

Specifies a theme font which shall be used to format all characters in a Unicode range within the parent run which does not fall into one of the three categories defined above, which is called the high ANSI range in WordprocessingML. This theme font is a reference to one of the predefined theme fonts, located in the document's Theme part,which allows for font information to be set centrally in the document.

If the hAnsi attribute is also specified, then that attribute shall be ignored and this value shall be used instead.

If this attribute is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this attribute is never applied in the style hierarchy, then the text shall be displayed in the font specified by the hAnsi attribute.

[Example: Consider a run of text which falls into a high ANSI range, and must be displayed using the minorHAnsi theme font. This requirement would be specified as follows in the resulting WordprocessingML:

<w:rPr>
  <w:rFonts w:hAnsiTheme="minorHAnsi" />
</w:rPr>

The hAnsiTheme attribute specifies that the run must use the minorHAnsi theme font as defined in the document's themes part for all text in a high ANSI range. end example]

The possible values for this attribute are defined by the ST_Theme simple type (§17.18.96).

hint (Font Content Type)

Specifies the font type which shall be used to format any ambiguous characters in the current run.

There are certain characters which are not explicitly stored in the document, and can be mapped into multiple categories of the four mentioned above. This attribute shall be used to arbitrate that conflict, and determine how ambiguities in this run shall be handled. [Note: This is primarily used to handle the formatting on the paragraph mark glyph, and other characters that are not stored as text in the WordprocessingML document. end note]

If this attribute is omitted, then this ambiguity can be resolved by any means available.

[Example: Consider the run representing the paragraph mark glyph, which is not stored as a physical character. Since this could therefore be formatted with any of the fonts specified for the run, this ambiguity is resolved using the following WordprocessingML:

<w:pPr>
<w:rPr>
<w:rFonts w:hint="eastAsia" />
</w:rPr>
</w:pPr>

The hint attribute specifies that the run must use the eastAsia font (theme or not, whichever is in use for East Asian text) as defined for this range. end example]

The possible values for this attribute are defined by the ST_Hint simple type (§17.18.41).

[Note: The W3C XML Schema definition of this element's content model (CT_Fonts) is located in §A.1. end note]

© ISO/IEC29500: 2008. Приведенный выше текст переведен с английского языка на русский корпорацией Майкрософт (или ее подрядчиками) и ISO не несет ответственности за эти переводы.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

RunFonts Members

DocumentFormat.OpenXml.Wordprocessing Namespace