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

Constructor Details

#initializeObject



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'ext/cairo/rb_cairo_font_face.c', line 525

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



554
555
556
557
558
559
# File 'ext/cairo/rb_cairo_font_face.c', line 554

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



561
562
563
564
565
566
# File 'ext/cairo/rb_cairo_font_face.c', line 561

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



568
569
570
571
572
573
# File 'ext/cairo/rb_cairo_font_face.c', line 568

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



575
576
577
578
579
580
# File 'ext/cairo/rb_cairo_font_face.c', line 575

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