Redigera

Dela via


FormattedText Constructors

Definition

Initializes a new instance of the FormattedText class.

Overloads

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush)
Obsolete.

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, and brush.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, and pixelsPerDip value.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution)
Obsolete.

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, brush, and number substitution behavior.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, number substitution behavior, and pixelsPerDip value.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode)
Obsolete.

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, brush, number substitution behavior, and text formatting mode.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, number substitution behavior, and pixelsPerDip value.

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush)

Caution

Use the PixelsPerDip override

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, and brush.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush)

Parameters

textToFormat
String

The text to be displayed.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size the text should be formatted at.

foreground
Brush

The brush used to paint the each glyph.

Attributes

Applies to

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, and pixelsPerDip value.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, pixelsPerDip As Double)

Parameters

textToFormat
String

The text to be displayed.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size for the text's em measure, provided in device-independent units (1/96th inch per unit).

foreground
Brush

The brush used to paint the each glyph.

pixelsPerDip
Double

The Pixels Per Density Independent Pixel value, which is the equivalent of the scale factor. For example, if the DPI of a screen is 120 (or 1.25 because 120/96 = 1.25) , 1.25 pixel per density independent pixel is drawn. DIP is the unit of measurement used by WPF to be independent of device resolution and DPIs.

Applies to

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution)

Caution

Use the PixelsPerDip override

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, brush, and number substitution behavior.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution)

Parameters

textToFormat
String

The text to be displayed.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size for the text's em measure, provided in device-independent units (1/96th inch per unit).

foreground
Brush

The brush used to paint the each glyph.

numberSubstitution
NumberSubstitution

The number substitution behavior to apply to the text.

Attributes

Applies to

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, number substitution behavior, and pixelsPerDip value.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, pixelsPerDip As Double)

Parameters

textToFormat
String

The text to display.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size for the text's em measure, provided in device-independent units (1/96th inch per unit).

foreground
Brush

The brush used to paint the each glyph.

numberSubstitution
NumberSubstitution

Specifies how numbers in text are displayed, based on NumberSubstitution. This value can be null.

pixelsPerDip
Double

The Pixels Per Density Independent Pixel value, which is the equivalent of the scale factor. For example, if the DPI of a screen is 120 (or 1.25 because 120/96 = 1.25) , 1.25 pixel per density independent pixel is drawn. DIP is the unit of measurement used by WPF to be independent of device resolution and DPIs.

Applies to

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode)

Caution

Use the PixelsPerDip override

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, brush, number substitution behavior, and text formatting mode.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, System::Windows::Media::TextFormattingMode textFormattingMode);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, textFormattingMode As TextFormattingMode)

Parameters

textToFormat
String

The text to be displayed.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size for the text's em measure, provided in device-independent units (1/96th inch per unit).

foreground
Brush

The brush used to paint the each glyph.

numberSubstitution
NumberSubstitution

The number substitution behavior to apply to the text.

textFormattingMode
TextFormattingMode

The TextFormattingMode to apply to the text.

Attributes

Applies to

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode, Double)

Initializes a new instance of the FormattedText class with the specified text, culture, flow direction, typeface, font size, foreground brush, number substitution behavior, and pixelsPerDip value.

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, System::Windows::Media::TextFormattingMode textFormattingMode, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, textFormattingMode As TextFormattingMode, pixelsPerDip As Double)

Parameters

textToFormat
String

The text to display.

culture
CultureInfo

The specific culture of the text.

flowDirection
FlowDirection

The direction the text is read.

typeface
Typeface

The font family, weight, style and stretch the text should be formatted with.

emSize
Double

The font size for the text's em measure, provided in device-independent units (1/96th inch per unit).

foreground
Brush

he brush used to paint the each glyph.

numberSubstitution
NumberSubstitution

Specifies how numbers in text are displayed, based on NumberSubstitution. This value can be null.

textFormattingMode
TextFormattingMode

The formatting mode that affects how WPF displays text.

pixelsPerDip
Double

The Pixels Per Density Independent Pixel value, which is the equivalent of the scale factor. For example, if the DPI of a screen is 120 (or 1.25 because 120/96 = 1.25) , 1.25 pixel per density independent pixel is drawn. DIP is the unit of measurement used by WPF to be independent of device resolution and DPIs.

Applies to