3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 #include <msp/datafile/loader.h>
14 #include <msp/strings/codec.h>
15 #include "vertexarray.h"
25 class Loader: public Msp::DataFile::Loader
30 Font &get_object() { return font; }
34 void texture(const std::string &);
41 void set_texture(const Texture2D &);
42 void add_glyph(unsigned, float, float, float, float, float, float, float, float, float);
43 float get_default_size() const { return default_size; }
44 float get_ascent() const { return ascent; }
45 float get_descent() const { return descent; }
46 float get_string_width(const std::string &) const;
47 float get_string_width(const std::string &, Codecs::Decoder &) const;
48 void draw_glyph(unsigned);
49 void draw_string(const std::string &) const;
50 void draw_string(const std::string &, Codecs::Decoder &) const;
51 void draw_multiline(const std::string &) const;
54 float get_string_width(const std::string &str) const
56 typename C::Decoder dec;
57 return get_string_width(str, dec);
61 void draw_string(const std::string &str) const
63 typename C::Decoder dec;
64 draw_string(str, dec);
69 class Loader: public Msp::DataFile::Loader
73 Glyph &get_object() { return glyph; }
77 void texcoords(float, float, float, float);
88 typedef std::map<unsigned, Glyph> GlyphMap;
98 void create_glyph_vertices();
99 void create_glyph_vertices(const Glyph &, VertexArrayBuilder &);
100 void prepare_render() const;
101 void draw_glyph(unsigned) const;
102 float get_glyph_advance(unsigned) const;