TextFragmentState

TextFragmentState

Overview

TextFragmentState is a class in Aspose.PDF FOSS for .NET. Inherits from: TextState.

Fragment-level text formatting state.

This class declares 13 methods for TextFragmentState objects in .NET programs. Available methods include: ApplyChangesFrom, IsFitRectangle, MeasureHeight, MeasureString, TextFragmentState, TextState. Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: BackgroundColor, CharacterSpacing, CoordinateOrigin, DrawTextRectangleBorder, Font, FontData, and 31 more.

Properties

NameTypeAccessDescription
BackgroundColorColor?Read/WriteBackground fill applied behind the fragment text.
CharacterSpacingfloatRead/WriteCharacter spacing (Tc) in text-space units.
CoordinateOriginCoordinateOriginRead/WriteWhether positioning treats Y as the baseline or the descender.
FontSizefloatRead/WriteThe fragment’s font size in points: while the fragment’s own size was never set, the one the caller set on every segment when they all agree; else the fragment’s own.
FontStyleFontStylesRead/WriteFont style flags (Bold / Italic).
ForegroundColorColor?Read/WriteFill (non-stroking) colour applied to the rendered glyphs.
FormattingOptionsTextFormattingOptionsRead/WriteText formatting options (wrap mode, line spacing mode, etc.).
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment of the fragment’s text.
HorizontalScalingfloatRead/WriteHorizontal scaling percentage (default 100).
InvisibleboolRead/WriteWhether the text is rendered invisibly (rendering mode 3).
LineSpacingfloatRead/WriteLine spacing (leading) in text-space units.
RenderingModeTextRenderingModeRead/WriteGlyph rendering mode (fill / stroke / clip).
RotationdoubleRead/WriteRotation angle in degrees.
StrikeOutboolRead/WriteWhether the text has strikethrough.
StrokingColorColor?Read/WriteStroke (outline) colour.
SubscriptboolRead/WriteWhether the text is subscript.
SuperscriptboolRead/WriteWhether the text is superscript.
UnderlineboolRead/WriteWhether the text is underlined.
WordSpacingfloatRead/WriteWord spacing (Tw) in text-space units.
FontAspose.Pdf.Text.Font?Read/WriteThe fragment’s font: while the fragment’s own face was never set, the one the caller set on every segment when they all name the same face; else the fragment’s own.
DrawTextRectangleBorderboolRead/WriteWhen true, a rectangular border is drawn around the text bounding box.
TabStopsTabStopsReadTab-stop settings inherited from the owning fragment.
FontNamestring?Read/WriteGets or sets the name of the font family used for the text; null when not set.
TextXIndentfloatReadOn-page start X (points) of the text this state belongs to.
TextHeightfloatReadText height in points: (Ascent +
IsBoldboolRead/WriteWhether the font is bold.
IsItalicboolRead/WriteWhether the font is italic.
IsUnderlineboolRead/WriteWhether the text is underlined.
IsStrikeOutboolRead/WriteWhether the text has strikethrough.
IsSuperscriptboolRead/WriteWhether the text is superscript.
IsSubscriptboolRead/WriteWhether the text is subscript.
LineBoxAscentEmdouble?Read/WriteLine spacing (leading) in text space units.
LineBoxDescentEmdouble?Read/WriteThe line-box descent this caller declares, in em, as a POSITIVE distance below the baseline.
TabTagstringReadString token inserted into the rendered text in place of a tab character.
LineWidthdoubleRead/WriteStroke line width (the w operator) in effect for the run: the pen a stroking RenderingMode outlines the glyphs with.
TextRisedoubleRead/WriteText rise (superscript/subscript offset).
FontDataFontData?Read/WriteExternal font data for embedding (set via FontRepository.OpenFont).

Methods

SignatureDescription
TextFragmentState(fragment: TextFragment)Wrap the fragment’s underlying state so writes flow back to it.
ApplyChangesFrom(textState: TextState)Copy every public formatting property from textState into this state.
IsFitRectangle(str: string, rect: Rectangle)Returns true when the rendered text fits within the supplied rectangle at the current font / size.
MeasureHeight(character: char)Measure the height of a single character at the current font / size, in points.
MeasureString(str: string)Measure the rendered width of str at the current font / size, in points.
TextState()Creates a text state with the default settings: Helvetica at 10 points.
TextState(fontSize: double)Creates a text state with the given font size, in points.
TextState(fontFamily: string)Creates a text state that uses the named font family.
TextState(fontFamily: string, fontSize: double)Creates a text state that uses the named font family at the given size, in points.
TextState(fontFamily: string, bold: bool, italic: bool)Creates a text state that uses the named font family with the given bold and italic flags; the styled face (e.g.
TextState(foregroundColor: System.Drawing.Color)Creates a text state with the given text (foreground) colour.
TextState(foregroundColor: System.Drawing.Color, fontSize: double)Creates a text state with the given text (foreground) colour and font size, in points.
TextState(foregroundColor: System.Drawing.Color, backgroundColor: System.Drawing.Color, fontStyle: FontStyles, font: Font, fontSize: double)Colours, style, face and size in one call.

See Also

 English