ITextCharacterFormat ITextCharacterFormat ITextCharacterFormat Interface

Defines the default character formatting attributes of a document, or the current character formatting attributes of a text range.

Syntax

Declaration

public interface ITextCharacterFormatpublic interface ITextCharacterFormatPublic Interface ITextCharacterFormat

Properties summary

Gets or sets whether the characters are all uppercase.

Gets or sets the text background (highlight) color.

Gets or sets whether the characters are bold.

Gets or sets the degree to which the font is stretched, compared to the normal aspect ratio of the font.

Gets or sets the style of the font face, such as normal or italic.

Gets or sets the foreground, or text, color.

Gets or sets whether characters are hidden.

Gets or sets whether characters are in italics.

Gets or sets the minimum font size at which kerning occurs.

Gets or sets the Internet Engineering Task Force (IETF) language tag (BCP 47 standard) that identifies the language currently associated with the characters.

Gets the link type of the text.

Gets or sets the font name.

Gets or sets whether characters are displayed as outlined characters.

Gets or sets the character offset relative to the baseline.

Gets or sets whether the characters are protected against attempts to modify them.

Gets or sets the font size.

Gets or sets whether characters are in small capital letters.

Gets or sets the amount of horizontal spacing between characters.

Gets or sets whether characters are displayed with a horizontal line through the center.

Gets or sets whether characters are displayed as subscript.

Gets or sets whether characters are displayed as superscript.

Gets or sets the character repertoire.

Gets or sets the type of underlining that the characters use.

Gets or sets the font weight of the characters.

Methods summary

Creates a new object that is identical to this character format object.

Determines whether this character format object has the same properties as the specified character format object.

Sets the character formatting by copying another text character formatting object.

