]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/font.h
Move blend state from Sequence::Step to RenderMethod
[libs/gl.git] / source / builders / font.h
index 9f040dc99d0e45cc5ffdec41153dfc71e5149778..adbfc82830c9d5ae69ff7f0e0cea0c893c21978e 100644 (file)
@@ -5,7 +5,6 @@
 #include <string>
 #include <msp/datafile/objectloader.h>
 #include <msp/stringcodec/utf8.h>
-#include "vertexarray.h"
 
 namespace Msp {
 namespace GL {
@@ -22,11 +21,9 @@ public:
        class Loader: public DataFile::CollectionObjectLoader<Font>
        {
        public:
-               Loader(Font &);
                Loader(Font &, Collection &);
 
        private:
-               void init();
                void glyph(unsigned);
                void kerning(unsigned, unsigned, float);
                void ligature(unsigned, unsigned, unsigned);
@@ -44,14 +41,16 @@ public:
                        void texcoords(float, float, float, float);
                };
 
-               unsigned code;
-               float x1, y1;
-               float x2, y2;
-               float w, h;
-               float off_x, off_y;
-               float advance;
-
-               Glyph();
+               unsigned code = 0;
+               float x1 = 0.0f;
+               float y1 = 0.0f;
+               float x2 = 1.0f;
+               float y2 = 1.0f;
+               float w = 1.0f;
+               float h = 1.0f;
+               float off_x = 0.0f;
+               float off_y = 0.0f;
+               float advance = 1.0f;
        };
 
 private:
@@ -60,20 +59,17 @@ private:
        typedef std::map<CodePair, float> KerningMap;
        typedef std::map<CodePair, unsigned> LigatureMap;
 
-       RefPtr<const Texture2D> texture;
-       float native_size;
-       float ascent;
-       float descent;
-       float cap_height;
-       float x_height;
+       const Texture2D *texture = 0;
+       float native_size = 1.0f;
+       float ascent = 1.0f;
+       float descent = 0.0f;
+       float cap_height = 1.0f;
+       float x_height = 0.5f;
        GlyphMap glyphs;
        KerningMap kerning;
        LigatureMap ligatures;
 
 public:
-       Font();
-       ~Font();
-
        void set_texture(const Texture2D &);
        const Texture2D &get_texture() const;