+// ------------------------ glyphs ------------------------------------------
+
+static VALUE convert_line(gfxline_t*line);
+
+#define Get_Glyph(glyph,cls) glyph_internal_t*glyph=0;Data_Get_Struct(cls, glyph_internal_t, glyph);
+
+static void glyph_free(glyph_internal_t*glyph)
+{
+ free(glyph);
+}
+
+static VALUE glyph_allocate(VALUE cls)
+{
+ glyph_internal_t*glyph = 0;
+ VALUE v = Data_Make_Struct(cls, glyph_internal_t, 0, glyph_free, glyph);
+ memset(glyph, 0, sizeof(glyph_internal_t));
+ return v;
+}
+
+static VALUE glyph_polygon(VALUE cls)
+{
+ Get_Glyph(glyph,cls);
+ return convert_line(glyph->font->glyphs[glyph->nr].line);
+}
+
+static VALUE glyph_advance(VALUE cls)
+{
+ Get_Glyph(glyph,cls);
+ return rb_float_new(glyph->font->glyphs[glyph->nr].advance);
+}
+
+static VALUE glyph_unicode(VALUE cls)
+{
+ Get_Glyph(glyph,cls);
+ return INT2FIX(glyph->font->glyphs[glyph->nr].unicode);
+}
+