Properties

  • AllCaps
    AllCaps
    AllCaps
    AllCaps

    Gets or sets whether the characters are all uppercase.

    public FormatEffect AllCaps { get; set; }public FormatEffect AllCaps { get; set; }Public ReadWrite Property AllCaps As FormatEffectpublic FormatEffect AllCaps { get; set; }

    Property Value

  • BackgroundColor
    BackgroundColor
    BackgroundColor
    BackgroundColor

    Gets or sets the text background (highlight) color.

    public Color BackgroundColor { get; set; }public Color BackgroundColor { get; set; }Public ReadWrite Property BackgroundColor As Colorpublic Color BackgroundColor { get; set; }

    Property Value

  • Bold
    Bold
    Bold
    Bold

    Gets or sets whether the characters are bold.

    public FormatEffect Bold { get; set; }public FormatEffect Bold { get; set; }Public ReadWrite Property Bold As FormatEffectpublic FormatEffect Bold { get; set; }

    Property Value

  • FontStretch
    FontStretch
    FontStretch
    FontStretch

    Gets or sets the degree to which the font is stretched, compared to the normal aspect ratio of the font.

    public FontStretch FontStretch { get; set; }public FontStretch FontStretch { get; set; }Public ReadWrite Property FontStretch As FontStretchpublic FontStretch FontStretch { get; set; }

    Property Value

  • FontStyle
    FontStyle
    FontStyle
    FontStyle

    Gets or sets the style of the font face, such as normal or italic.

    public FontStyle FontStyle { get; set; }public FontStyle FontStyle { get; set; }Public ReadWrite Property FontStyle As FontStylepublic FontStyle FontStyle { get; set; }

    Property Value

  • ForegroundColor
    ForegroundColor
    ForegroundColor
    ForegroundColor

    Gets or sets the foreground, or text, color.

    public Color ForegroundColor { get; set; }public Color ForegroundColor { get; set; }Public ReadWrite Property ForegroundColor As Colorpublic Color ForegroundColor { get; set; }

    Property Value

  • Hidden
    Hidden
    Hidden
    Hidden

    Gets or sets whether characters are hidden.

    public FormatEffect Hidden { get; set; }public FormatEffect Hidden { get; set; }Public ReadWrite Property Hidden As FormatEffectpublic FormatEffect Hidden { get; set; }

    Property Value

  • Italic
    Italic
    Italic
    Italic

    Gets or sets whether characters are in italics.

    public FormatEffect Italic { get; set; }public FormatEffect Italic { get; set; }Public ReadWrite Property Italic As FormatEffectpublic FormatEffect Italic { get; set; }

    Property Value

  • Kerning
    Kerning
    Kerning
    Kerning

    Gets or sets the minimum font size at which kerning occurs.

    public float Kerning { get; set; }public float Kerning { get; set; }Public ReadWrite Property Kerning As floatpublic float Kerning { get; set; }

    Property Value

    • float
      float
      float

      The kerning size, in floating-point points.

    Remarks

    If the value is zero, kerning is turned off. Positive values turn on pair kerning for font point sizes greater than or equal to the kerning value. For example, the value 1 turns on kerning for all legible sizes, whereas 16 turns on kerning only for font sizes of 16 points and larger.

  • LanguageTag
    LanguageTag
    LanguageTag
    LanguageTag

    Gets or sets the Internet Engineering Task Force (IETF) language tag (BCP 47 standard) that identifies the language currently associated with the characters.

    public string LanguageTag { get; set; }public string LanguageTag { get; set; }Public ReadWrite Property LanguageTag As stringpublic string LanguageTag { get; set; }

    Property Value

    • string
      string
      string

      The language tag.

  • LinkType
    LinkType
    LinkType
    LinkType

    Gets the link type of the text.

    public LinkType LinkType { get; }public LinkType LinkType { get; }Public ReadOnly Property LinkType As LinkTypepublic LinkType LinkType { get; }

    Property Value

  • Name
    Name
    Name
    Name

    Gets or sets the font name.

    public string Name { get; set; }public string Name { get; set; }Public ReadWrite Property Name As stringpublic string Name { get; set; }

    Property Value

    • string
      string
      string

      The font name.

  • Outline
    Outline
    Outline
    Outline

    Gets or sets whether characters are displayed as outlined characters.

    public FormatEffect Outline { get; set; }public FormatEffect Outline { get; set; }Public ReadWrite Property Outline As FormatEffectpublic FormatEffect Outline { get; set; }

    Property Value

  • Position
    Position
    Position
    Position

    Gets or sets the character offset relative to the baseline.

    public float Position { get; set; }public float Position { get; set; }Public ReadWrite Property Position As floatpublic float Position { get; set; }

    Property Value

    • float
      float
      float

      The character offset, in floating-point points.

    Remarks

    Typically, the value of this property is zero. Positive values raise the characters relative to the baseline, and negative values lower them.

  • ProtectedText
    ProtectedText
    ProtectedText
    ProtectedText

    Gets or sets whether the characters are protected against attempts to modify them.

    public FormatEffect ProtectedText { get; set; }public FormatEffect ProtectedText { get; set; }Public ReadWrite Property ProtectedText As FormatEffectpublic FormatEffect ProtectedText { get; set; }

    Property Value

    Remarks

    In general, calling methods in the Windows.UI.Text namespace that attempt to change the formatting or content of a text range will fail if any part of the range is protected, or if the document is read-only. To change protected text, an app should attempt to turn off the protection of the text to be modified. The owner of the document might permit this to happen.

  • Size
    Size
    Size
    Size

    Gets or sets the font size.

    public float Size { get; set; }public float Size { get; set; }Public ReadWrite Property Size As floatpublic float Size { get; set; }

    Property Value

    • float
      float
      float

      The font size, in floating-point points.

  • SmallCaps
    SmallCaps
    SmallCaps
    SmallCaps

    Gets or sets whether characters are in small capital letters.

    public FormatEffect SmallCaps { get; set; }public FormatEffect SmallCaps { get; set; }Public ReadWrite Property SmallCaps As FormatEffectpublic FormatEffect SmallCaps { get; set; }

    Property Value

  • Spacing
    Spacing
    Spacing
    Spacing

    Gets or sets the amount of horizontal spacing between characters.

    public float Spacing { get; set; }public float Spacing { get; set; }Public ReadWrite Property Spacing As floatpublic float Spacing { get; set; }

    Property Value

    • float
      float
      float

      The amount of horizontal spacing, in floating-point points.

    Remarks

    Typically, the value of this property is zero. Positive values increase the horizontal spacing between characters, and negative values decrease it.

  • Strikethrough
    Strikethrough
    Strikethrough
    Strikethrough

    Gets or sets whether characters are displayed with a horizontal line through the center.

    public FormatEffect Strikethrough { get; set; }public FormatEffect Strikethrough { get; set; }Public ReadWrite Property Strikethrough As FormatEffectpublic FormatEffect Strikethrough { get; set; }

    Property Value

  • Subscript
    Subscript
    Subscript
    Subscript

    Gets or sets whether characters are displayed as subscript.

    public FormatEffect Subscript { get; set; }public FormatEffect Subscript { get; set; }Public ReadWrite Property Subscript As FormatEffectpublic FormatEffect Subscript { get; set; }

    Property Value

  • Superscript
    Superscript
    Superscript
    Superscript

    Gets or sets whether characters are displayed as superscript.

    public FormatEffect Superscript { get; set; }public FormatEffect Superscript { get; set; }Public ReadWrite Property Superscript As FormatEffectpublic FormatEffect Superscript { get; set; }

    Property Value

  • TextScript
    TextScript
    TextScript
    TextScript

    Gets or sets the character repertoire.

    public TextScript TextScript { get; set; }public TextScript TextScript { get; set; }Public ReadWrite Property TextScript As TextScriptpublic TextScript TextScript { get; set; }

    Property Value

    Remarks

    To learn more about character repertoires, see RichEdit Font Binding. Character repertoires are typically scripts like Arabic and Latin, but there are also character repertoires for symbols and Emoji.

  • Underline
    Underline
    Underline
    Underline

    Gets or sets the type of underlining that the characters use.

    public UnderlineType Underline { get; set; }public UnderlineType Underline { get; set; }Public ReadWrite Property Underline As UnderlineTypepublic UnderlineType Underline { get; set; }

    Property Value

  • Weight
    Weight
    Weight
    Weight

    Gets or sets the font weight of the characters.

    public int Weight { get; set; }public int Weight { get; set; }Public ReadWrite Property Weight As intpublic int Weight { get; set; }

    Property Value

    • int
      int
      int

      The font weight expressed as a numeric value. See Remarks.

    Remarks

    In standard typography API, the weight of a font is typically expressed as a constant name, such as "Bold". Using constant names to set the Weight property is supported through type converter behaviors and by the FontWeights support class.

    The FontWeights values correspond to the "usWeightClass" definition in the OpenType specification. The "usWeightClass" represents an integer value between 1 and 999. Lower values indicate lighter weights; higher values indicate heavier weights.

