Foxit PDF SDK
com.foxit.sdk.pdf.annots.RichTextStyle Class Reference

Public Member Functions

 RichTextStyle (Font font, float text_size, int text_alignment, long text_color, boolean is_bold, boolean is_italic, boolean is_underline, boolean is_strikethrough, int mark_style)
 Constructor, with parameters.
More...
 
 RichTextStyle ()
 Constructor.

 
 RichTextStyle (RichTextStyle style)
 Constructor, with another style object.
More...
 
Font getFont ()
 Get a font used in rich text style. More...
 
boolean getIs_bold ()
 Get a boolean value which indicates whether to make text bold or not. More...
 
boolean getIs_italic ()
 Get a boolean value which indicates whether to italicize text or not. More...
 
boolean getIs_strikethrough ()
 Get a boolean value which indicates whether to cross text out with strike through or not. More...
 
boolean getIs_underline ()
 Get a boolean value which indicates whether to underline text or not. More...
 
int getMark_style ()
 Get corner mark style. More...
 
int getText_alignment ()
 Get alignment value. More...
 
long getText_color ()
 Get text color. More...
 
float getText_size ()
 Get text size. More...
 
void set (Font font, float text_size, int text_alignment, long text_color, boolean is_bold, boolean is_italic, boolean is_underline, boolean is_strikethrough, int mark_style)
 Set value.
More...
 
void setFont (Font value)
 Set a font used in rich text style. More...
 
void setIs_bold (boolean value)
 Set a boolean value which indicates whether to make text bold or not. More...
 
void setIs_italic (boolean value)
 Set a boolean value which indicates whether to italicize text or not. More...
 
void setIs_strikethrough (boolean value)
 Set a boolean value which indicates whether to cross text out with strike through or not. More...
 
void setIs_underline (boolean value)
 Set a boolean value which indicates whether to underline text or not. More...
 
void setMark_style (int value)
 Set corner mark style. More...
 
void setText_alignment (int value)
 Set alignment value. More...
 
void setText_color (long value)
 Set text color. More...
 
void setText_size (float value)
 Set text size. More...
 

Static Public Attributes

static final int e_CornerMarkNone = 1
 Corner mark style: none.

 
static final int e_CornerMarkSubscript = 3
 Corner mark style: subscript.

 
static final int e_CornerMarkSuperscript = 2
 Corner mark style: superscript.

 

Detailed Description

This class represents rich text style data, which is used to specify the style of rich text.

Constructor & Destructor Documentation

◆ RichTextStyle() [1/2]

com.foxit.sdk.pdf.annots.RichTextStyle.RichTextStyle ( Font  font,
float  text_size,
int  text_alignment,
long  text_color,
boolean  is_bold,
boolean  is_italic,
boolean  is_underline,
boolean  is_strikethrough,
int  mark_style 
)

Constructor, with parameters.

Parameters
[in]fontA valid font object.
[in]text_sizeText size. It should not be negative value. 0 means text will not be shown.
[in]text_alignmentAlignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.
[in]text_colorText color. Format: 0xRRGGBB.
[in]is_boldA boolean value which indicates whether to make text bold or not.
[in]is_italicA boolean value which indicates whether to italicize text or not.
[in]is_underlineA boolean value which indicates whether to underline text or not.
[in]is_strikethroughA boolean value which indicates whether to cross text out with strike through or not.
[in]mark_styleCorner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.

◆ RichTextStyle() [2/2]

com.foxit.sdk.pdf.annots.RichTextStyle.RichTextStyle ( RichTextStyle  style)

Constructor, with another style object.

Parameters
[in]styleAnother style object.

Member Function Documentation

◆ getFont()

com.foxit.sdk.pdf.annots.RichTextStyle.getFont ( )

Get a font used in rich text style.

  • When current style is used to set a rich text or add/insert a new rich text, this font means "user expects to use this font for a rich text". Then during resetting appearance process, Foxit PDF SDK will check if the expected font is suitable and decide to use it or change to a more suitable font for showing text content.
  • When current style is retrieved from a rich text, this font reprensets the used font of a rich text.


Returns
A font used in rich text style. It should be a valid font object.

