diff options
author | Matthias Kramm <kramm@quiss.org> | 2010-01-05 18:34:54 -0800 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2010-01-05 18:34:54 -0800 |
commit | b0685de97c1d958400b47f1d61f2590053f07e01 (patch) | |
tree | 186948713cea765c4f42ef59a8deddd81e00e968 | |
parent | 7205feb5d94ff0bddb07935582b2b2e93ff9b711 (diff) |
added font->ascent/font->descent to ruby interfacepublic
-rw-r--r-- | lib/ruby/gfx.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ruby/gfx.c b/lib/ruby/gfx.c index 687e38ab..11addd21 100644 --- a/lib/ruby/gfx.c +++ b/lib/ruby/gfx.c @@ -310,6 +310,18 @@ static VALUE font_allocate(VALUE cls) 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); @@ -637,6 +649,8 @@ void Init_gfx() 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); |