ITextCharacterFormat ITextCharacterFormat ITextCharacterFormat ITextCharacterFormat Interface

Definition

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

public : interface ITextCharacterFormat
struct winrt::Windows::UI::Text::ITextCharacterFormat
public interface ITextCharacterFormat
Public Interface ITextCharacterFormat
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

AllCaps AllCaps AllCaps AllCaps

Gets or sets whether the characters are all uppercase.

public : FormatEffect AllCaps { get; set; }
FormatEffect AllCaps(); void AllCaps(FormatEffect allcaps);
public FormatEffect AllCaps { get; set; }
Public ReadWrite Property AllCaps As FormatEffect
Value
FormatEffect FormatEffect

The uppercase state.

BackgroundColor BackgroundColor BackgroundColor BackgroundColor

Gets or sets the text background (highlight) color.

public : Color BackgroundColor { get; set; }
Color BackgroundColor(); void BackgroundColor(Color backgroundcolor);
public Color BackgroundColor { get; set; }
Public ReadWrite Property BackgroundColor As Color
Value
Color Color

The text background color.

Bold Bold Bold Bold

Gets or sets whether the characters are bold.

public : FormatEffect Bold { get; set; }
FormatEffect Bold(); void Bold(FormatEffect bold);
public FormatEffect Bold { get; set; }
Public ReadWrite Property Bold As FormatEffect
Value
FormatEffect FormatEffect

The bold state.

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; }
FontStretch FontStretch(); void FontStretch(FontStretch fontstretch);
public FontStretch FontStretch { get; set; }
Public ReadWrite Property FontStretch As FontStretch
Value
FontStretch FontStretch

The degree to which the font is stretched.

FontStyle FontStyle FontStyle FontStyle

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

public : FontStyle FontStyle { get; set; }
FontStyle FontStyle(); void FontStyle(FontStyle fontstyle);
public FontStyle FontStyle { get; set; }
Public ReadWrite Property FontStyle As FontStyle
Value
FontStyle FontStyle

The font style.

ForegroundColor ForegroundColor ForegroundColor ForegroundColor

Gets or sets the foreground, or text, color.

public : Color ForegroundColor { get; set; }
Color ForegroundColor(); void ForegroundColor(Color foregroundcolor);
public Color ForegroundColor { get; set; }
Public ReadWrite Property ForegroundColor As Color
Value
Color Color

The foreground color.

Hidden Hidden Hidden Hidden

Gets or sets whether characters are hidden.

public : FormatEffect Hidden { get; set; }
FormatEffect Hidden(); void Hidden(FormatEffect hidden);
public FormatEffect Hidden { get; set; }
Public ReadWrite Property Hidden As FormatEffect
Value
FormatEffect FormatEffect

The hidden state.

Italic Italic Italic Italic

Gets or sets whether characters are in italics.

public : FormatEffect Italic { get; set; }
FormatEffect Italic(); void Italic(FormatEffect italic);
public FormatEffect Italic { get; set; }
Public ReadWrite Property Italic As FormatEffect
Value
FormatEffect FormatEffect

The italicized state.

Kerning Kerning Kerning Kerning

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

public : float Kerning { get; set; }
float Kerning(); void Kerning(float kerning);
public float Kerning { get; set; }
Public ReadWrite Property Kerning As float
Value
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 : Platform::String LanguageTag { get; set; }
winrt::hstring LanguageTag(); void LanguageTag(winrt::hstring languagetag);
public string LanguageTag { get; set; }
Public ReadWrite Property LanguageTag As string
Value
string string

The language tag.

LinkType LinkType LinkType LinkType

Gets the link type of the text.

public : LinkType LinkType { get; }
LinkType LinkType();
public LinkType LinkType { get; }
Public ReadOnly Property LinkType As LinkType
Value
LinkType LinkType

The link type.

Name Name Name Name

Gets or sets the font name.

public : Platform::String Name { get; set; }
winrt::hstring Name(); void Name(winrt::hstring name);
public string Name { get; set; }
Public ReadWrite Property Name As string
Value
string string

The font name.

