Class: FT2::BitmapGlyph

Inherits:
Glyph
  • Object
show all
Defined in:
ext/ft2-ruby/ft2.c

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Glyph

#advance, #cbox, #class, #dup, #format, #library, #to_bmap, #transform

Class Method Details

.initializeObject

Constructor for FT2::BitmapGlyph class.

This method is currently empty. You should never call this method directly unless you’re instantiating a derived class (ie, you know what you’re doing).



2661
2662
2663
# File 'ext/ft2-ruby/ft2.c', line 2661

static VALUE ft_bmapglyph_init(VALUE self) {
  return self;
}

Instance Method Details

#bitmapObject

Get the FT2::Bitmap of a FT2::BitmapGlyph object.

Examples:

bmap = bmap_glyph.bitmap


2713
2714
2715
2716
2717
# File 'ext/ft2-ruby/ft2.c', line 2713

static VALUE ft_bmapglyph_bitmap(VALUE self) {
  FT_BitmapGlyph *glyph;
  Data_Get_Struct(self, FT_BitmapGlyph, glyph);
  return Data_Wrap_Struct(cBitmapGlyph, 0, glyph_free, &(*glyph)->bitmap);
}

#leftObject

Get the left-side bearing of a BitmapGlyph object.

Description:

The left-side bearing, i.e., the horizontal distance from the
current pen position to the left border of the glyph bitmap.

Note:

FT2::BitmapGlyph is a subclass of FT2::Glyph.

Examples:

x = bmap_glyph.left


2700
2701
2702
2703
2704
# File 'ext/ft2-ruby/ft2.c', line 2700

static VALUE ft_bmapglyph_left(VALUE self) {
  FT_BitmapGlyph *glyph;
  Data_Get_Struct(self, FT_BitmapGlyph, glyph);
  return INT2FIX((*glyph)->left);
}

#topObject

Get the top-side bearing of a BitmapGlyph object.

Description:

The top-side bearing, i.e., the vertical distance from the current
pen position to the top border of the glyph bitmap. This distance
is positive for upwards-y.

Note:

FT2::BitmapGlyph is a subclass of FT2::Glyph.

Examples:

y = bmap_glyph.top


2680
2681
2682
2683
2684
# File 'ext/ft2-ruby/ft2.c', line 2680

static VALUE ft_bmapglyph_top(VALUE self) {
  FT_BitmapGlyph *glyph;
  Data_Get_Struct(self, FT_BitmapGlyph, glyph);
  return INT2FIX((*glyph)->top);
}