]> git.imager.perl.org - imager.git/blobdiff - lib/Imager/Font.pm
add an internal i_img_samef() and adapt is_imaged() to use it
[imager.git] / lib / Imager / Font.pm
index 1dedbaacd06171a430b36006a4e888713b4b521e..a7e13bd220ba40be8f6168e6fb95575c22c9703a 100644 (file)
@@ -4,7 +4,7 @@ use Imager::Color;
 use strict;
 use vars qw($VERSION);
 
-$VERSION = "1.034";
+$VERSION = "1.035";
 
 # the aim here is that we can:
 #  - add file based types in one place: here
@@ -21,11 +21,10 @@ my %drivers =
        checktype => 1,
        },
    t1=>{
-        class=>'Imager::Font::Type1',
-        module=>'Imager/Font/Type1.pm',
+        class=>'Imager::Font::T1',
+        module=>'Imager/Font/T1.pm',
         files=>'.*\.pfb$',
        description => 'T1Lib',
-       checktype => 1,
        },
    ft2=>{
          class=>'Imager::Font::FT2',
@@ -78,7 +77,7 @@ sub new {
         undef $type;
         my $re = $drivers{$drv}{files} or next;
         if ($file =~ /$re/i) {
-         if (eval { require $drivers{$drv}{module}; 1 }) {
+         if (eval { require $drivers{$drv}{module}; 1 } and !( $drivers{$drv}{checktype} && !$Imager::formats{$drv} )) {
            $type = $drv;
            last;
          }
@@ -545,9 +544,7 @@ the FreeType 2.x driver by setting C<type> to C<'ft2'>:
 
 =back
 
-
-
-=item bounding_box
+=item bounding_box()
 
 Returns the bounding box for the specified string.  Example:
 
@@ -653,7 +650,7 @@ parameter.
 C<utf8> - For drivers that support it, treat the string as UTF-8 encoded.
 For versions of perl that support Unicode (5.6 and later), this will
 be enabled automatically if the 'string' parameter is already a UTF-8
-string. See L<UTF-8> for more information.  Default: the C<utf8> value
+string. See L</UTF-8> for more information.  Default: the C<utf8> value
 passed to Imager::Font->new(...) or 0.
 
 =item *
@@ -672,7 +669,7 @@ and height of the text instead.
 =item string()
 
 The $img->string(...) method is now documented in
-L<Imager::Draw/string>
+L<Imager::Draw/string()>
 
 =item align(string=>$text,size=>$size,x=>...,y=>...,valign => ...,halign=>...)
 
@@ -780,7 +777,9 @@ C<dpi> - set both horizontal and vertical resolution to this value.
 
 Returns a list containing the previous C<xdpi>, C<ydpi> values.
 
-=item transform(matrix=>$matrix)
+=item transform()
+
+  $font->transform(matrix=>$matrix);
 
 Applies a transformation to the font, where matrix is an array ref of
 numbers representing a 2 x 3 matrix:
@@ -827,7 +826,7 @@ at least one character.
 C<utf8> - For drivers that support it, treat the string as UTF-8
 encoded.  For versions of perl that support Unicode (5.6 and later),
 this will be enabled automatically if the 'string' parameter is
-already a UTF-8 string. See L<UTF-8> for more information.  Default:
+already a UTF-8 string. See L</UTF-8> for more information.  Default:
 the C<utf8> value passed to Imager::Font->new(...) or 0.
 
 =back
@@ -860,7 +859,7 @@ included.
 =item draw
 
 This is used by Imager's string() method to implement drawing text.
-See L<Imager::Draw/string>.
+See L<Imager::Draw/string()>.
 
 =back