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 vector<BoxChar*>&
GetBoxes()
const;
220 #endif // THIRD_PARTY_TESSERACT_TRAINING_STRINGRENDERER_H_
cairo_surface_t * surface_
void set_gravity_hint_strong(bool gravity_hint_strong)
const int v_margin() const
void set_render_fullwidth_latin(bool render_fullwidth_latin)
bool render_fullwidth_latin_
void WriteAllBoxes(const string &filename)
int RenderToGrayscaleImage(const char *text, int text_length, Pix **pix)
const PangoFontInfo & font() const
PangoUnderline underline_style_
void set_strip_unrenderable_words(bool val)
void set_resolution(const int resolution)
void set_leading(int leading)
const int h_margin() const
void set_underline_start_prob(const double frac)
void set_vertical_text(bool vertical_text)
void RotatePageBoxes(float rotation)
void SetLayoutProperties()
int RenderToBinaryImage(const char *text, int text_length, int threshold, Pix **pix)
vector< BoxChar * > boxchars_
void set_box_padding(int val)
Boxa * GetPageBoxes() const
int StripUnrenderableWords(string *utf8_text) const
void set_underline_continuation_prob(const double frac)
void set_char_spacing(double char_spacing)
void set_underline_style(const PangoUnderline style)
const vector< BoxChar * > & GetBoxes() const
void set_drop_uncovered_chars(bool val)
bool strip_unrenderable_words_
hash_map< char32, inT64 > char_map_
int FindFirstPageBreakOffset(const char *text, int text_length)
void SetWordUnderlineAttributes(const string &page_text)
void set_add_ligatures(bool add_ligatures)
bool set_font(const string &desc)
void set_h_margin(const int h_margin)
void set_v_margin(const int v_margin)
bool drop_uncovered_chars_
static string InsertWordJoiners(const string &text)
bool GetClusterStrings(vector< string > *cluster_text)
bool gravity_hint_strong_
static string ConvertBasicLatinToFullwidthLatin(const string &text)
StringRenderer(const string &font_desc, int page_width, int page_height)
static string ConvertFullwidthLatinToBasicLatin(const string &text)
double underline_continuation_prob_
int RenderAllFontsToImage(double min_coverage, const char *text, int text_length, string *font_used, Pix **pix)
void set_output_word_boxes(bool val)
void CorrectBoxPositionsToLayout(vector< BoxChar * > *boxchars)
int RenderToImage(const char *text, int text_length, Pix **pix)
double underline_start_prob_
void set_pen_color(double r, double g, double b)
void ComputeClusterBoxes()