void Font::add_glyph(unsigned code, float x1, float y1, float x2, float y2, float w, float h, float ox, float oy, float adv)
{
Glyph glyph;
void Font::add_glyph(unsigned code, float x1, float y1, float x2, float y2, float w, float h, float ox, float oy, float adv)
{
Glyph glyph;
glyphs.insert(GlyphMap::value_type(code, glyph));
}
float Font::get_string_width(const string &str, Codecs::Decoder &dec) const
{
glyphs.insert(GlyphMap::value_type(code, glyph));
}
float Font::get_string_width(const string &str, Codecs::Decoder &dec) const
{
void Font::Loader::init()
{
add("default_size", &Font::default_size);
add("ascent", &Font::ascent);
add("descent", &Font::descent);
add("texture", &Font::tex);
void Font::Loader::init()
{
add("default_size", &Font::default_size);
add("ascent", &Font::ascent);
add("descent", &Font::descent);
add("texture", &Font::tex);
add("glyph", &Loader::glyph);
}
void Font::Loader::glyph(unsigned c)
{
Glyph gl;
add("glyph", &Loader::glyph);
}
void Font::Loader::glyph(unsigned c)
{
Glyph gl;
- font.glyphs.insert(GlyphMap::value_type(c, gl));
+ obj.glyphs.insert(GlyphMap::value_type(c, gl));
+}
+
+void Font::Loader::texture_inline()
+{
+ RefPtr<Texture2D> tex = new Texture2D;
+ load_sub(*tex);
+ obj.tex = tex.release();
+ obj.own_tex = true;
{
add("texcoords", &Loader::texcoords);
add("size", &Glyph::w, &Glyph::h);
{
add("texcoords", &Loader::texcoords);
add("size", &Glyph::w, &Glyph::h);
void Font::Glyph::Loader::texcoords(float x1, float y1, float x2, float y2)
{
void Font::Glyph::Loader::texcoords(float x1, float y1, float x2, float y2)
{