TextRun Class Documentation

class TextRun

Namespace:datalogics_interface

Detailed Description

Represents one or more contiguous characters in a text object.

@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

void clear_graphic_state()

Returns:

void

Removes the graphic state from this text run.

get_advance

double get_advance()

Returns:

double

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

Rect get_bounding_box()

Returns:

Rect

Represents one or more contiguous characters in a text object.

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

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

get_font

Font get_font()

Returns:

Font

The font for this text run.

The font used to render this TextRun.

get_matrix

Matrix get_matrix()

Returns:

Matrix

Represents one or more contiguous characters in a text object.

@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::string get_text()

Returns:

std::string

The text string for this run.

The Unicode text content of this TextRun.

get_text_state

TextState get_text_state()

Returns:

TextState

The TextState for this text run.

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

set_font

void set_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

void set_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

void set_matrix(const Matrix & matrix)

Parameters

Returns:

void

Represents one or more contiguous characters in a text object.

@structure PDEGraphicState @structure PDETextState @structure PDETextItem

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

set_text

void set_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.