3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 #include <msp/datafile/collection.h>
14 #include <msp/strings/codec.h>
15 #include "vertexarray.h"
25 class Loader: public DataFile::Loader
29 DataFile::Collection *coll;
32 typedef DataFile::Collection Collection;
35 Loader(Font &, DataFile::Collection &);
37 Font &get_object() { return font; }
38 DataFile::Collection &get_collection();
41 void texture(const std::string &);
47 void set_texture(const Texture2D &);
48 void add_glyph(unsigned, float, float, float, float, float, float, float, float, float);
49 float get_default_size() const { return default_size; }
50 float get_ascent() const { return ascent; }
51 float get_descent() const { return descent; }
52 float get_string_width(const std::string &) const;
53 float get_string_width(const std::string &, Codecs::Decoder &) const;
54 void draw_glyph(unsigned);
55 void draw_string(const std::string &) const;
56 void draw_string(const std::string &, Codecs::Decoder &) const;
57 void draw_multiline(const std::string &) const;
60 float get_string_width(const std::string &str) const
62 typename C::Decoder dec;
63 return get_string_width(str, dec);
67 void draw_string(const std::string &str) const
69 typename C::Decoder dec;
70 draw_string(str, dec);
75 class Loader: public Msp::DataFile::Loader
79 Glyph &get_object() { return glyph; }
83 void texcoords(float, float, float, float);
94 typedef std::map<unsigned, Glyph> GlyphMap;
103 void create_glyph_vertices();
104 void create_glyph_vertices(const Glyph &, VertexArrayBuilder &);
105 void prepare_render() const;
106 void draw_glyph(unsigned) const;
107 float get_glyph_advance(unsigned) const;