6 #include <msp/datafile/loader.h>
7 #include <msp/strings/codec.h>
8 #include "vertexarray.h"
18 class Loader: public Msp::DataFile::Loader
23 Font &get_object() { return font; }
27 void texture(const std::string &);
34 void set_texture(const Texture2D &);
35 void add_glyph(unsigned, float, float, float, float, float, float, float, float, float);
36 float get_default_size() const { return default_size; }
37 float get_ascent() const { return ascent; }
38 float get_descent() const { return descent; }
39 float get_string_width(const std::string &) const;
40 float get_string_width(const std::string &, Codecs::Decoder &) const;
41 void draw_glyph(unsigned);
42 void draw_string(const std::string &) const;
43 void draw_string(const std::string &, Codecs::Decoder &) const;
44 void draw_multiline(const std::string &) const;
47 float get_string_width(const std::string &str) const
49 typename C::Decoder dec;
50 return get_string_width(str, dec);
54 void draw_string(const std::string &str) const
56 typename C::Decoder dec;
57 draw_string(str, dec);
62 class Loader: public Msp::DataFile::Loader
66 Glyph &get_object() { return glyph; }
70 void texcoords(float, float, float, float);
71 void size(float, float);
72 void offset(float, float);
83 typedef std::map<unsigned, Glyph> GlyphMap;
93 void create_glyph_vertices();
94 void create_glyph_vertices(const Glyph &, VertexArrayBuilder &);
95 void prepare_render() const;
96 void draw_glyph(unsigned) const;
97 float get_glyph_advance(unsigned) const;