Tesseract
3.02
|
#include <fontinfo.h>
Public Member Functions | |
FontInfo () | |
~FontInfo () | |
void | init_spacing (int unicharset_size) |
void | add_spacing (UNICHAR_ID uch_id, FontSpacingInfo *spacing_info) |
const FontSpacingInfo * | get_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 |
Definition at line 42 of file fontinfo.h.
tesseract::FontInfo::FontInfo | ( | ) | [inline] |
Definition at line 43 of file fontinfo.h.
: name(NULL), spacing_vec(NULL) {}
tesseract::FontInfo::~FontInfo | ( | ) | [inline] |
Definition at line 44 of file fontinfo.h.
{}
void tesseract::FontInfo::add_spacing | ( | UNICHAR_ID | uch_id, |
FontSpacingInfo * | spacing_info | ||
) | [inline] |
Definition at line 53 of file fontinfo.h.
{ ASSERT_HOST(spacing_vec != NULL && spacing_vec->size() > uch_id); (*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.
{ spacing_vec = new GenericVector<FontSpacingInfo *>(); spacing_vec->init_to_size(unicharset_size, NULL); }
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; }
Definition at line 90 of file fontinfo.h.
Definition at line 91 of file fontinfo.h.
Definition at line 98 of file fontinfo.h.
Definition at line 96 of file fontinfo.h.