◆ getIs_bold()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_bold ( )

Get a boolean value which indicates whether to make text bold or not.

Returns
A boolean value which indicates whether to make text bold or not.

◆ getIs_italic()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_italic ( )

Get a boolean value which indicates whether to italicize text or not.

Returns
A boolean value which indicates whether to italicize text or not.

◆ getIs_strikethrough()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_strikethrough ( )

Get a boolean value which indicates whether to cross text out with strike through or not.

Returns
A boolean value which indicates whether to cross text out with strike through or not.

◆ getIs_underline()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_underline ( )

Get a boolean value which indicates whether to underline text or not.

Returns
A boolean value which indicates whether to underline text or not.

◆ getMark_style()

com.foxit.sdk.pdf.annots.RichTextStyle.getMark_style ( )

Get corner mark style.

Returns
Corner mark style. Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.

◆ getText_alignment()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_alignment ( )

Get alignment value.

Returns
Alignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.

◆ getText_color()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_color ( )

Get text color.

Returns
Text color. Format: 0xRRGGBB.

◆ getText_size()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_size ( )

Get text size.

Returns
Text size. It should not be negative value. 0 means text will not be shown.

◆ set()

void com.foxit.sdk.pdf.annots.RichTextStyle.set ( Font  font,
float  text_size,
int  text_alignment,
long  text_color,
boolean  is_bold,
boolean  is_italic,
boolean  is_underline,
boolean  is_strikethrough,
int  mark_style 
)

Set value.

Parameters
[in]fontA valid font object.
[in]text_sizeText size. It should not be negative value. 0 means text will not be shown.
[in]text_alignmentAlignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.
[in]text_colorText color. Format: 0xRRGGBB.
[in]is_boldA boolean value which indicates whether to make text bold or not.
[in]is_italicA boolean value which indicates whether to italicize text or not.
[in]is_underlineA boolean value which indicates whether to underline text or not.
[in]is_strikethroughA boolean value which indicates whether to cross text out with strike through or not.
[in]mark_styleCorner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.
Returns
None.

◆ setFont()

com.foxit.sdk.pdf.annots.RichTextStyle.setFont ( Font  value)

Set a font used in rich text style.

  • When current style is used to set a rich text or add/insert a new rich text, this font means "user expects to use this font for a rich text". Then during resetting appearance process, Foxit PDF SDK will check if the expected font is suitable and decide to use it or change to a more suitable font for showing text content.
  • When current style is retrieved from a rich text, this font reprensets the used font of a rich text.


Parameters
[in]valueA font used in rich text style. It should be a valid font object.
Returns
None.

◆ setIs_bold()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_bold ( boolean  value)

Set a boolean value which indicates whether to make text bold or not.

Parameters
[in]valueA boolean value which indicates whether to make text bold or not.
Returns
None.

◆ setIs_italic()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_italic ( boolean  value)

Set a boolean value which indicates whether to italicize text or not.

Parameters
[in]valueA boolean value which indicates whether to italicize text or not.
Returns
None.

◆ setIs_strikethrough()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_strikethrough ( boolean  value)

Set a boolean value which indicates whether to cross text out with strike through or not.

Parameters
[in]valueA boolean value which indicates whether to cross text out with strike through or not.
Returns
None.

◆ setIs_underline()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_underline ( boolean  value)

Set a boolean value which indicates whether to underline text or not.

Parameters
[in]valueA boolean value which indicates whether to underline text or not.
Returns
None.

◆ setMark_style()

com.foxit.sdk.pdf.annots.RichTextStyle.setMark_style ( int  value)

Set corner mark style.

Parameters
[in]valueCorner mark style. Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.
Returns
None.

◆ setText_alignment()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_alignment ( int  value)

Set alignment value.

Parameters
[in]valueAlignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.
Returns
None.

◆ setText_color()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_color ( long  value)

Set text color.

Parameters
[in]valueText color. Format: 0xRRGGBB.
Returns
None.

◆ setText_size()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_size ( float  value)

Set text size.

Parameters
[in]valueText size. It should not be negative value. 0 means text will not be shown.
Returns
None.