Class: Cairo::FontExtents
- Inherits:
-
Object
- Object
- Cairo::FontExtents
- Defined in:
- ext/cairo/rb_cairo_font_extents.c
Instance Method Summary collapse
- #ascent ⇒ Object
- #descent ⇒ Object
- #height ⇒ Object
- #initialize ⇒ Object constructor
- #max_x_advance ⇒ Object
- #max_y_advance ⇒ Object
- #set_ascent ⇒ Object
- #set_descent ⇒ Object
- #set_height ⇒ Object
- #set_max_x_advance ⇒ Object
- #set_max_y_advance ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 72
static VALUE
cr_font_extents_initialize (VALUE self)
{
cairo_font_extents_t *extents;
extents = ALLOC (cairo_font_extents_t);
extents->ascent = 1.0;
extents->descent = 0.0;
extents->height = 1.0;
extents->max_x_advance = 1.0;
extents->max_y_advance = 0.0;
RTYPEDDATA_DATA (self) = extents;
return Qnil;
}
|
Instance Method Details
#ascent ⇒ Object
89 90 91 92 93 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 89
static VALUE
cr_font_extents_ascent (VALUE self)
{
return rb_float_new (_SELF(self)->ascent);
}
|
#descent ⇒ Object
102 103 104 105 106 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 102
static VALUE
cr_font_extents_descent (VALUE self)
{
return rb_float_new (_SELF(self)->descent);
}
|
#height ⇒ Object
115 116 117 118 119 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 115
static VALUE
cr_font_extents_height (VALUE self)
{
return rb_float_new (_SELF(self)->height);
}
|
#max_x_advance ⇒ Object
128 129 130 131 132 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 128
static VALUE
cr_font_extents_max_x_advance (VALUE self)
{
return rb_float_new (_SELF(self)->max_x_advance);
}
|
#max_y_advance ⇒ Object
141 142 143 144 145 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 141
static VALUE
cr_font_extents_max_y_advance (VALUE self)
{
return rb_float_new (_SELF(self)->max_y_advance);
}
|
#set_ascent ⇒ Object
95 96 97 98 99 100 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 95
static VALUE
cr_font_extents_set_ascent (VALUE self, VALUE ascent)
{
_SELF(self)->ascent = NUM2DBL (ascent);
return self;
}
|
#set_descent ⇒ Object
108 109 110 111 112 113 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 108
static VALUE
cr_font_extents_set_descent (VALUE self, VALUE descent)
{
_SELF(self)->descent = NUM2DBL (descent);
return self;
}
|
#set_height ⇒ Object
121 122 123 124 125 126 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 121
static VALUE
cr_font_extents_set_height (VALUE self, VALUE height)
{
_SELF(self)->height = NUM2DBL (height);
return self;
}
|
#set_max_x_advance ⇒ Object
134 135 136 137 138 139 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 134
static VALUE
cr_font_extents_set_max_x_advance (VALUE self, VALUE max_x_advance)
{
_SELF(self)->max_x_advance = NUM2DBL (max_x_advance);
return self;
}
|
#set_max_y_advance ⇒ Object
147 148 149 150 151 152 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 147
static VALUE
cr_font_extents_set_max_y_advance (VALUE self, VALUE max_y_advance)
{
_SELF(self)->max_y_advance = NUM2DBL (max_y_advance);
return self;
}
|
#to_s ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'ext/cairo/rb_cairo_font_extents.c', line 154
static VALUE
cr_font_extents_to_s (VALUE self)
{
VALUE ret;
ret = rb_str_new2 ("#<");
rb_str_cat2 (ret, rb_class2name (CLASS_OF (self)));
rb_str_cat2 (ret, ": ");
rb_str_cat2 (ret, "ascent=");
rb_str_concat (ret, rb_inspect (cr_font_extents_ascent (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "descent=");
rb_str_concat (ret, rb_inspect (cr_font_extents_descent (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "height=");
rb_str_concat (ret, rb_inspect (cr_font_extents_height (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "max_x_advance=");
rb_str_concat (ret, rb_inspect (cr_font_extents_max_x_advance (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "max_y_advance=");
rb_str_concat (ret, rb_inspect (cr_font_extents_max_y_advance (self)));
rb_str_cat2 (ret, ">");
return ret;
}
|