- #PRINTMASTER PLATINUM 18 DEFAULT FONT COLOR DRIVER#
- #PRINTMASTER PLATINUM 18 DEFAULT FONT COLOR FULL#
My $bbox_object = $font->bounding_box(string => "A Fool") $neg_width $right_bearing) = $font->bounding_box(string => "A Fool") Returns the bounding box for the specified string.
#PRINTMASTER PLATINUM 18 DEFAULT FONT COLOR DRIVER#
If you want to use a suitcase font you will need to tell Imager to use the FreeType 2.x driver by setting type to 'ft2': my $font = Imager::Font->new(file=>$file, index => 1, type=>'ft2') index - for font file containing multiple fonts this selects which font to use.aa - the default value for the $im->string(.) aa parameter.vlayout - the default value for the $img->string(.) vlayout parameter.align - the default value for the $img->string(.) align parameter.utf8 - if non-zero then text supplied to $img->string(.) and $font->bounding_box(.) is assumed to be UTF-8 encoded by default.
size - the default size used with this font.color - the default color used with this font.Allows for synthesis of underline, strikethrough and overline. Currently the permitted values for this are: This is ignored if the file parameter is supplied. This is used only under Win32 to create a GDI based font. file - name of the file to load the font from.įace - face name.Other logical font attributes may be added if there is sufficient demand.
#PRINTMASTER PLATINUM 18 DEFAULT FONT COLOR FULL#
There isn't any access to other logical font attributes, but this typically isn't necessary for Win32 TrueType fonts, since you can construct the full name of the font as above. To use Win32 fonts supply the face name of the font: $font = Imager::Font->new(face=>'Arial Bold Italic') If any of the color, size or aa parameters are omitted when calling Imager::Font->new() the they take the following values: color => Imager::Color->new(255, 0, 0, 0) # this default should be changed The 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. $ttfont = Imager::Font->new(file => 'arglebarf', type => 'tt') If Imager cannot tell which type a font is you can tell it explicitly by using the type parameter: $t1font = Imager::Font->new(file => 'fruitcase', type => 't1') A suffix of ttf is taken to mean a TrueType font while a suffix of pfb is taken to mean a Type 1 Postscript font. Imager can see which type of font a file is by looking at the suffix of the file name for the font. It's default color is $blue, default size is 30 pixels and it's rendered anti-aliased by default. This creates a font which is the TrueType font denmark.ttf. $font = Imager::Font->new(file => 'denmark.ttf', This creates a font object to pass to functions that take a font argument. Print "Has truetype" if $Imager::formats new To check if Imager is t1 or TrueType capable you can use something like this: use Imager If both T1lib and FreeType were available at the time of compilation then Imager should be able to work with both TrueType fonts and t1 Postscript fonts. The module also handles querying fonts for sizes and such. This module handles creating Font objects used by Imager. My $bbox_object = $font->bounding_box(string=>"Foo") $right_bearing) = $font->bounding_box(string=>"Foo") $font = Imager::Font->new(file => 'pathtofont.ttf', $w32font = Imager::Font->new(face => 'Times New Roman') $ttfont = Imager::Font->new(file => 'pathtofont.ttf') $t1font = Imager::Font->new(file => 'pathtofont.pfb')