TextState

Overview

TextState is a class in Aspose.PDF FOSS for .NET.

Text formatting state.

This class provides 10 methods for working with TextState objects in .NET programs. Available methods include: ApplyChangesFrom, MeasureHeight, MeasureString, TextState. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: BackgroundColor, CharacterSpacing, CoordinateOrigin, Font, FontData, FontName, and 25 more.

Properties

NameTypeAccessDescription
FontNamestring?Read/WriteGets or sets the font name.
TextHeightfloatReadApproximate text height in points; approximates the glyph-bounding-box-derived height by returning the font size (typical ratio between FontSize and rendered text height is close enough for the layout math callers use this for).
FontSizefloatRead/WriteGets or sets the font size.
ForegroundColorColor?Read/WriteGets or sets the foreground color.
StrokingColorColor?Read/WriteStroking (outline) color of the text.
CoordinateOriginCoordinateOriginRead/WriteWhether text positioning treats Y as the baseline or the descender.
BackgroundColorColor?Read/WriteGets or sets the background color.
IsBoldboolRead/WriteWhether the font is bold.
IsItalicboolRead/WriteWhether the font is italic.
FontStyleFontStylesRead/WriteFont style flags (Bold, Italic, etc.).
UnderlineboolRead/WriteWhether the text is underlined (alias for IsUnderline).
IsUnderlineboolRead/WriteWhether the text is underlined.
IsStrikeOutboolRead/WriteWhether the text has strikethrough.
StrikeOutboolRead/WriteAlias for IsStrikeOut.
IsSuperscriptboolRead/WriteWhether the text is superscript.
SuperscriptboolRead/WriteAlias for IsSuperscript.
IsSubscriptboolRead/WriteWhether the text is subscript.
SubscriptboolRead/WriteAlias for IsSubscript.
CharacterSpacingfloatRead/WriteCharacter spacing in text space units.
WordSpacingfloatRead/WriteWord spacing in text space units.
HorizontalScalingfloatRead/WriteHorizontal scaling percentage (default 100).
LineSpacingfloatRead/WriteLine spacing (leading) in text space units.
TabTagstringReadString token inserted into the rendered text in place of a tab character.
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment of the text.
RenderingModeTextRenderingModeRead/WriteText rendering mode (Tr operator).
InvisibleboolRead/WriteWhether this text fragment is invisible (rendering mode 3).
TextRisedoubleRead/WriteText rise (superscript/subscript offset).
RotationdoubleRead/WriteText rotation angle in degrees.
FontFont?Read/WriteGets or sets the font.
FontDataFontData?Read/WriteExternal font data for embedding (set via FontRepository.OpenFont).
FormattingOptionsTextFormattingOptionsRead/WriteText formatting options (WordWrapMode, LineSpacingMode, etc.).

Methods

SignatureDescription
TextState()Calls TextState on this TextState instance.
TextState(fontSize: double)Calls TextState(fontSize) on this TextState instance.
TextState(fontFamily: string)Calls TextState(fontFamily) on this TextState instance.
TextState(fontFamily: string, fontSize: double)Calls TextState(fontFamily, fontSize) on this TextState instance.
TextState(fontFamily: string, bold: bool, italic: bool)Calls TextState(fontFamily, bold, italic) on this TextState instance.
TextState(foregroundColor: System.Drawing.Color)Calls TextState(foregroundColor) on this TextState instance.
TextState(foregroundColor: System.Drawing.Color, fontSize: double)Calls TextState(foregroundColor, fontSize) on this TextState instance.
MeasureString(str: string)Rough text-width estimate at the current font/size.
MeasureHeight(character: char)Rough character-height estimate at the current font/size.
ApplyChangesFrom(textState: TextState)Copy every public formatting property from other into this state (leaving owner linkage intact).

See Also