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



1637
1638
1639
# File 'ext/ft2-ruby/ft2.c', line 1637

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


1750
1751
1752
1753
1754
# File 'ext/ft2-ruby/ft2.c', line 1750

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


1702
1703
1704
1705
1706
# File 'ext/ft2-ruby/ft2.c', line 1702

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


1727
1728
1729
1730
1731
# File 'ext/ft2-ruby/ft2.c', line 1727

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


1677
1678
1679
1680
1681
# File 'ext/ft2-ruby/ft2.c', line 1677

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


1823
1824
1825
1826
1827
# File 'ext/ft2-ruby/ft2.c', line 1823

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


1775
1776
1777
1778
1779
# File 'ext/ft2-ruby/ft2.c', line 1775

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


1800
1801
1802
1803
1804
# File 'ext/ft2-ruby/ft2.c', line 1800

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


1656
1657
1658
1659
1660
# File 'ext/ft2-ruby/ft2.c', line 1656

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