Outline Outline Outline Outline

Gets or sets whether characters are displayed as outlined characters.

public : FormatEffect Outline { get; set; }
FormatEffect Outline(); void Outline(FormatEffect outline);
public FormatEffect Outline { get; set; }
Public ReadWrite Property Outline As FormatEffect
Value
FormatEffect FormatEffect

The outlined state.

Position Position Position Position

Gets or sets the character offset relative to the baseline.

public : float Position { get; set; }
float Position(); void Position(float position);
public float Position { get; set; }
Public ReadWrite Property Position As float
Value
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; }
FormatEffect ProtectedText(); void ProtectedText(FormatEffect protectedtext);
public FormatEffect ProtectedText { get; set; }
Public ReadWrite Property ProtectedText As FormatEffect
Value
FormatEffect FormatEffect

The protected state.

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; }
float Size(); void Size(float size);
public float Size { get; set; }
Public ReadWrite Property Size As float
Value
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; }
FormatEffect SmallCaps(); void SmallCaps(FormatEffect smallcaps);
public FormatEffect SmallCaps { get; set; }
Public ReadWrite Property SmallCaps As FormatEffect
Value
FormatEffect FormatEffect

The small capitals state.

Spacing Spacing Spacing Spacing

Gets or sets the amount of horizontal spacing between characters.

public : float Spacing { get; set; }
float Spacing(); void Spacing(float spacing);
public float Spacing { get; set; }
Public ReadWrite Property Spacing As float
Value
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; }
FormatEffect Strikethrough(); void Strikethrough(FormatEffect strikethrough);
public FormatEffect Strikethrough { get; set; }
Public ReadWrite Property Strikethrough As FormatEffect
Value
FormatEffect FormatEffect

The strikethrough state.

Subscript Subscript Subscript Subscript

Gets or sets whether characters are displayed as subscript.

public : FormatEffect Subscript { get; set; }
FormatEffect Subscript(); void Subscript(FormatEffect subscript);
public FormatEffect Subscript { get; set; }
Public ReadWrite Property Subscript As FormatEffect
Value
FormatEffect FormatEffect

The subscript state.

Superscript Superscript Superscript Superscript

Gets or sets whether characters are displayed as superscript.

public : FormatEffect Superscript { get; set; }
FormatEffect Superscript(); void Superscript(FormatEffect superscript);
public FormatEffect Superscript { get; set; }
Public ReadWrite Property Superscript As FormatEffect
Value
FormatEffect FormatEffect

The superscript state.

TextScript TextScript TextScript TextScript

Gets or sets the character repertoire.

public : TextScript TextScript { get; set; }
TextScript TextScript(); void TextScript(TextScript textscript);
public TextScript TextScript { get; set; }
Public ReadWrite Property TextScript As TextScript
Value
TextScript TextScript

The character repertoire.

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; }
UnderlineType Underline(); void Underline(UnderlineType underline);
public UnderlineType Underline { get; set; }
Public ReadWrite Property Underline As UnderlineType
Value
UnderlineType UnderlineType

The type of underlining.

Weight Weight Weight Weight

Gets or sets the font weight of the characters.

public : int Weight { get; set; }
int32_t Weight(); void Weight(int32_t weight);
public int Weight { get; set; }
Public ReadWrite Property Weight As int
Value
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()
ITextCharacterFormat GetClone() const;
public ITextCharacterFormat GetClone()
Public Function GetClone() As ITextCharacterFormat
Returns
See Also

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 : Platform::Boolean IsEqual(ITextCharacterFormat format)
bool IsEqual(ITextCharacterFormat format) const;
public bool IsEqual(ITextCharacterFormat format)
Public Function IsEqual(format As ITextCharacterFormat) As bool
Parameters
format
ITextCharacterFormat ITextCharacterFormat ITextCharacterFormat ITextCharacterFormat

The character format object to compare against.

Returns
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)
void SetClone(ITextCharacterFormat value) const;
public void SetClone(ITextCharacterFormat value)
Public Function SetClone(value As ITextCharacterFormat) As void
Parameters

Remarks

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

See Also