ft2=>{
class=>'Imager::Font::FreeType2',
module=>'Imager/Font/FreeType2.pm',
- files=>'.*\.(pfa|pfb|otf|ttf|fon|fnt)$',
+ files=>'.*\.(pfa|pfb|otf|ttf|fon|fnt|dfont)$',
},
ifs=>{
class=>'Imager::Font::Image',
This creates a font object to pass to functions that take a font argument.
$font = Imager::Font->new(file => 'denmark.ttf',
+ index => 0,
color => $blue,
size => 30,
aa => 1);
$t1font = Imager::Font->new(file => 'fruitcase', type => 't1');
$ttfont = Imager::Font->new(file => 'arglebarf', type => 'tt');
+The C<index> parameter is used to select a single face from a font
+file containing more than one face, for example, from a Macintosh font
+suitcase or a .dfont file.
+
If any of the C<color>, C<size> or C<aa> parameters are omitted when
calling C<Imager::Font->new()> the they take the following values:
-
color => Imager::Color->new(255, 0, 0, 0); # this default should be changed
size => 15
aa => 0
+ index => 0
To use Win32 fonts supply the facename of the font:
Returns the internal name of the face. Not all font types support
this method yet.
-=item glyph_names(string=>$string [, utf8=>$utf8 ] );
+=item glyph_names(string=>$string [, utf8=>$utf8 ][, reliable_only=>0 ] );
Returns a list of glyph names for each of the characters in the
string. If the character has no name then C<undef> is returned for
will not return any names. Freetype 1 can return standard names even
if there are no glyph names in the font.
+Freetype 2 has an API function that returns true only if the font has
+"reliable glyph names", unfortunately this always returns false for
+TTF fonts. This can avoid the check of this API by supplying
+C<reliable_only> as 0. The consequences of using this on an unknown
+font may be unpredictable, since the Freetype documentation doesn't
+say how those name tables are unreliable, or how FT2 handles them.
+
Both Freetype 1.x and 2.x allow support for glyph names to not be
included.
Imager(3), Imager::Font::FreeType2(3), Imager::Font::Type1(3),
Imager::Font::Win32(3), Imager::Font::Truetype(3), Imager::Font::BBox(3)
-
-http://www.eecs.umich.edu/~addi/perl/Imager/
+ http://imager.perl.org/
=cut