20 #ifndef TESSERACT_TRAINING_PANGO_FONT_INFO_H_ 21 #define TESSERACT_TRAINING_PANGO_FONT_INFO_H_ 30 #include "pango/pango-font.h" 76 vector<string>* graphemes)
const;
84 int* x_bearing,
int* x_advance)
const;
89 static void InitFontConfig(
bool force_clear,
const string& fonts_dir);
97 const bool is_bold()
const {
return is_bold_; }
112 bool ParseFontDescription(
const PangoFontDescription* desc);
115 PangoFont* ToPangoFont()
const;
127 PangoFontDescription* desc_;
134 static bool fontconfig_initialized_;
148 return IsAvailableFont(font_desc,
NULL);
153 static bool IsAvailableFont(
const char* font_desc,
string* best_match);
155 static const vector<string>& ListAvailableFonts();
160 static bool SelectFont(
const char* utf8_word,
const int utf8_len,
161 string* font_name, vector<string>* graphemes);
166 static bool SelectFont(
const char* utf8_word,
const int utf8_len,
167 const vector<string>& all_fonts,
168 string* font_name, vector<string>* graphemes);
172 static void GetAllRenderableCharacters(vector<bool>* unichar_bitmap);
174 static void GetAllRenderableCharacters(
const vector<string>& font_names,
175 vector<bool>* unichar_bitmap);
176 static void GetAllRenderableCharacters(
const string& font_name,
177 vector<bool>* unichar_bitmap);
188 static string BestFonts(
const unordered_map<char32, inT64>& ch_map,
189 vector<std::pair<
const char*, vector<bool> > >* font_flag);
196 static int FontScore(
const unordered_map<char32, inT64>& ch_map,
197 const string& fontname,
int* raw_score,
198 vector<bool>* ch_flags);
201 static void ReInit();
204 static vector<string> available_fonts_;
208 #endif // TESSERACT_TRAINING_PANGO_FONT_INFO_H_
int DropUncoveredChars(string *utf8_text) const
const FontTypeEnum font_type() const
bool CoversUTF8Text(const char *utf8_text, int byte_length) const
const int font_size() const
static void InitFontConfig(bool force_clear, const string &fonts_dir)
const bool is_italic() const
const bool is_bold() const
void set_resolution(const int resolution)
const bool is_monospace() const
bool GetSpacingProperties(const string &utf8_char, int *x_bearing, int *x_advance) const
static bool IsAvailableFont(const char *font_desc)
const bool is_fraktur() const
const string & family_name() const
const bool is_smallcaps() const
const int resolution() const
bool CanRenderString(const char *utf8_word, int len, vector< string > *graphemes) const
bool ParseFontDescriptionName(const string &name)
string DescriptionName() const