Kern Class

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

Inheritance Hierarchy

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

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

Syntax

'Declaration
Public Class Kern _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As Kern
public class Kern : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.3.2.19 kern (Font Kerning)

This element specifies whether font kerning shall be applied to the contents of this run. If it is specified, then kerning shall be automatically adjusted when displaying characters in this run as needed.

The val attribute specifies the smallest font size which shall have its kerning automatically adjusted if this setting is specified. If the font size in the sz element (§17.3.2.38) is smaller than this value, then no font kerning shall be performed.

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 font kerning shall not be applied to the contents of this run.

[Example: Consider the following WordprocessingML run which has font kerning properties specified:

<w:r>
  <w:rPr>
    <w:kern w:val="28" />
    <w:sz w:val="22" />
  </w:rPr>
</w:r>

Even though font kerning is turned on via the kern element, the contents of this run must not be kerned because that settings only applied to font sizes of 14 points (28 half-points) or larger. If the kern element's val attribute was less than or equal to the sz element's val attribute, then kerning would be applied:

<w:r>
  <w:rPr>
    <w:kern w:val="22" />
    <w:sz w:val="22" />
  </w:rPr>
</w:r>

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

val (Half Point Measurement)

Specifies a positive measurement specified in half-points (1/144 of an inch).

The contents of this attribute value are interpreted based on the context of the parent XML element.

[Example: Consider the following WordprocessingML fragment:

<… w:val="30" />

The value in the val attribute is 30, which is equivalent to 15 points (30 half-points).

This value is interpreted in the context of the parent element. end example]

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

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

© ISO/IEC29500: 2008.

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

Kern Members

DocumentFormat.OpenXml.Wordprocessing Namespace