Methods

  • GetClone()
    GetClone()
    GetClone()
    GetClone()

    Creates a new object that is identical to this character format object.

    public ITextCharacterFormat GetClone()public ITextCharacterFormat GetClone()Public Function GetClone() As ITextCharacterFormatpublic ITextCharacterFormat GetClone()

    Returns

  • IsEqual(ITextCharacterFormat)
    IsEqual(ITextCharacterFormat)
    IsEqual(ITextCharacterFormat)
    IsEqual(ITextCharacterFormat)

    Determines whether this character format object has the same properties as the specified character format object.

    public bool IsEqual(ITextCharacterFormat format)public bool IsEqual(ITextCharacterFormat format)Public Function IsEqual(format As ITextCharacterFormat) As boolpublic bool IsEqual(ITextCharacterFormat format)

    Parameters

    Returns

    • bool
      bool
      bool

      True if the objects have the same properties, or false if they don't.

  • SetClone(ITextCharacterFormat)
    SetClone(ITextCharacterFormat)
    SetClone(ITextCharacterFormat)
    SetClone(ITextCharacterFormat)

    Sets the character formatting by copying another text character formatting object.

    public void SetClone(ITextCharacterFormat value)public void SetClone(ITextCharacterFormat value)Public Function SetClone(value As ITextCharacterFormat) As voidpublic void SetClone(ITextCharacterFormat value)

    Parameters

    Remarks

    Any character formatting values that are undefined in value have no effect.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Text.dll