Foxit PDF SDK

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

Inherits Object.

## Public Types
enum | CornerMarkStyle { e_CornerMarkNone = 1, e_CornerMarkSuperscript = 2, e_CornerMarkSubscript = 3 }
| Enumeration for corner mark style. More...

## Public Member Functions
| RichTextStyle (const common::Font &font, float text_size, common::Alignment text_alignment, RGB text_color, bool is_bold, bool is_italic, bool is_underline, bool is_strikethrough, CornerMarkStyle mark_style, float char_space, float word_space)
| Constructor, with parameters. More...
| RichTextStyle ()
| Constructor.
| RichTextStyle (const RichTextStyle &style)
| Constructor, with another style object. More...
bool | operator != (const RichTextStyle &style) const
| Not equal operator. More...
RichTextStyle & | operator= (const RichTextStyle &style)
| Assign operator. More...
bool | operator== (const RichTextStyle &style) const
| Equal operator. More...
void | Set (const common::Font &font, float text_size, common::Alignment text_alignment, RGB text_color, bool is_bold, bool is_italic, bool is_underline, bool is_strikethrough, CornerMarkStyle mark_style, float char_space, float word_space)
| Set value. More...

## Public Attributes
float | char_space
| The char space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText.
common::Font | font
| A font used in rich text style. It should be a valid font object. More...
bool | is_bold
| A boolean value which indicates whether to make text bold or not.
bool | is_italic
| A boolean value which indicates whether to italicize text or not.
bool | is_strikethrough
| A boolean value which indicates whether to cross text out with strike through or not.
bool | is_underline
| A boolean value which indicates whether to underline text or not.
CornerMarkStyle | mark_style
| 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 RichTextStyle::e_CornerMarkNone and this should be one of these values.
common::Alignment | text_alignment
| Alignment value. Please refer to values starting from common::e_AlignmentLeft and this should be one of these values.
RGB | text_color
| Text color. Format: 0xRRGGBB.
float | text_size
| Text size. It should not be negative value. 0 means text will not be shown.
float | word_space
| The word space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText.

## Detailed Description

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

## Member Enumeration Documentation

## ◆ CornerMarkStyle

enum foxit::pdf::RichTextStyle::CornerMarkStyle

Enumeration for corner mark style.

Values of this enumeration should be used alone.

Enumerator
e_CornerMarkNone | Corner mark style: none.
e_CornerMarkSuperscript | Corner mark style: superscript.
e_CornerMarkSubscript | Corner mark style: subscript.

## Constructor & Destructor Documentation

## ◆ RichTextStyle() [1/2]

foxit::pdf::RichTextStyle::RichTextStyle | ( | const common::Font & | font,
|  | float | text_size,
|  | common::Alignment | text_alignment,
|  | RGB | text_color,
|  | bool | is_bold,
|  | bool | is_italic,
|  | bool | is_underline,
|  | bool | is_strikethrough,
|  | CornerMarkStyle | mark_style,
|  | float | char_space,
|  | float | word_space
| ) |  |
| inline

Constructor, with parameters.

Parameters

  [in] | font | A valid font object.
  [in] | text_size | Text size. It should not be negative value. 0 means text will not be shown.
  [in] | text_alignment | Alignment value. Please refer to values starting from common::e_AlignmentLeft and this should be one of these values.
  [in] | text_color | Text color. Format: 0xRRGGBB.
  [in] | is_bold | A boolean value which indicates whether to make text bold or not.
  [in] | is_italic | A boolean value which indicates whether to italicize text or not.
  [in] | is_underline | A boolean value which indicates whether to underline text or not.
  [in] | is_strikethrough | A boolean value which indicates whether to cross text out with strike through or not.
  [in] | 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 RichTextStyle::e_CornerMarkNone and this should be one of these values.
  [in] | char_space | The char space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText and table generator.
  [in] | word_space | The word space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText and table generator.

## ◆ RichTextStyle() [2/2]

foxit::pdf::RichTextStyle::RichTextStyle | ( | const RichTextStyle & | style | ) |
| inline

Constructor, with another style object.

Parameters

  [in] | style | Another style object.

## Member Function Documentation

## ◆ operator !=()

bool foxit::pdf::RichTextStyle::operator != | ( | const RichTextStyle & | style | ) | const
| inline

Not equal operator.

Parameters

  [in] | style | Another default appearance object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

RichTextStyle& foxit::pdf::RichTextStyle::operator= | ( | const RichTextStyle & | style | ) |
| inline

Assign operator.

Parameters

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

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::RichTextStyle::operator== | ( | const RichTextStyle & | style | ) | const
| inline

Equal operator.

Parameters

  [in] | style | Another style object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ Set()

void foxit::pdf::RichTextStyle::Set | ( | const common::Font & | font,
|  | float | text_size,
|  | common::Alignment | text_alignment,
|  | RGB | text_color,
|  | bool | is_bold,
|  | bool | is_italic,
|  | bool | is_underline,
|  | bool | is_strikethrough,
|  | CornerMarkStyle | mark_style,
|  | float | char_space,
|  | float | word_space
| ) |  |
| inline

Set value.

Parameters

  [in] | font | A valid font object.
  [in] | text_size | Text size. It should not be negative value. 0 means text will not be shown.
  [in] | text_alignment | Alignment value. Please refer to values starting from common::e_AlignmentLeft and this should be one of these values.
  [in] | text_color | Text color. Format: 0xRRGGBB.
  [in] | is_bold | A boolean value which indicates whether to make text bold or not.
  [in] | is_italic | A boolean value which indicates whether to italicize text or not.
  [in] | is_underline | A boolean value which indicates whether to underline text or not.
  [in] | is_strikethrough | A boolean value which indicates whether to cross text out with strike through or not.
  [in] | 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 RichTextStyle::e_CornerMarkNone and this should be one of these values.
  [in] | char_space | The char space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText.
  [in] | word_space | The word space. It should not be negative value for table generator. It is only used in pdf::PDFPage::AddText.

Returns
  None.

## Member Data Documentation

## ◆ font

common::Font foxit::pdf::RichTextStyle::font

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

- 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 represents the used font of a rich text.