class Freetype::GlyphSlot

Overview

FT_GlyphSlot wrapper.

FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.

Defined in:

freetype/glyph_slot.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(glyph_slot : LibFreetype::FT_GlyphSlot) #

[View source]

Instance Method Detail

def advance #

This shorthand is, depending on FT_LOAD_IGNORE_TRANSFORM, the transformed advance width for the glyph (in 26.6 fractional pixel format). As specified with FT_LOAD_VERTICAL_LAYOUT, it uses either the 'horiAdvance' or the 'vertAdvance' value of 'metrics' field.


[View source]
def bitmap #

This field is used as a bitmap descriptor when the slot format is FT_GLYPH_FORMAT_BITMAP. Note that the address and content of the bitmap buffer can change between calls of FT_Load_Glyph and a few other functions.


[View source]
def bitmap_left #

This is the bitmap's left bearing expressed in integer pixels. Of course, this is only valid if the format is FT_GLYPH_FORMAT_BITMAP.


[View source]
def bitmap_top #

This is the bitmap's top bearing expressed in integer pixels. Remember that this is the distance from the baseline to the top-most glyph scanline, upwards y coordinates being positive.


[View source]
def format #

This field indicates the format of the image contained in the glyph slot. Typically FT_GLYPH_FORMAT_BITMAP, FT_GLYPH_FORMAT_OUTLINE, or FT_GLYPH_FORMAT_COMPOSITE, but others are possible.


[View source]
def glyph #

A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph.


[View source]
def glyph_slot : LibFreetype::FT_GlyphSlot #

[View source]
def linear_hori_advance #

The advance width of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.


[View source]
def linear_vert_advance #

The advance height of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.


[View source]
def metrics #

The metrics of the last loaded glyph in the slot. The returned values depend on the last load flags (see the FT_Load_Glyph API function) and can be expressed either in 26.6 fractional pixels or font units. Note that even when the glyph image is transformed, the metrics are not.


[View source]
def next #

In some cases (like some font tools), several glyph slots per face object can be a good thing. As this is rare, the glyph slots are listed through a direct, single-linked list using its 'next' field.


[View source]
def outline #

The outline descriptor for the current glyph image if its

format is FT_GLYPH_FORMAT_OUTLINE. Once a glyph is loaded, 'outline' can be transformed, distorted, embolded, etc. However, it must not be freed.


[View source]