Poppler CPP 24.04.0
Public Types | Public Member Functions | List of all members
poppler::text_box Class Reference

Public Types

enum  writing_mode_enum {
  invalid_wmode = -1 ,
  horizontal_wmode = 0 ,
  vertical_wmode = 1
}
 

Public Member Functions

 text_box (text_box &&) noexcept
 
rectf bbox () const
 
rectf char_bbox (size_t i) const
 
std::string get_font_name (int i=0) const
 
double get_font_size () const
 
writing_mode_enum get_wmode (int i=0) const
 
bool has_font_info () const
 
bool has_space_after () const
 
text_boxoperator= (text_box &&) noexcept
 
int rotation () const
 
ustring text () const
 

Member Enumeration Documentation

◆ writing_mode_enum

Get a writing mode for the i-th glyph.

This method returns an enum of the writing mode for the i-th glyph in the text_box.

Note
Usually all glyphs in one text_box have the same writing mode. Thus the default value of the glyph index is 0.

Member Function Documentation

◆ char_bbox()

rectf text_box::char_bbox ( size_t  i) const

Get a bbox for the i-th glyph.

This method returns a rectf of the bounding box for the i-th glyph in the text_box.

Note
The text_box object owns the rectf objects, the caller is not needed to free them.
Warning
For too large glyph index, rectf(0,0,0,0) is returned. The number of the glyphs and ustring codepoints might be different in some complex scripts.

◆ get_font_name()

std::string text_box::get_font_name ( int  i = 0) const

Get a font name for the i-th glyph.

This method returns a std::string object holding the font name for the i-th glyph.

Note
The randomization prefix of the embedded fonts are not removed. The font names including these prefixes are insuffucient to determine whether the two fonts are same or different.
The clients should not assume that the encoding of the font name is one of the ASCII, Latin1 or UTF-8. Some legacy PDF producers used in CJK market use GBK, Big5, Wansung or Shift-JIS.
Since
0.89

◆ get_font_size()

double text_box::get_font_size ( ) const

Get a font size of this text_box instance.

This method return a double floating value of the font size from the text_box instance.

Since
0.89

◆ get_wmode()

text_box::writing_mode_enum text_box::get_wmode ( int  i = 0) const
Since
0.89

◆ has_font_info()

bool text_box::has_font_info ( ) const
Since
0.89

◆ rotation()

int text_box::rotation ( ) const
Since
0.68