29 #ifndef TESSERACT_TRAINING_STRINGRENDERER_H_ 30 #define TESSERACT_TRAINING_STRINGRENDERER_H_ 38 #include "pango/pango-layout.h" 39 #include "pango/pangocairo.h" 50 StringRenderer(
const string& font_desc,
int page_width,
int page_height);
56 int RenderToImage(
const char* text,
int text_length, Pix** pix);
64 int text_length,
string* font_used, Pix** pix);
138 const std::vector<BoxChar*>&
GetBoxes()
const;
224 #endif // THIRD_PARTY_TESSERACT_TRAINING_STRINGRENDERER_H_ static string ConvertBasicLatinToFullwidthLatin(const string &text)
double underline_continuation_prob_
void SetLayoutProperties()
bool strip_unrenderable_words_
void set_strip_unrenderable_words(bool val)
TessHashMap< char32, inT64 > char_map_
void set_underline_style(const PangoUnderline style)
std::vector< BoxChar * > boxchars_
bool gravity_hint_strong_
void set_render_fullwidth_latin(bool render_fullwidth_latin)
int RenderToBinaryImage(const char *text, int text_length, int threshold, Pix **pix)
void set_underline_continuation_prob(const double frac)
int StripUnrenderableWords(string *utf8_text) const
void set_vertical_text(bool vertical_text)
bool render_fullwidth_latin_
StringRenderer(const string &font_desc, int page_width, int page_height)
int RenderToGrayscaleImage(const char *text, int text_length, Pix **pix)
void set_output_word_boxes(bool val)
void set_box_padding(int val)
void set_add_ligatures(bool add_ligatures)
void set_drop_uncovered_chars(bool val)
int RenderAllFontsToImage(double min_coverage, const char *text, int text_length, string *font_used, Pix **pix)
void set_pen_color(double r, double g, double b)
void set_h_margin(const int h_margin)
int RenderToImage(const char *text, int text_length, Pix **pix)
double underline_start_prob_
const PangoFontInfo & font() const
int FindFirstPageBreakOffset(const char *text, int text_length)
void set_char_spacing(double char_spacing)
static string InsertWordJoiners(const string &text)
static string ConvertFullwidthLatinToBasicLatin(const string &text)
void set_gravity_hint_strong(bool gravity_hint_strong)
void set_v_margin(const int v_margin)
const std::vector< BoxChar * > & GetBoxes() const
Boxa * GetPageBoxes() const
cairo_surface_t * surface_
void RotatePageBoxes(float rotation)
void CorrectBoxPositionsToLayout(std::vector< BoxChar *> *boxchars)
bool drop_uncovered_chars_
bool GetClusterStrings(std::vector< string > *cluster_text)
PangoUnderline underline_style_
void set_underline_start_prob(const double frac)
void set_features(const char *features)
void ComputeClusterBoxes()
void WriteAllBoxes(const string &filename)
bool set_font(const string &desc)
void set_resolution(const int resolution)
void set_leading(int leading)
void SetWordUnderlineAttributes(const string &page_text)