com.foxit.sdk.pdf.graphics.TextState Class Reference

Public Member Functions

 TextState (int version, Font font, float font_size, float charspace, float wordspace, int textmode, PointF origin_position, float[] textmatrix)
 Constructor, with parameters.
More...
 
 TextState ()
 Constructor.

 
 TextState (TextState state)
 Constructor, with another TextState object.
More...
 
float getCharspace ()
 Get character spacing. More...
 
Font getFont ()
 Get font object. More...
 
float getFont_size ()
 Get font size. 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 font object. More...
 
void setFont_size (float value)
 Set font size. 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
versionVersion of this structure, which is used to decide which members are useful. Currently, only 1 is valid.
font(Version 1) A valid Font object.
font_size(Version 1) Font size. It should be above 0.
charspace(Version 1) Character spacing.
wordspace(Version 1) Word spacing (only apply to space character).
textmode(Version 1) Text rendering mode. Please refer to values starting from e_ModeFill and this should be one of these values.
origin_position(Version 1) The origin point, in PDF coordinate system .
textmatrix(Version 1) Text transformation matrix.
Returns
None.

◆ TextState() [2/2]

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

Constructor, with another TextState object.

Parameters
stateAnother TextState object.

Member Function Documentation

◆ 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 font object.


Returns
Font object.

◆ getFont_size()

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

Get font size.


Returns
Font size. If valid, it should 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.


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 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 TextState::getFont 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
versionVersion of this structure, which is used to decide which members are useful. Currently, only 1 is valid.
font(Version 1) A valid Font object.
font_size(Version 1) Font size. It should be above 0.
charspace(Version 1) Character spacing.
wordspace(Version 1) Word spacing (only apply to space character).
textmode(Version 1) Text rendering mode. Please refer to values starting from e_ModeFill and this should be one of these values.
origin_position(Version 1) The origin point, in PDF coordinate system .
textmatrix(Version 1) Text transformation matrix.
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]charspaceCharacter spacing.
Returns
None.

◆ setFont()

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

Set font object.


Parameters
[in]fontFont object.
Returns
None.

◆ setFont_size()

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

Set font size.


Parameters
[in]font_sizeFont size. If valid, it should 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]origin_positionThe origin point, in PDF coordinate system .
Returns
None.

◆ setTextmatrix()

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

Set text transformation matrix.


Parameters
[in]textmatrixText transformation matrix.
Returns
None.

◆ setTextmode()

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

Set text rendering mode.


Parameters
[in]textmodeText rendering mode. Please refer to values starting from 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]versionVersion 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 TextState::getFont is an embedded font.

Parameters
[in]wordspaceWord spacing (only apply to space character).
Returns
None.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.