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

quartz_supported?

Constructor Details

#initializeObject



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'ext/cairo/rb_cairo_font_face.c', line 535

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



564
565
566
567
568
569
# File 'ext/cairo/rb_cairo_font_face.c', line 564

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



571
572
573
574
575
576
# File 'ext/cairo/rb_cairo_font_face.c', line 571

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



578
579
580
581
582
583
# File 'ext/cairo/rb_cairo_font_face.c', line 578

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



585
586
587
588
589
590
# File 'ext/cairo/rb_cairo_font_face.c', line 585

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;
}