Class: Cairo::UserFontFace

Inherits:
FontFace show all
Defined in:
ext/cairo/rb_cairo_font_face.c

Defined Under Namespace

Classes: TextToGlyphsData

Instance Method Summary collapse

Methods inherited from FontFace

freetype_supported?, quartz_supported?

Constructor Details

#initializeObject



692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'ext/cairo/rb_cairo_font_face.c', line 692

static VALUE
cr_user_font_face_initialize (VALUE self)
{
  cairo_font_face_t *face;

  face = cairo_user_font_face_create ();
  cr_font_face_check_status (face);

  cairo_font_face_set_user_data (face, &ruby_object_key, (void *)self, NULL);

  cairo_user_font_face_set_init_func
    (face, cr_user_font_face_init_func);
  cairo_user_font_face_set_render_glyph_func
    (face, cr_user_font_face_render_glyph_func);
  cairo_user_font_face_set_text_to_glyphs_func
    (face, cr_user_font_face_text_to_glyphs_func);
  cairo_user_font_face_set_unicode_to_glyph_func
    (face, cr_user_font_face_unicode_to_glyph_func);

  rb_ivar_set (self, cr_id_init, Qnil);
  rb_ivar_set (self, cr_id_render_glyph, Qnil);
  rb_ivar_set (self, cr_id_text_to_glyphs, Qnil);
  rb_ivar_set (self, cr_id_unicode_to_glyph, Qnil);

  DATA_PTR (self) = face;

  return Qnil;
}

Instance Method Details

#on_initObject



721
722
723
724
725
726
# File 'ext/cairo/rb_cairo_font_face.c', line 721

static VALUE
cr_user_font_face_on_init (VALUE self)
{
  rb_ivar_set (self, cr_id_init, rb_block_proc ());
  return self;
}

#on_render_glyphObject



728
729
730
731
732
733
# File 'ext/cairo/rb_cairo_font_face.c', line 728

static VALUE
cr_user_font_face_on_render_glyph (VALUE self)
{
  rb_ivar_set (self, cr_id_render_glyph, rb_block_proc ());
  return self;
}

#on_text_to_glyphsObject



735
736
737
738
739
740
# File 'ext/cairo/rb_cairo_font_face.c', line 735

static VALUE
cr_user_font_face_on_text_to_glyphs (VALUE self)
{
  rb_ivar_set (self, cr_id_text_to_glyphs, rb_block_proc ());
  return self;
}

#on_unicode_to_glyphObject



742
743
744
745
746
747
# File 'ext/cairo/rb_cairo_font_face.c', line 742

static VALUE
cr_user_font_face_on_unicode_to_glyph (VALUE self)
{
  rb_ivar_set (self, cr_id_unicode_to_glyph, rb_block_proc ());
  return self;
}