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_;
153 static bool IsAvailableFont(
const char* font_desc,
string* best_match);
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);
175 vector<bool>* unichar_bitmap);
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);
204 static vector<string> available_fonts_;
208 #endif // TESSERACT_TRAINING_PANGO_FONT_INFO_H_
const FontTypeEnum font_type() const
const bool is_italic() const
static string BestFonts(const unordered_map< char32, inT64 > &ch_map, vector< std::pair< const char *, vector< bool > > > *font_flag)
bool CoversUTF8Text(const char *utf8_text, int byte_length) const
bool GetSpacingProperties(const string &utf8_char, int *x_bearing, int *x_advance) const
const bool is_bold() const
static bool SelectFont(const char *utf8_word, const int utf8_len, string *font_name, vector< string > *graphemes)
static bool IsAvailableFont(const char *font_desc)
const bool is_fraktur() const
int DropUncoveredChars(string *utf8_text) const
const bool is_monospace() const
string DescriptionName() const
bool ParseFontDescriptionName(const string &name)
const int font_size() const
static void InitFontConfig(bool force_clear, const string &fonts_dir)
static void GetAllRenderableCharacters(vector< bool > *unichar_bitmap)
static int FontScore(const unordered_map< char32, inT64 > &ch_map, const string &fontname, int *raw_score, vector< bool > *ch_flags)
bool CanRenderString(const char *utf8_word, int len, vector< string > *graphemes) const
const bool is_smallcaps() const
static const vector< string > & ListAvailableFonts()
void set_resolution(const int resolution)
const string & family_name() const
const int resolution() const