Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.graphics.TextState Class Reference

## Public Member Functions
| TextState ()
| Constructor.
| TextState (int version, Font font, float font_size, float charspace, float wordspace, int textmode, PointF origin_position, float[] textmatrix)
| Constructor, with parameters. More...
| TextState (TextState state)
| Constructor, with another text state object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
float | getCharspace ()
| Get character spacing. More...
Font | getFont ()
| Get a font object. More...
float | getFont_horizontal_size ()
| Get font horizontal size in device units (read-only). More...
float | getFont_size ()
| Get the font size in "Tf". More...
float | getFont_vertical_size ()
| Get font vertical size in device units (read-only). More...
PointF | getOrigin_position ()
| Get the origin point, in PDF coordinate system. More...
float[] | getTextmatrix ()
| Get text transformation matrix. More...
int | getTextmode ()
| Get text rendering mode. More...
int | getVersion ()
| Get version of this class. More...
float | getWordspace ()
| Get word spacing (only apply to space character). More...
void | set (int version, Font font, float font_size, float charspace, float wordspace, int textmode, PointF origin_position, float[] textmatrix)
| Set value. More...
void | setCharspace (float value)
| Set character spacing. More...
void | setFont (Font value)
| Set a font object. More...
void | setFont_horizontal_size (float value)
| Set font horizontal size in device units (read-only). More...
void | setFont_size (float value)
| Set the font size in "Tf". More...
void | setFont_vertical_size (float value)
| Set font vertical size in device units (read-only). More...
void | setOrigin_position (PointF value)
| Set the origin point, in PDF coordinate system. More...
void | setTextmatrix (float[] value)
| Set text transformation matrix. More...
void | setTextmode (int value)
| Set text rendering mode. More...
void | setVersion (int value)
| Set version of this class. More...
void | setWordspace (float value)
| Set word spacing (only apply to space character). More...

## Static Public Attributes
static final int | e_ModeClip = 7
| Text mode: add text to path for clipping.
static final int | e_ModeFill = 0
| Text mode: fill text.
static final int | e_ModeFillClip = 4
| Text mode: fill text and add to path for clipping.
static final int | e_ModeFillStroke = 2
| Text mode: fill and stroke text.
static final int | e_ModeFillStrokeClip = 6
| Text mode: fill and stroke text, and add to path for clipping.
static final int | e_ModeInvisible = 3
| Text mode: neither fill nor stroke text, to make it invisible.
static final int | e_ModeStroke = 1
| Text mode: stroke text.
static final int | e_ModeStrokeClip = 5
| Text mode: stroke text and add to path for clipping.

## Detailed Description

This class represents PDF text state.

## Constructor & Destructor Documentation

## ◆ TextState() [1/2]

com.foxit.sdk.pdf.graphics.TextState.TextState | ( | int | version,
|  | Font | font,
|  | float | font_size,
|  | float | charspace,
|  | float | wordspace,
|  | int | textmode,
|  | PointF | origin_position,
|  | float[] | textmatrix
| ) |  |

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 com.foxit.sdk.pdf.graphics.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]

com.foxit.sdk.pdf.graphics.TextState.TextState | ( | TextState | state | ) |

Constructor, with another text state object.

Parameters

  [in] | state | Another text state object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.graphics.TextState.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ getCharspace()

com.foxit.sdk.pdf.graphics.TextState.getCharspace | ( |  | ) |

Get character spacing.

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.

Returns
  Character spacing.

## ◆ getFont()

com.foxit.sdk.pdf.graphics.TextState.getFont | ( |  | ) |

Get a font object.

Returns
  A font object.

## ◆ getFont_horizontal_size()

com.foxit.sdk.pdf.graphics.TextState.getFont_horizontal_size | ( |  | ) |

Get font horizontal size in device units (read-only).

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

## ◆ getFont_size()

com.foxit.sdk.pdf.graphics.TextState.getFont_size | ( |  | ) |

Get the font size in "Tf".

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

## ◆ getFont_vertical_size()

com.foxit.sdk.pdf.graphics.TextState.getFont_vertical_size | ( |  | ) |

