21 #ifndef TESSERACT_CCSTRUCT_FONTINFO_H_ 22 #define TESSERACT_CCSTRUCT_FONTINFO_H_ 63 FontInfo() : name(NULL), properties(0), universal_id(0), spacing_vec(NULL) {}
67 bool Serialize(FILE* fp)
const;
70 bool DeSerialize(
TFile* fp);
81 ASSERT_HOST(spacing_vec != NULL && spacing_vec->size() > uch_id);
82 (*spacing_vec)[uch_id] = spacing_info;
87 return (spacing_vec == NULL || spacing_vec->size() <= uch_id) ?
88 NULL : (*spacing_vec)[uch_id];
98 if (prev_fsi == NULL || fsi == NULL)
return false;
103 if (i < prev_fsi->kerned_unichar_ids.size()) {
112 bool is_bold()
const {
return (properties & 2) != 0; }
114 bool is_serif()
const {
return (properties & 8) != 0; }
152 bool Serialize(FILE* fp)
const;
155 bool DeSerialize(
TFile* fp);
159 bool SetContainsFontProperties(
162 bool SetContainsMultipleFontProperties(
ScoredFont(int font_id, uinT16 classifier_score)
void add_spacing(UNICHAR_ID uch_id, FontSpacingInfo *spacing_info)
bool read_spacing_info(TFile *f, FontInfo *fi)
bool read_set(TFile *f, FontSet *fs)
void init_to_size(int size, T t)
bool write_set(FILE *f, const FontSet &fs)
GenericVector< FontSpacingInfo * > * spacing_vec
GenericVector< UNICHAR_ID > kerned_unichar_ids
bool CompareFontInfo(const FontInfo &fi1, const FontInfo &fi2)
void init_spacing(int unicharset_size)
const FontSpacingInfo * get_spacing(UNICHAR_ID uch_id) const
bool write_info(FILE *f, const FontInfo &fi)
bool read_info(TFile *f, FontInfo *fi)
bool get_spacing(UNICHAR_ID prev_uch_id, UNICHAR_ID uch_id, int *spacing) const
GenericVector< inT16 > kerned_x_gaps
bool write_spacing_info(FILE *f, const FontInfo &fi)
bool CompareFontSet(const FontSet &fs1, const FontSet &fs2)
void FontInfoDeleteCallback(FontInfo f)
bool is_fixed_pitch() const
void FontSetDeleteCallback(FontSet fs)