21 #ifndef TESSERACT_CCSTRUCT_FONTINFO_H_ 22 #define TESSERACT_CCSTRUCT_FONTINFO_H_ 27 #include "genericvector.h" 63 FontInfo() : name(nullptr), properties(0), universal_id(0), spacing_vec(nullptr) {}
81 ASSERT_HOST(spacing_vec !=
nullptr && spacing_vec->size() > uch_id);
82 (*spacing_vec)[uch_id] = spacing_info;
87 return (spacing_vec ==
nullptr || spacing_vec->size() <= uch_id) ?
88 nullptr : (*spacing_vec)[uch_id];
98 if (prev_fsi ==
nullptr || fsi ==
nullptr)
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; }
159 bool SetContainsFontProperties(
162 bool SetContainsMultipleFontProperties(
bool write_info(FILE *f, const FontInfo &fi)
Definition: fontinfo.cpp:162
int16_t x_gap_before
Definition: fontinfo.h:52
Definition: fontinfo.h:62
bool is_fixed_pitch() const
Definition: fontinfo.h:113
ScoredFont()
Definition: fontinfo.h:39
bool CompareFontInfo(const FontInfo &fi1, const FontInfo &fi2)
Definition: fontinfo.cpp:120
bool read_info(TFile *f, FontInfo *fi)
Definition: fontinfo.cpp:152
GenericVector< FontSpacingInfo * > * spacing_vec
Definition: fontinfo.h:125
bool CompareFontSet(const FontSet &fs1, const FontSet &fs2)
Definition: fontinfo.cpp:128
int * configs
Definition: fontinfo.h:139
GenericVector< UNICHAR_ID > kerned_unichar_ids
Definition: fontinfo.h:54
bool write_spacing_info(FILE *f, const FontInfo &fi)
Definition: fontinfo.cpp:197
bool is_fraktur() const
Definition: fontinfo.h:115
Definition: serialis.h:77
uint32_t properties
Definition: fontinfo.h:118
Definition: baseapi.cpp:94
bool write_set(FILE *f, const FontSet &fs)
Definition: fontinfo.cpp:231
ScoredFont(int font_id, uint16_t classifier_score)
Definition: fontinfo.h:40
Definition: fontinfo.h:38
bool is_italic() const
Definition: fontinfo.h:111
int32_t fontinfo_id
Definition: fontinfo.h:45
char * name
Definition: fontinfo.h:117
void FontSetDeleteCallback(FontSet fs)
Definition: fontinfo.cpp:146
Definition: fontinfo.h:30
void FontInfoDeleteCallback(FontInfo f)
Definition: fontinfo.cpp:139
bool Serialize(FILE *fp, const char *data, size_t n)
Definition: serialis.cpp:59
int size
Definition: fontinfo.h:138
int16_t x_gap_after
Definition: fontinfo.h:53
FontInfo()
Definition: fontinfo.h:63
int32_t universal_id
Definition: fontinfo.h:123
void init_spacing(int unicharset_size)
Definition: fontinfo.h:73
Definition: fontinfo.h:146
bool read_spacing_info(TFile *f, FontInfo *fi)
Definition: fontinfo.cpp:169
int size() const
Definition: genericvector.h:71
bool is_bold() const
Definition: fontinfo.h:112
Definition: fontinfo.h:137
void init_to_size(int size, const T &t)
Definition: genericvector.h:708
bool is_serif() const
Definition: fontinfo.h:114
GenericVector< int16_t > kerned_x_gaps
Definition: fontinfo.h:55
bool read_set(TFile *f, FontSet *fs)
Definition: fontinfo.cpp:225
uint16_t score
Definition: fontinfo.h:47
bool get_spacing(UNICHAR_ID prev_uch_id, UNICHAR_ID uch_id, int *spacing) const
Definition: fontinfo.h:93
bool DeSerialize(FILE *fp, char *data, size_t n)
Definition: serialis.cpp:27
const FontSpacingInfo * get_spacing(UNICHAR_ID uch_id) const
Definition: fontinfo.h:86
Definition: fontinfo.h:51
void add_spacing(UNICHAR_ID uch_id, FontSpacingInfo *spacing_info)
Definition: fontinfo.h:80