class Freetype::Charmap

Overview

FT_Charmap wrapper.

A handle to a given character map. A charmap is used to translate character codes in a given encoding into glyph indexes for its parent's face. Some font formats may provide several charmaps per font.

Each face object owns zero or more charmaps, but only one of them can be 'active' and used by FT_Get_Char_Index or FT_Load_Char.

The list of available charmaps in a face is available through the 'face.num_charmaps' and 'face.charmaps' fields of FT_FaceRec.

The currently active charmap is available as 'face.charmap'. You should call FT_Set_Charmap to change it.

Note:

When a new face is created (either through FT_New_Face or FT_Open_Face), the library looks for a Unicode charmap within the list and automatically activates it.

See also:

See LibFreetype::FT_CharMapRec for the publicly accessible fields of a given character map.

Defined in:

freetype/charmap.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(charmap : LibFreetype::FT_CharMap) #

[View source]

Instance Method Detail

def charmap : LibFreetype::FT_CharMap #

[View source]
def cmap_format #

The format of 'charmap'. If 'charmap' doesn't belong to a TrueType/sfnt face, return -1.


[View source]
def cmap_language_id #

The language ID of 'charmap'. If 'charmap' doesn't belong to a TrueType/sfnt face, just return 0 as the default value.


[View source]
def encoding #

An FT_Encoding tag identifying the charmap. Use this with FT_Select_Charmap.


[View source]
def encoding_id #

A platform specific encoding number. This also comes from the TrueType specification and should be emulated similarly.


[View source]
def encoding_name #

A platform specific encoding name. This also comes from the TrueType specification and should be emulated similarly.


[View source]
def index #

The index into the array of character maps within the face to which 'charmap' belongs. If an error occurs, -1 is returned.


[View source]
def platform_id #

An ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and should be emulated for other formats.


[View source]