Go to the documentation of this file.
62 uint32_t properties =
get(font_id).properties;
63 for (
int f = 0; f < font_set.
size(); ++f) {
64 if (
get(font_set[f].fontinfo_id).properties == properties)
73 if (font_set.
empty())
return false;
74 int first_font = font_set[0].fontinfo_id;
75 uint32_t properties =
get(first_font).properties;
76 for (
int f = 1; f < font_set.
size(); ++f) {
77 if (
get(font_set[f].fontinfo_id).properties != properties)
87 for (
int i = 0; i < other->
size(); ++i) {
89 if (spacing_vec !=
nullptr) {
91 if (target_index < 0) {
94 other->
get(i).name =
nullptr;
96 delete get(target_index).spacing_vec;
97 get(target_index).spacing_vec = other->
get(i).spacing_vec;
99 other->
get(i).spacing_vec =
nullptr;
109 for (
int i = 0; i <
size(); ++i) {
112 get(i).name =
nullptr;
113 get(i).spacing_vec =
nullptr;
124 return strcmp(fi1.
name, fi2.
name) == 0;
130 for (
int i = 0; i < fs1.
size; ++i) {
156 char* font_name =
new char[size + 1];
157 fi->
name = font_name;
158 if (!f->
DeSerialize(font_name, size))
return false;
159 font_name[size] =
'\0';
164 int32_t size = strlen(fi.
name);
171 int32_t vec_size, kern_size;
174 if (vec_size == 0)
return true;
176 for (
int i = 0; i < vec_size; ++i) {
188 if (kern_size > 0 && (!fs->kerned_unichar_ids.DeSerialize(f) ||
189 !fs->kerned_x_gaps.DeSerialize(f))) {
201 int16_t x_gap_invalid = -1;
202 for (
int i = 0; i < vec_size; ++i) {
bool read_set(TFile *f, FontSet *fs)
bool write_set(FILE *f, const FontSet &fs)
GenericVector< UNICHAR_ID > kerned_unichar_ids
bool DeSerialize(char *data, size_t count=1)
bool write_spacing_info(FILE *f, const FontInfo &fi)
bool write_info(FILE *f, const FontInfo &fi)
void set_clear_callback(TessCallback1< T > *cb)
bool DeSerialize(TFile *fp)
GenericVector< FontSpacingInfo * > * spacing_vec
void init_spacing(int unicharset_size)
bool Serialize(FILE *fp) const
bool read_spacing_info(TFile *f, FontInfo *fi)
void FontSetDeleteCallback(FontSet fs)
void MoveSpacingInfoFrom(FontInfoTable *other)
void MoveTo(UnicityTable< FontInfo > *target)
void add_spacing(UNICHAR_ID uch_id, FontSpacingInfo *spacing_info)
bool Serialize(FILE *fp, const char *data, size_t n)
bool CompareFontSet(const FontSet &fs1, const FontSet &fs2)
bool Serialize(FILE *fp) const
void set_clear_callback(TessCallback1< FontInfo > *cb)
bool SetContainsFontProperties(int font_id, const GenericVector< ScoredFont > &font_set) const
_ConstTessMemberResultCallback_5_0< false, R, T1, P1, P2, P3, P4, P5 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)(P1, P2, P3, P4, P5) const, typename Identity< P1 >::type p1, typename Identity< P2 >::type p2, typename Identity< P3 >::type p3, typename Identity< P4 >::type p4, typename Identity< P5 >::type p5)
int push_back(T object)
Add an element in the table.
bool SetContainsMultipleFontProperties(const GenericVector< ScoredFont > &font_set) const
bool DeSerializeClasses(bool swap, FILE *fp)
bool Serialize(FILE *fp) const
bool CompareFontInfo(const FontInfo &fi1, const FontInfo &fi2)
void set_compare_callback(TessResultCallback2< bool, FontInfo const &, FontInfo const & > *cb)
GenericVector< int16_t > kerned_x_gaps
bool read_info(TFile *f, FontInfo *fi)
bool SerializeClasses(FILE *fp) const
bool DeSerialize(TFile *fp)
void FontInfoDeleteCallback(FontInfo f)
void set_compare_callback(TessResultCallback2< bool, T const &, T const & > *cb)
FontInfo & get(int index) const
int get_index(const FontInfo &object) const
int push_back(FontInfo object)