51 explicit TextMesher(
const std::string &font_file,
unsigned short quality = 4);
62 void set_font(
const std::string &font_file);
75 generate(
const std::string &text,
float x,
float y,
int font_size,
float height,
bool collision_free =
false);
88 bool generate(
SurfaceMesh *mesh,
const std::string &text,
float x,
float y,
int font_size,
float height,
89 bool collision_free =
false);
102 bool generate(
const std::string &text,
float x,
float y,
int font_size,
103 std::vector<std::vector<Polygon2> > &contours,
bool collision_free);
118 bool _generate(
SurfaceMesh *mesh,
const std::wstring &text,
float x,
float y,
int font_size,
float height,
119 bool collision_free);
130 bool _generate_contours(
const std::wstring &text,
float x,
float y,
int font_size,
131 std::vector<std::vector<Polygon2> > &contours,
bool collision_free);
142 bool _generate_contours(
int codepoint,
float &x,
float &y,
int font_size, std::vector<Polygon2> &contours);
148 std::string font_file_;
149 std::vector<unsigned char> font_data_;
153 unsigned short bezier_steps_;
~TextMesher()
Destructor.
Definition text_mesher.cpp:58
void set_font(const std::string &font_file)
Change the font.
Definition text_mesher.cpp:63
SurfaceMesh * generate(const std::string &text, float x, float y, int font_size, float height, bool collision_free=false)
Generate a 3D surface mesh of a text.
Definition text_mesher.cpp:283
TextMesher(const std::string &font_file, unsigned short quality=4)
Create an instance of TextMesher.
Definition text_mesher.cpp:49