20 #ifndef TESSERACT_TRAINING_PANGO_FONT_INFO_H_
21 #define TESSERACT_TRAINING_PANGO_FONT_INFO_H_
24 #include <unordered_map>
29 #include "pango/pango-font.h"
30 #include "pango/pango.h"
31 #include "pango/pangocairo.h"
79 std::vector<std::string>* graphemes)
const;
87 int* x_bearing,
int* x_advance)
const;
114 bool ParseFontDescription(
const PangoFontDescription* desc);
117 PangoFont* ToPangoFont()
const;
124 PangoFontDescription* desc_;
163 static bool SelectFont(
const char* utf8_word,
const int utf8_len,
164 std::string* font_name, std::vector<std::string>* graphemes);
169 static bool SelectFont(
const char* utf8_word,
const int utf8_len,
170 const std::vector<std::string>& all_fonts,
171 std::string* font_name, std::vector<std::string>* graphemes);
178 std::vector<bool>* unichar_bitmap);
180 std::vector<bool>* unichar_bitmap);
192 const std::unordered_map<char32, int64_t>& ch_map,
193 std::vector<std::pair<
const char*, std::vector<bool> > >* font_flag);
200 static int FontScore(
const std::unordered_map<char32, int64_t>& ch_map,
202 std::vector<bool>* ch_flags);
209 static std::vector<std::string> available_fonts_;
213 #endif // TESSERACT_TRAINING_PANGO_FONT_INFO_H_