Font::Font():
tex(0),
+ own_tex(false),
default_size(1),
ascent(1),
descent(0)
{ }
+Font::~Font()
+{
+ if(own_tex)
+ delete tex;
+}
+
void Font::set_texture(const Texture2D &t)
{
+ if(own_tex)
+ delete tex;
+
tex=&t;
+ own_tex=false;
}
const Texture2D &Font::get_texture() const
add("ascent", &Font::ascent);
add("descent", &Font::descent);
add("texture", &Font::tex);
+ add("texture_inline", &Loader::texture_inline);
add("glyph", &Loader::glyph);
}
font.glyphs.insert(GlyphMap::value_type(c, gl));
}
+void Font::Loader::texture_inline()
+{
+ RefPtr<Texture2D> tex=new Texture2D;
+ load_sub(*tex);
+ font.tex=tex.release();
+ font.own_tex=true;
+}
+
Font::Glyph::Loader::Loader(Glyph &g):
glyph(g)