<PackageReference Include="System.Drawing.Common" Version="9.0.2" />

StringFormat

Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.
public static StringFormat GenericDefault { get; }

Gets a generic default StringFormat object.

public static StringFormat GenericTypographic { get; }

Gets a generic typographic StringFormat object.

public StringAlignment Alignment { get; set; }

Gets or sets horizontal alignment of the string.

public int DigitSubstitutionLanguage { get; }

Gets the language that is used when local digits are substituted for western digits.

Gets the method to be used for digit substitution.

public StringFormatFlags FormatFlags { get; set; }

Gets or sets a StringFormatFlags enumeration that contains formatting information.

public HotkeyPrefix HotkeyPrefix { get; set; }

Gets or sets the HotkeyPrefix object for this StringFormat object.

public StringAlignment LineAlignment { get; set; }

Gets or sets the vertical alignment of the string.

public StringTrimming Trimming { get; set; }

Gets or sets the StringTrimming enumeration for this StringFormat object.

public StringFormat()

Initializes a new StringFormat object.

public StringFormat(StringFormat format)

Initializes a new StringFormat object from the specified existing StringFormat object.

Initializes a new StringFormat object with the specified StringFormatFlags enumeration.

public StringFormat(StringFormatFlags options, int language)

Initializes a new StringFormat object with the specified StringFormatFlags enumeration and language.

public object Clone()

Creates an exact copy of this StringFormat object.

public void Dispose()

Releases all resources used by this StringFormat object.

public float[] GetTabStops(out float firstTabOffset)

Gets the tab stops for this StringFormat object.

public void SetDigitSubstitution(int language, StringDigitSubstitute substitute)

Specifies the language and method to be used when local digits are substituted for western digits.

Specifies an array of CharacterRange structures that represent the ranges of characters measured by a call to the MeasureCharacterRanges method.

public void SetTabStops(float firstTabOffset, float[] tabStops)

Sets tab stops for this StringFormat object.