}
void Font::add_glyph(unsigned code, float x1, float y1, float x2, float y2, float w, float h, float ox, float oy, float adv)
}
void Font::add_glyph(unsigned code, float x1, float y1, float x2, float y2, float w, float h, float ox, float oy, float adv)
+ Immediate imm((TEXCOORD2, VERTEX2));
+ draw_string(str, dec, imm);
+}
+
+void Font::draw_string(const string &str, Codecs::Decoder &dec, PrimitiveBuilder &pbuilder) const
+{
+ if(!tex)
+ throw InvalidState("No texture");
+
for(string::const_iterator i=str.begin(); i!=str.end();)
{
GlyphMap::const_iterator j=glyphs.find(dec.decode_char(str, i));
if(j==glyphs.end())
continue;
for(string::const_iterator i=str.begin(); i!=str.end();)
{
GlyphMap::const_iterator j=glyphs.find(dec.decode_char(str, i));
if(j==glyphs.end())
continue;
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);
- 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)
{