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 26 more.

Properties

NameTypeAccessDescription
FontNamestring?Read/WriteGets or sets the font name.
TextXIndentfloatReadOn-page start X (points) of the text this state belongs to.
TextHeightfloatReadText height in points: (Ascent +
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, or text that a LATER opaque filled rectangle fully covers (hidden-by-occlusion, the way Aspose.Pdf reports redaction-style covered text while its RenderingMode stays FillText).
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)Height of character at the current font / size, in points — the glyph’s own bounding-box height (yMax − yMin) mapped to text space as height × FontSize / 1000.
ApplyChangesFrom(textState: TextState)Copy every public formatting property from other into this state (leaving owner linkage intact).

See Also

 English