# class Cairo::TextExtents

### Public Class Methods

new() click to toggle source

    static VALUE
    cr_text_extents_initialize (VALUE self)
    {
      cairo_text_extents_t *extents;

      extents = ALLOC (cairo_text_extents_t);
      extents->x_bearing = 0.0;
      extents->y_bearing = -1.0;
      extents->width = 0.0;
      extents->height = 1.0;
      extents->x_advance = 1.0;
      extents->y_advance = 0.0;

      DATA_PTR (self) = extents;

      return Qnil;
    }

### Public Instance Methods

height() click to toggle source

    static VALUE
    cr_text_extents_height (VALUE self)
    {
      return rb_float_new (_SELF(self)->height);
    }

set_height(p1) click to toggle source

    static VALUE
    cr_text_extents_set_height (VALUE self, VALUE height)
    {
      _SELF(self)->height = NUM2DBL (height);
      return Qnil;
    }

set_width(p1) click to toggle source

    static VALUE
    cr_text_extents_set_width (VALUE self, VALUE width)
    {
      _SELF(self)->width = NUM2DBL (width);
      return Qnil;
    }

set_x_advance(p1) click to toggle source

    static VALUE
    cr_text_extents_set_x_advance (VALUE self, VALUE x_advance)
    {
      _SELF(self)->x_advance = NUM2DBL (x_advance);
      return Qnil;
    }

set_x_bearing(p1) click to toggle source

    static VALUE
    cr_text_extents_set_x_bearing (VALUE self, VALUE x_bearing)
    {
      _SELF(self)->x_bearing = NUM2DBL (x_bearing);
      return Qnil;
    }

set_y_advance(p1) click to toggle source

    static VALUE
    cr_text_extents_set_y_advance (VALUE self, VALUE y_advance)
    {
      _SELF(self)->y_advance = NUM2DBL (y_advance);
      return Qnil;
    }

set_y_bearing(p1) click to toggle source

    static VALUE
    cr_text_extents_set_y_bearing (VALUE self, VALUE y_bearing)
    {
      _SELF(self)->y_bearing = NUM2DBL (y_bearing);
      return Qnil;
    }

to_s() click to toggle source

    static VALUE
    cr_text_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, "x_bearing=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_x_bearing (self)));
      rb_str_cat2 (ret, ", ");
      rb_str_cat2 (ret, "y_bearing=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_y_bearing (self)));
      rb_str_cat2 (ret, ", ");
      rb_str_cat2 (ret, "width=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_width (self)));
      rb_str_cat2 (ret, ", ");
      rb_str_cat2 (ret, "height=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_height (self)));
      rb_str_cat2 (ret, ", ");
      rb_str_cat2 (ret, "x_advance=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_x_advance (self)));
      rb_str_cat2 (ret, ", ");
      rb_str_cat2 (ret, "y_advance=");
      rb_str_concat (ret, rb_inspect (cr_text_extents_y_advance (self)));
      rb_str_cat2 (ret, ">");

      return ret;
    }

width() click to toggle source

    static VALUE
    cr_text_extents_width (VALUE self)
    {
      return rb_float_new (_SELF(self)->width);
    }

x_advance() click to toggle source

    static VALUE
    cr_text_extents_x_advance (VALUE self)
    {
      return rb_float_new (_SELF(self)->x_advance);
    }

x_bearing() click to toggle source

    static VALUE
    cr_text_extents_x_bearing (VALUE self)
    {
      return rb_float_new (_SELF(self)->x_bearing);
    }

y_advance() click to toggle source

    static VALUE
    cr_text_extents_y_advance (VALUE self)
    {
      return rb_float_new (_SELF(self)->y_advance);
    }

y_bearing() click to toggle source

    static VALUE
    cr_text_extents_y_bearing (VALUE self)
    {
      return rb_float_new (_SELF(self)->y_bearing);
    }