Foxit PDF SDK

Public Types | Public Member Functions | Public Attributes | List of all members
foxit::pdf::graphics::TextState Class Reference

Inherits Object.

## Public Types
enum | Mode { e_ModeFill = 0, e_ModeStroke = 1, e_ModeFillStroke = 2, e_ModeInvisible = 3, e_ModeFillClip = 4, e_ModeStrokeClip = 5, e_ModeFillStrokeClip = 6, e_ModeClip = 7 }
| Enumeration for text mode. More...

## Public Member Functions
| TextState ()
| Constructor.
| TextState (const TextState &state)
| Constructor, with another text state object. More...
| TextState (uint32 version, const common::Font &font, float font_size, float charspace, float wordspace, Mode textmode, const PointF &origin_position, float textmatrix[4])
| Constructor, with parameters. More...
TextState & | operator= (const TextState &state)
| Assign operator. More...
void | Set (uint32 version, const common::Font &font, float font_size, float charspace, float wordspace, Mode textmode, const PointF &origin_position, float textmatrix[4])
| Set value. More...

## Public Attributes
float | charspace
| Character spacing. More...
common::Font | font
| A font object. More...
float | font_horizontal_size
| Font horizontal size in device units (read-only). If valid, it would be above 0. More...
float | font_size
| The font size in "Tf". If valid, it should be above 0. More...
float | font_vertical_size
| Font vertical size in device units (read-only). If valid, it would be above 0. More...
PointF | origin_position
| The origin point, in PDF coordinate system. More...
float | textmatrix [4]
| Text transformation matrix. More...
Mode | textmode
| Text rendering mode. Please refer to values starting from TextState::e_ModeFill and this should be one of these values. More...
uint32 | version
| Version of this class. More...
float | wordspace
| Word spacing (only apply to space character). More...

## Detailed Description

This class represents PDF text state.

## Member Enumeration Documentation

## ◆ Mode

enum foxit::pdf::graphics::TextState::Mode

Enumeration for text mode.

Values of this enumeration should be used alone.

Enumerator
e_ModeFill | Text mode: fill text.
e_ModeStroke | Text mode: stroke text.
e_ModeFillStroke | Text mode: fill and stroke text.
e_ModeInvisible | Text mode: neither fill nor stroke text, to make it invisible.
e_ModeFillClip | Text mode: fill text and add to path for clipping.
e_ModeStrokeClip | Text mode: stroke text and add to path for clipping.
e_ModeFillStrokeClip | Text mode: fill and stroke text, and add to path for clipping.
e_ModeClip | Text mode: add text to path for clipping.

## Constructor & Destructor Documentation

## ◆ TextState() [1/2]

foxit::pdf::graphics::TextState::TextState | ( | uint32 | version,
|  | const common::Font & | font,
|  | float | font_size,
|  | float | charspace,
|  | float | wordspace,
|  | Mode | textmode,
|  | const PointF & | origin_position,
|  | float | textmatrix[4]
| ) |  |
| inline

Constructor, with parameters.

Parameters

  [in] | version | Version of this structure, which is used to decide which members are useful. Currently, only 1 is valid.
  [in] | font | (Version 1) A valid font object.
  [in] | font_size | (Version 1) The font size in "Tf", It should be above 0.
  [in] | charspace | (Version 1) Character spacing.
  [in] | wordspace | (Version 1) Word spacing (only apply to space character).
  [in] | textmode | (Version 1) Text rendering mode. Please refer to values starting from TextState::e_ModeFill and this should be one of these values.
  [in] | origin_position | (Version 1) The origin point, in PDF coordinate system.
  [in] | textmatrix | (Version 1) Text transformation matrix. This is an array of four numbers.

Returns
  None.

## ◆ TextState() [2/2]

foxit::pdf::graphics::TextState::TextState | ( | const TextState & | state | ) |
| inline

Constructor, with another text state object.

Parameters

  [in] | state | Another text state object.

## Member Function Documentation

## ◆ operator=()

TextState& foxit::pdf::graphics::TextState::operator= | ( | const TextState & | state | ) |
| inline

Assign operator.

Parameters

  [in] | state | Another text state object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ Set()

void foxit::pdf::graphics::TextState::Set | ( | uint32 | version,
|  | const common::Font & | font,
|  | float | font_size,
|  | float | charspace,
|  | float | wordspace,
|  | Mode | textmode,
|  | const PointF & | origin_position,
|  | float | textmatrix[4]
| ) |  |
| inline

Set value.

Parameters

  [in] | version | Version of this structure, which is used to decide which members are useful. Currently, only 1 is valid.
  [in] | font | (Version 1) A valid font object.
  [in] | font_size | (Version 1) The font size in "Tf". It should be above 0.
  [in] | charspace | (Version 1) Character spacing.
  [in] | wordspace | (Version 1) Word spacing (only apply to space character).
  [in] | textmode | (Version 1) Text rendering mode. Please refer to values starting from TextState::e_ModeFill and this should be one of these values.
  [in] | origin_position | (Version 1) The origin point, in PDF coordinate system.
  [in] | textmatrix | (Version 1) Text transformation matrix. This is an array of four numbers.

Returns
  None.

## Member Data Documentation

## ◆ charspace

float foxit::pdf::graphics::TextState::charspace

Character spacing.

Version
  1

For horizontal writing, a positive value has the effect of expanding the distance between glyphs, whereas for vertical writing, a negative value has this effect.

## ◆ font

common::Font foxit::pdf::graphics::TextState::font

A font object.

Version
  1

## ◆ font_horizontal_size

float foxit::pdf::graphics::TextState::font_horizontal_size

Font horizontal size in device units (read-only). If valid, it would be above 0.

Version
  1

## ◆ font_size

float foxit::pdf::graphics::TextState::font_size

The font size in "Tf". If valid, it should be above 0.

Version
  1

## ◆ font_vertical_size

float foxit::pdf::graphics::TextState::font_vertical_size

Font vertical size in device units (read-only). If valid, it would be above 0.

Version
  1

## ◆ origin_position

PointF foxit::pdf::graphics::TextState::origin_position

The origin point, in PDF coordinate system.

Version
  1

## ◆ textmatrix

float foxit::pdf::graphics::TextState::textmatrix[4]

Text transformation matrix.

Version
  1

This is an array of four numbers. The first number is the input coefficient a, the second number is the input coefficient b, the third number is the input coefficient c, the forth number is the input coefficient d.

## ◆ textmode

Mode foxit::pdf::graphics::TextState::textmode

Text rendering mode. Please refer to values starting from TextState::e_ModeFill and this should be one of these values.

Version
  1

## ◆ version

uint32 foxit::pdf::graphics::TextState::version

Version of this class.

Version
  1

Members of this class may be extended in the future. This version can be used to separate the different extended members.

## ◆ wordspace

float foxit::pdf::graphics::TextState::wordspace

Word spacing (only apply to space character).

Version
  1

For horizontal writing, a positive value has the effect of increasing the spacing between words. For vertical writing, a positive value decreases the spacing between words (and a negative value increases it), since vertical coordinates increase from bottom to top. This will not take effect if font of current object is an embedded font.