#include "../gfxsource.h"
#include "../gfxtools.h"
#include "../gfximage.h"
+#include "../gfxfont.h"
#include "../devices/pdf.h"
#include "../readers/swf.h"
#include "../readers/image.h"
#include "../pdf/pdf.h"
#include "../mem.h"
#include "../types.h"
+#include "../log.h"
#define RUBY_GFX_VERSION "0.9.0"
page->doc = doc;
if(!page->page) {
rb_raise(rb_eArgError, "No page %d in document", nr);
- return;
+ return Qnil;
}
return v;
}
return font->glyph_array;
}
+static VALUE font_save_ttf(VALUE cls, VALUE _filename)
+{
+ Get_Font(font,cls);
+ Check_Type(_filename, T_STRING);
+ const char*filename = StringValuePtr(_filename);
+ gfxfont_save(font->font, filename);
+ return Qnil;
+}
+
static VALUE font_kerning(VALUE cls)
{
Get_Font(font,cls);
}
return v2;
}
+static VALUE convert_gradient(gfxgradient_t*gradient)
+{
+ return Qnil; //TODO
+}
#define HEAD \
device_internal_t*i = (device_internal_t*)dev->internal; \
VALUE v = i->v;
rb_define_method(Font, "glyphs", font_glyphs, 0);
rb_define_method(Font, "kerning", font_kerning, 0);
rb_define_method(Font, "get_kerning_table", font_kerning, 0);
+ rb_define_method(Font, "save_ttf", font_save_ttf, 1);
Device = rb_define_class_under(GFX, "Device", rb_cObject);
rb_define_method(Device, "startpage", noop, -1);