Class: FT2::GlyphMetrics

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initializeObject

Constructor for FT2::GlyphMetrics

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).



1639
1640
1641
# File 'ext/ft2-ruby/ft2.c', line 1639

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

Instance Method Details

#h_advanceObject Also known as: horiAdvance, ha

Get the glyph’s advance width for horizontal layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#horiAdvance
FT2::GlyphMetrics#ha

Examples:

ha = slot.metrics.h_advance
ha = slot.metrics.horiAdvance
ha = slot.metrics.ha


1752
1753
1754
1755
1756
# File 'ext/ft2-ruby/ft2.c', line 1752

static VALUE ft_glyphmetrics_h_advance(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->horiAdvance);
}

#h_bearing_xObject Also known as: horiBearingX, h_bear_x, hbx

Get the glyph’s left side bearing in horizontal layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#horiBearingX
FT2::GlyphMetrics#h_bear_x
FT2::GlyphMetrics#hbx

Examples:

hbx = slot.metrics.h_bearing_x
hbx = slot.metrics.horiBearingX
hbx = slot.metrics.h_bear_x
hbx = slot.metrics.hbx


1704
1705
1706
1707
1708
# File 'ext/ft2-ruby/ft2.c', line 1704

static VALUE ft_glyphmetrics_h_bear_x(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->horiBearingX);
}

#h_bearing_yObject Also known as: horiBearingY, h_bear_y, hby

Get the glyph’s top side bearing in horizontal layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#horiBearingY
FT2::GlyphMetrics#h_bear_y
FT2::GlyphMetrics#hby

Examples:

hby = slot.metrics.h_bearing_y
hby = slot.metrics.horiBearingY
hby = slot.metrics.h_bear_y
hby = slot.metrics.hby


1729
1730
1731
1732
1733
# File 'ext/ft2-ruby/ft2.c', line 1729

static VALUE ft_glyphmetrics_h_bear_y(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->horiBearingY);
}

#heightObject Also known as: h

Get the glyph’s height.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#h

Examples:

h = slot.metrics.height
h = slot.metrics.h


1679
1680
1681
1682
1683
# File 'ext/ft2-ruby/ft2.c', line 1679

static VALUE ft_glyphmetrics_height(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->height);
}

#v_advanceObject Also known as: vertAdvance, va

Get the glyph’s advance width for vertical layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#vertAdvance
FT2::GlyphMetrics#va

Examples:

va = slot.metrics.v_advance
va = slot.metrics.vertAdvance
va = slot.metrics.va


1825
1826
1827
1828
1829
# File 'ext/ft2-ruby/ft2.c', line 1825

static VALUE ft_glyphmetrics_v_advance(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->vertAdvance);
}

#v_bearing_xObject Also known as: vertBearingX, v_bear_x, vbx

Get the glyph’s left side bearing in vertical layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#vertBearingX
FT2::GlyphMetrics#v_bear_x
FT2::GlyphMetrics#vbx

Examples:

vbx = slot.metrics.v_bearing_x
vbx = slot.metrics.vertBearingX
vbx = slot.metrics.v_bear_x
vbx = slot.metrics.vbx


1777
1778
1779
1780
1781
# File 'ext/ft2-ruby/ft2.c', line 1777

static VALUE ft_glyphmetrics_v_bear_x(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->vertBearingX);
}

#v_bearing_yObject Also known as: vertBearingY, v_bear_y, vby

Get the glyph’s top side bearing in vertical layouts.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#vertBearingY
FT2::GlyphMetrics#v_bear_y
FT2::GlyphMetrics#vby

Examples:

vby = slot.metrics.v_bearing_y
vby = slot.metrics.vertBearingY
vby = slot.metrics.v_bear_y
vby = slot.metrics.vby


1802
1803
1804
1805
1806
# File 'ext/ft2-ruby/ft2.c', line 1802

static VALUE ft_glyphmetrics_v_bear_y(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->vertBearingY);
}

#widthObject Also known as: w

Get the glyph’s width.

Note:

Values are expressed in 26.6 fractional pixel format or in font
units, depending on context.

Aliases:

FT2::GlyphMetrics#w

Examples:

w = slot.metrics.width
w = slot.metrics.w


1658
1659
1660
1661
1662
# File 'ext/ft2-ruby/ft2.c', line 1658

static VALUE ft_glyphmetrics_width(VALUE self) {
  FT_Glyph_Metrics *glyph;
  Data_Get_Struct(self, FT_Glyph_Metrics, glyph);
  return INT2NUM(glyph->width);
}