From bacd52d1a8b4136d8dfc98a610aedda1f3cd126e Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 26 Aug 2007 17:09:31 +0200 Subject: [PATCH] Added Evas#font_hinting=. --- src/rb_evas.c | 17 +++++++++++++++++ src/rb_evas_main.h | 3 +++ src/rb_text.c | 3 --- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/rb_evas.c b/src/rb_evas.c index 4eb2134..b38082f 100644 --- a/src/rb_evas.c +++ b/src/rb_evas.c @@ -323,6 +323,18 @@ static VALUE c_output_viewport_get (VALUE self) INT2FIX (h)); } +static VALUE +c_font_hinting_set (VALUE self, VALUE val) +{ + GET_OBJ (self, RbEvas, e); + + Check_Type (val, T_FIXNUM); + + evas_font_hinting_set (e->real, FIX2INT (val)); + + return Qnil; +} + void Init_Evas (void) { cEvas = rb_define_class_under (mEvas, "Evas", rb_cObject); @@ -353,4 +365,9 @@ void Init_Evas (void) rb_define_method (cEvas, "find_object", c_find_object, 1); rb_define_method (cEvas, "output_size", c_output_size_get, 0); rb_define_method (cEvas, "output_viewport", c_output_viewport_get, 0); + rb_define_method (cEvas, "font_hinting=", c_font_hinting_set, 1); + + DEF_CONST (cEvas, EVAS_FONT_HINTING_, NONE); + DEF_CONST (cEvas, EVAS_FONT_HINTING_, AUTO); + DEF_CONST (cEvas, EVAS_FONT_HINTING_, BYTECODE); } diff --git a/src/rb_evas_main.h b/src/rb_evas_main.h index a492e12..4ea2c76 100644 --- a/src/rb_evas_main.h +++ b/src/rb_evas_main.h @@ -52,6 +52,9 @@ \ return rb_str_new2 (buf); +#define DEF_CONST(mod, prefix, name) \ + rb_define_const ((mod), #name, INT2FIX (prefix##name)); + VALUE mEvas; #endif diff --git a/src/rb_text.c b/src/rb_text.c index 0c78d86..4c90a34 100644 --- a/src/rb_text.c +++ b/src/rb_text.c @@ -24,9 +24,6 @@ #include "rb_evas.h" #include "rb_evas_object.h" -#define DEF_CONST(mod, prefix, name) \ - rb_define_const ((mod), #name, INT2FIX (prefix##name)); - #define GET_COLOR_METHOD(name) \ int r = 0, g = 0, b = 0, a = 0; \ \ -- 2.30.2