git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
faa7df4
)
added font->ascent/font->descent to ruby interface
author
Matthias Kramm
<kramm@quiss.org>
Wed, 6 Jan 2010 02:34:54 +0000
(18:34 -0800)
committer
Matthias Kramm
<kramm@quiss.org>
Wed, 6 Jan 2010 02:40:27 +0000
(18:40 -0800)
lib/ruby/gfx.c
patch
|
blob
|
history
diff --git
a/lib/ruby/gfx.c
b/lib/ruby/gfx.c
index
687e38a
..
11addd2
100644
(file)
--- a/
lib/ruby/gfx.c
+++ b/
lib/ruby/gfx.c
@@
-310,6
+310,18
@@
static VALUE font_allocate(VALUE cls)
return v;
}
return v;
}
+static VALUE font_ascent(VALUE cls)
+{
+ Get_Font(font,cls);
+ return rb_float_new(font->font->ascent);
+}
+
+static VALUE font_descent(VALUE cls)
+{
+ Get_Font(font,cls);
+ return rb_float_new(font->font->descent);
+}
+
static VALUE font_name(VALUE cls)
{
Get_Font(font,cls);
static VALUE font_name(VALUE cls)
{
Get_Font(font,cls);
@@
-637,6
+649,8
@@
void Init_gfx()
Font = rb_define_class_under(GFX, "Font", rb_cObject);
rb_define_method(Font, "name", font_name, 0);
Font = rb_define_class_under(GFX, "Font", rb_cObject);
rb_define_method(Font, "name", font_name, 0);
+ rb_define_method(Font, "ascent", font_ascent, 0);
+ rb_define_method(Font, "descent", font_descent, 0);
rb_define_method(Font, "glyphs", font_glyphs, 0);
Device = rb_define_class_under(GFX, "Device", rb_cObject);
rb_define_method(Font, "glyphs", font_glyphs, 0);
Device = rb_define_class_under(GFX, "Device", rb_cObject);