Get font vertical size in device units (read-only).

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

## ◆ getOrigin_position()

com.foxit.sdk.pdf.graphics.TextState.getOrigin_position | ( |  | ) |

Get the origin point, in PDF coordinate system.

Returns
  The origin point, in PDF coordinate system.

## ◆ getTextmatrix()

com.foxit.sdk.pdf.graphics.TextState.getTextmatrix | ( |  | ) |

Get text transformation matrix.

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.

Returns
  Text transformation matrix.

## ◆ getTextmode()

com.foxit.sdk.pdf.graphics.TextState.getTextmode | ( |  | ) |

Get text rendering mode.

Returns
  Text rendering mode. Please refer to values starting from com.foxit.sdk.pdf.graphics.TextState.e_ModeFill and this should be one of these values.

## ◆ getVersion()

com.foxit.sdk.pdf.graphics.TextState.getVersion | ( |  | ) |

Get version of this class.

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

Returns
  Version of this class.

## ◆ getWordspace()

com.foxit.sdk.pdf.graphics.TextState.getWordspace | ( |  | ) |

Get word spacing (only apply to space character).

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.

Returns
  Word spacing (only apply to space character).

## ◆ set()

void com.foxit.sdk.pdf.graphics.TextState.set | ( | int | version,
|  | Font | font,
|  | float | font_size,
|  | float | charspace,
|  | float | wordspace,
|  | int | textmode,
|  | PointF | origin_position,
|  | float[] | textmatrix
| ) |  |

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 com.foxit.sdk.pdf.graphics.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.

## ◆ setCharspace()

com.foxit.sdk.pdf.graphics.TextState.setCharspace | ( | float | value | ) |

Set character spacing.

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.

Parameters

  [in] | value | Character spacing.

Returns
  None.

## ◆ setFont()

com.foxit.sdk.pdf.graphics.TextState.setFont | ( | Font | value | ) |

Set a font object.

Parameters

  [in] | value | A font object.

Returns
  None.

## ◆ setFont_horizontal_size()

com.foxit.sdk.pdf.graphics.TextState.setFont_horizontal_size | ( | float | value | ) |

Set font horizontal size in device units (read-only).

Parameters

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

Returns
  None.

## ◆ setFont_size()

com.foxit.sdk.pdf.graphics.TextState.setFont_size | ( | float | value | ) |

Set the font size in "Tf".

Parameters

  [in] | value | The font size in "Tf". If valid, it should be above 0.

Returns
  None.

## ◆ setFont_vertical_size()

com.foxit.sdk.pdf.graphics.TextState.setFont_vertical_size | ( | float | value | ) |

Set font vertical size in device units (read-only).

Parameters

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

Returns
  None.

## ◆ setOrigin_position()

com.foxit.sdk.pdf.graphics.TextState.setOrigin_position | ( | PointF | value | ) |

Set the origin point, in PDF coordinate system.

Parameters

  [in] | value | The origin point, in PDF coordinate system.

Returns
  None.

## ◆ setTextmatrix()

com.foxit.sdk.pdf.graphics.TextState.setTextmatrix | ( | float[] | value | ) |

Set text transformation matrix.

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.

Parameters

  [in] | value | Text transformation matrix.

Returns
  None.

## ◆ setTextmode()

com.foxit.sdk.pdf.graphics.TextState.setTextmode | ( | int | value | ) |

Set text rendering mode.

Parameters

  [in] | value | Text rendering mode. Please refer to values starting from com.foxit.sdk.pdf.graphics.TextState.e_ModeFill and this should be one of these values.

Returns
  None.

## ◆ setVersion()

com.foxit.sdk.pdf.graphics.TextState.setVersion | ( | int | value | ) |

Set version of this class.

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

Parameters

  [in] | value | Version of this class.

Returns
  None.

## ◆ setWordspace()

com.foxit.sdk.pdf.graphics.TextState.setWordspace | ( | float | value | ) |

Set word spacing (only apply to space character).

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.

Parameters

  [in] | value | Word spacing (only apply to space character).

Returns
  None.