| Class FT2::GlyphSlot |
|
| Methods |
| Public Class methods |
| initialize(VALUE self) |
Constructor for FT2::GlyphSlot 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).
| Public Instance methods |
| library(VALUE self) |
| face(VALUE self) |
| next(VALUE self) |
Get the next FT2::GlyphSlot object.
Description:
In some cases (like some font tools), several FT2::GlyphSlot s per FT2::Face object can be a good thing. As this is rare, the FT2::GlyphSlot s are listed through a direct, single-linked list using its `next' field.
Examples:
next_slot = slot.next
| flags(VALUE self) |
| metrics(VALUE self) |
| h_advance(VALUE self) |
Get the linearly scaled horizontal advance width of a FT2::GlyphSlot object.
Description:
For scalable formats only, this field holds the linearly scaled horizontal advance width for the FT2:GlyphSlot (i.e. the scaled and unhinted value of the hori advance). This can be important to perform correct WYSIWYG layout.
Note:
The return value is expressed by default in 16.16 pixels. However, when the FT2::GlyphSlot is loaded with the FT2::Load::LINEAR_DESIGN flag, this field contains simply the value of the advance in original font units.
Aliases:
FT2::GlyphSlot#linearHoriAdvance FT2::GlyphSlot#h_adv FT2::GlyphSlot#ha
Examples:
h_adv = slot.h_advance
| v_advance(VALUE self) |
Get the linearly scaled vertical advance height of a FT2::GlyphSlot object.
Description:
For scalable formats only, this field holds the linearly scaled vertical advance height for the FT2:GlyphSlot (i.e. the scaled and unhinted value of the hori advance). This can be important to perform correct WYSIWYG layout.
Note:
The return value is expressed by default in 16.16 pixels. However, when the FT2::GlyphSlot is loaded with the FT2::Load::LINEAR_DESIGN flag, this field contains simply the value of the advance in original font units.
Aliases:
FT2::GlyphSlot#linearVertAdvance FT2::GlyphSlot#v_adv FT2::GlyphSlot#va
Examples:
v_adv = slot.v_advance
| advance(VALUE self) |
| format(VALUE self) |
Get the format of a FT2::GlyphSlot object.
Glyph Formats:
FT2::GlyphFormat::COMPOSITE FT2::GlyphFormat::BITMAP FT2::GlyphFormat::OUTLINE FT2::GlyphFormat::PLOTTER
Examples:
fmt = slot.format
| bitmap(VALUE self) |
| bitmap_left(VALUE self) |
Get the left bearing (in pixels) of a bitmap format FT2::GlyphSlot object.
Note:
Only valid if the format is FT2::GlyphFormat::BITMAP.
Examples:
left = slot.bitmap_left
| bitmap_top(VALUE self) |
Get the top bearing (in pixels) of a bitmap format FT2::GlyphSlot object.
Note:
Only valid if the format is FT2::GlyphFormat::BITMAP. The value returned is the distance from the baseline to the topmost glyph scanline, upwards y-coordinates being positive.
Examples:
top = slot.bitmap_top
| outline(VALUE self) |
Get the outline of a bitmap outline format FT2::GlyphSlot object.
Note:
Only valid if the format is FT2::GlyphFormat::OUTLINE.
Examples:
outline = slot.outline
| num_subglyphs(VALUE self) |
Get the number of subglyphs of a FT2::GlyphSlot object.
Note:
Only valid if the format is FT2::GlyphFormat::COMPOSITE.
Examples:
outline = slot.outline
| subglyphs(VALUE self) |
Get a list of subglyphs of a composite format FT2::GlyphSlot object.
Note:
Only valid if the format is FT2::GlyphFormat::COMPOSITE. FIXME: this method may not work correctly at the moment.
Examples:
sub_glyphs = slot.subglyphs
| control_data(VALUE self) |
Get optional control data for a FT2::GlyphSlot object.
Description:
Certain font drivers can also return the control data for a given FT2::GlyphSlot (e.g. TrueType bytecode, Type 1 charstrings, etc.). This field is a pointer to such data.
Examples:
data = slot.control_data
| control_len(VALUE self) |
Get the length of the optional control data for a FT2::GlyphSlot object.
Examples:
len = slot.control_len
| render(VALUE self, VALUE render_mode) |
Convert a FT2::GlyphSlot object to a bitmap.
Description:
Converts a given FT2::GlyphSlot to a bitmap. It does so by
$inspecting the FT2::GlyphSlot format, finding the relevant
renderer, and invoking it.
render_mode: This is the render mode used to render the glyph image
into a bitmap. See below for a list of possible
values. If render_mode is nil, then it defaults to
FT2::RenderMode::NORMAL.
Aliases:
FT2::GlyphSlot#render_glyph
Render Modes:
FT2::RenderMode::NORMAL FT2::RenderMode::MONO
Examples:
slot.render FT2::RenderMode::NORMAL
| glyph() |