TextRun Class Documentation

classTextRun

Namespace:datalogics_interface

Detailed Description

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

All the characters contained within a text run have the same style, color, font, and size.

Referenced by

Constructor & Destructor Documentation

TextRun

TextRun(const std::string &text, Font &font, GraphicState &gstate, TextState &tstate, const Matrix &matrix)

Parameters

text: const std::string &

The text content for this run.

font: Font &

The font to use for rendering the text.

gstate: GraphicState &

The graphic state (colors, line width, etc.) for this text run.

tstate: TextState &

The text state (character spacing, word spacing, font size, etc.) for this text run.

matrix: const Matrix &

The transformation matrix positioning this text run in user space.

Creates a new TextRun with the specified text, font, graphic state, text state, and matrix.

~TextRun

~TextRun()

Member Function Documentation

clear_graphic_state

voidclear_graphic_state()

Returns:

void

Removes the graphic state from this text run.

get_advance

doubleget_advance()

Returns:

The advance width of this text run.

Deprecated, use Text.GetAdvanceForTextRun(int textRunIndex) instead. This version does not indicate the direction of the advance width.

The advance width of this run of text, in user space.

The advance width is the amount by which the current point advances when the text run is drawn.

get_bounding_box

Rectget_bounding_box()

Returns:

Rect

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

All the characters contained within a text run have the same style, color, font, and size.

get_font

Fontget_font()

Returns:

The font for this text run.

The font used to render this TextRun.

get_graphic_state

Returns:

The GraphicState for this text run, or null.

The graphic state (colors, line width, etc.) of the text run.

May return null if this element does not have a GraphicState.

get_matrix

Matrixget_matrix()

Returns:

Matrix

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

All the characters contained within a text run have the same style, color, font, and size.

get_text

std::stringget_text()

Returns:

The text string for this run.

The Unicode text content of this TextRun.

get_text_state

TextStateget_text_state()

Returns:

The TextState for this text run.

The text state parameters (character spacing, word spacing, font size, etc.) of this TextRun.

set_font

voidset_font(Font &font)

Parameters

font: Font &

The new font for this text run.

Returns:

void

The font used to render this TextRun.

set_graphic_state

voidset_graphic_state(const GraphicState &gstate)

Parameters

gstate: const GraphicState &

- the new/updated Graphic State for the text run.

Returns:

void

Set the Graphic State of the text run.

set_matrix

voidset_matrix(const Matrix &matrix)

Parameters

Returns:

void

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

All the characters contained within a text run have the same style, color, font, and size.

set_text

voidset_text(const std::string &text)

Parameters

text: const std::string &

The new text content for this run.

Returns:

void

The Unicode text content of this TextRun.