Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tesseract::FontInfo Struct Reference

#include <fontinfo.h>

List of all members.

Public Member Functions

 FontInfo ()
 ~FontInfo ()
void init_spacing (int unicharset_size)
void add_spacing (UNICHAR_ID uch_id, FontSpacingInfo *spacing_info)
const FontSpacingInfoget_spacing (UNICHAR_ID uch_id) const
bool get_spacing (UNICHAR_ID prev_uch_id, UNICHAR_ID uch_id, int *spacing) const
bool is_italic () const
bool is_bold () const
bool is_fixed_pitch () const
bool is_serif () const
bool is_fraktur () const

Public Attributes

char * name
uinT32 properties
inT32 universal_id
GenericVector< FontSpacingInfo * > * spacing_vec

Detailed Description

Definition at line 42 of file fontinfo.h.


Constructor & Destructor Documentation

tesseract::FontInfo::FontInfo ( )
inline

Definition at line 43 of file fontinfo.h.

tesseract::FontInfo::~FontInfo ( )
inline

Definition at line 44 of file fontinfo.h.

{}

Member Function Documentation

void tesseract::FontInfo::add_spacing ( UNICHAR_ID  uch_id,
FontSpacingInfo spacing_info 
)
inline

Definition at line 53 of file fontinfo.h.

{
(*spacing_vec)[uch_id] = spacing_info;
}
const FontSpacingInfo* tesseract::FontInfo::get_spacing ( UNICHAR_ID  uch_id) const
inline

Definition at line 59 of file fontinfo.h.

{
return (spacing_vec == NULL || spacing_vec->size() <= uch_id) ?
NULL : (*spacing_vec)[uch_id];
}
bool tesseract::FontInfo::get_spacing ( UNICHAR_ID  prev_uch_id,
UNICHAR_ID  uch_id,
int *  spacing 
) const
inline

Definition at line 66 of file fontinfo.h.

{
const FontSpacingInfo *prev_fsi = this->get_spacing(prev_uch_id);
const FontSpacingInfo *fsi = this->get_spacing(uch_id);
if (prev_fsi == NULL || fsi == NULL) return false;
int i = 0;
for (; i < prev_fsi->kerned_unichar_ids.size(); ++i) {
if (prev_fsi->kerned_unichar_ids[i] == uch_id) break;
}
if (i < prev_fsi->kerned_unichar_ids.size()) {
*spacing = prev_fsi->kerned_x_gaps[i];
} else {
*spacing = prev_fsi->x_gap_after + fsi->x_gap_before;
}
return true;
}
void tesseract::FontInfo::init_spacing ( int  unicharset_size)
inline

Definition at line 46 of file fontinfo.h.

bool tesseract::FontInfo::is_bold ( ) const
inline

Definition at line 85 of file fontinfo.h.

{ return (properties & 2) != 0; }
bool tesseract::FontInfo::is_fixed_pitch ( ) const
inline

Definition at line 86 of file fontinfo.h.

{ return (properties & 4) != 0; }
bool tesseract::FontInfo::is_fraktur ( ) const
inline

Definition at line 88 of file fontinfo.h.

{ return (properties & 16) != 0; }
bool tesseract::FontInfo::is_italic ( ) const
inline

Definition at line 84 of file fontinfo.h.

{ return properties & 1; }
bool tesseract::FontInfo::is_serif ( ) const
inline

Definition at line 87 of file fontinfo.h.

{ return (properties & 8) != 0; }

Member Data Documentation

char* tesseract::FontInfo::name

Definition at line 90 of file fontinfo.h.

uinT32 tesseract::FontInfo::properties

Definition at line 91 of file fontinfo.h.

GenericVector<FontSpacingInfo *>* tesseract::FontInfo::spacing_vec

Definition at line 98 of file fontinfo.h.

inT32 tesseract::FontInfo::universal_id

Definition at line 96 of file fontinfo.h.


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