48 using namespace std::placeholders;
68 const std::vector<ScoredFont> &font_set)
const {
70 for (
auto &&f : font_set) {
80 const std::vector<ScoredFont> &font_set)
const {
81 if (font_set.empty()) {
84 int first_font = font_set[0].fontinfo_id;
86 for (
unsigned f = 1; f < font_set.size(); ++f) {
87 if (
at(font_set[f].fontinfo_id).properties != properties) {
96 using namespace std::placeholders;
98 for (
unsigned i = 0;
i < other->
size(); ++
i) {
99 std::vector<FontSpacingInfo *> *spacing_vec = other->
at(
i).
spacing_vec;
100 if (spacing_vec !=
nullptr) {
102 if (target_index < 0) {
118 using namespace std::placeholders;
120 for (
unsigned i = 0;
i <
size(); ++
i) {
148 char *font_name =
new char[size + 1];
149 fi->
name = font_name;
153 font_name[size] =
'\0';
158 int32_t size = strlen(fi.
name);
164 int32_t vec_size, kern_size;
173 for (
int i = 0;
i < vec_size; ++
i) {
199 int16_t x_gap_invalid = -1;
200 for (
int i = 0;
i < vec_size; ++
i) {
202 int32_t kern_size = (fs ==
nullptr) ? -1 : fs->
kerned_x_gaps.size();
223 int size = fs.size();
void FontInfoDeleteCallback(FontInfo f)
bool write_set(FILE *f, const FontSet &fs)
bool write_info(FILE *f, const FontInfo &fi)
bool write_spacing_info(FILE *f, const FontInfo &fi)
bool Serialize(FILE *fp, const std::vector< T > &data)
std::vector< int > FontSet
bool read_info(TFile *f, FontInfo *fi)
bool read_spacing_info(TFile *f, FontInfo *fi)
int push_back(T object)
Add an element in the table.
void set_clear_callback(const std::function< void(T)> &cb)
std::vector< int16_t > kerned_x_gaps
std::vector< UNICHAR_ID > kerned_unichar_ids
bool DeSerialize(TFile *fp)
std::vector< FontSpacingInfo * > * spacing_vec
bool Serialize(FILE *fp) const
void init_spacing(int unicharset_size)
void add_spacing(UNICHAR_ID uch_id, FontSpacingInfo *spacing_info)
TESS_API bool DeSerialize(TFile *fp)
TESS_API void MoveSpacingInfoFrom(FontInfoTable *other)
TESS_API ~FontInfoTable()
TESS_API bool SetContainsFontProperties(int font_id, const std::vector< ScoredFont > &font_set) const
TESS_API bool Serialize(FILE *fp) const
TESS_API void MoveTo(UnicityTable< FontInfo > *target)
TESS_API bool SetContainsMultipleFontProperties(const std::vector< ScoredFont > &font_set) const
int get_index(const FontInfo &object) const
bool DeSerializeClasses(TFile *fp)
FontInfo & at(int index) const
void set_clear_callback(const std::function< void(FontInfo)> &cb)
bool SerializeClasses(FILE *fp) const
int push_back(FontInfo object)
bool DeSerialize(std::string &data)