use Font::FreeType; my $freetype = Font::FreeType->new; my $face = $freetype->face('Vera.ttf');
Never 'use' this module directly; the class is loaded automatically from Font::FreeType. Use the "Font::FreeType->face()" method to create a new Font::FreeType::Face object from a filename.
Each time your callback code is called, $_ will be set to a Font::FreeType::Glyph object for the current glyph. For an example see the program list-characters.pl provided in the distribution.
Returns undef if the glyph is not available in the font.
Returns undef if the glyph is not available in the font.
See also "has_reliable_glyph_names()" below.
See also "has_glyph_names()" above.
Note: currently always returns the x axis kerning, but this will be fixed when vertical layouts are handled properly.
For example, assuming $left and $right are two Font::FreeType::Glyph objects:
my $kern_distance = $face->kerning($left->index, $right->index);
In list context this returns two values corresponding to the x and y axes, which should be treated in the same way.
The "mode" argument controls how the kerning is calculated, with the following options available:
When generating PostScript outlines a resolution of 72 will scale to PostScript points.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.