All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::Style Class Reference

#include <TextExtractor.h>

Public Member Functions

SDF::Obj GetFont ()
 
UString GetFontName ()
 
double GetFontSize ()
 
int GetWeight ()
 
bool IsItalic ()
 
bool IsSerif ()
 
std::vector< int > GetColor ()
 
void GetColor (UInt8 rgb[3])
 
bool operator== (const Style &s) const
 
bool operator!= (const Style &s) const
 
 Style ()
 

Detailed Description

A class representing predominant text style associated with a given Line, a Word, or a Glyph. The class includes information about the font, font size, font styles, text color, etc.

Definition at line 322 of file TextExtractor.h.

Constructor & Destructor Documentation

pdftron::PDF::Style::Style ( )

Member Function Documentation

std::vector<int> pdftron::PDF::Style::GetColor ( )
Returns
text color in RGB color space.
void pdftron::PDF::Style::GetColor ( UInt8  rgb[3])
SDF::Obj pdftron::PDF::Style::GetFont ( )
Returns
low-level PDF font object. A high level font object can be instantiated as follows: In C++: pdftron.PDF.Font f(style.GetFont()) In C#: pdftron.PDF.Font f = new pdftron.PDF.Font(style.GetFont());
UString pdftron::PDF::Style::GetFontName ( )
Returns
the font name used to draw the selected text.
double pdftron::PDF::Style::GetFontSize ( )
Returns
The font size used to draw the selected text as it appears on the output page.
Note
Unlike the 'font size' in the graphics state (pdftron.PDF.GState) the returned font size accounts for the effects CTM, text matrix, and other graphics state attributes that can affect the appearance of text.
int pdftron::PDF::Style::GetWeight ( )
Returns
The weight (thickness) component of the fully-qualified font name or font specifier. The possible values are 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each number indicates a weight that is at least as dark as its predecessor. A value of 400 indicates a normal weight; 700 indicates bold. Note: The specific interpretation of these values varies from font to font. For example, 300 in one font may appear most similar to 500 in another.
bool pdftron::PDF::Style::IsItalic ( )
Returns
true if glyphs have dominant vertical strokes that are slanted.
Note
the return value corresponds to the state of 'italic' flag in the 'Font Descriptor'.
bool pdftron::PDF::Style::IsSerif ( )
Returns
true if glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems.
Note
the return value corresponds to the state of 'serif' flag in the 'Font Descriptor'.
bool pdftron::PDF::Style::operator!= ( const Style s) const
bool pdftron::PDF::Style::operator== ( const Style s) const

The documentation for this class was generated from the following file: