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


SoftHyphen Class

Optional Hyphen Character.When the object is serialized out as xml, its qualified name is w:softHyphen.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.EmptyType
        DocumentFormat.OpenXml.Wordprocessing.SoftHyphen

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

Syntax

'Declaration
Public Class SoftHyphen _
    Inherits EmptyType
'Usage
Dim instance As SoftHyphen
public class SoftHyphen : EmptyType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.3.3.29 softHyphen (Optional Hyphen Character)

This element specifies that an optional hyphen character shall be placed at the current location in the run content. An optional hyphen is a character which can be used as a line breaking character for the current line of text when displaying this WordprocessingML content, using the following logic:

  • When this character is not the character which is used to break the line, then it shall not change the normal display of text (it shall have zero width)

  • When this character is the character used to break the line, it shall display using the hyphen-minus character within the display of text

[Note: This character is typically used to mark locations where a word can optionally be hyphenated without causing the hyphen character to be displayed unnecessarily. end note]

[Example: Consider the following sentence in a WordprocessingML document:

This sentence needs to be long enough to cause some kind of line breaking.

Normally, just as shown above, this sentence not would be displayed on a single line as it is long enough to require line breaking (given the width of the current page). However, if an optional hyphen were inserted after the letter r in breaking, as follows:

<w:r>
<w:t>This sentence needs to be long enough to cause some kind of line br</w:t>
<w:softHyphen/>
<w:t>eaking.</w:t>
</w:r>

This would allow a break at that position, and when that location is the point of the line break, would insert a hyphen-minus in the word after that character:

This sentence needs to be long enough to cause some kind of line breaking.

If this was not the point of the line break, then no character would be displayed at that location:

This sentence should not be long enough to cause line breaking.

The sentence now does not break at that location, so no hyphen appears in the word breaking. end example]

Parent Elements

r (§22.1.2.87); r (§17.3.2.25)

[Note: The W3C XML Schema definition of this element’s content model (CT_Empty) 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

SoftHyphen Members

DocumentFormat.OpenXml.Wordprocessing Namespace