]> git.imager.perl.org - imager.git/commitdiff
claes' afm patch
authorTony Cook <tony@develop=help.com>
Tue, 11 Dec 2001 12:58:56 +0000 (12:58 +0000)
committerTony Cook <tony@develop=help.com>
Tue, 11 Dec 2001 12:58:56 +0000 (12:58 +0000)
Changes
Imager.xs
lib/Imager/Font/Type1.pm

diff --git a/Changes b/Changes
index e4d7f66dc7564ecaf0a6bf7bee7b0a4eaa8def49..1f8a2054a650acb5c31f48b5f3d4cf8ca7f76904 100644 (file)
--- a/Changes
+++ b/Changes
@@ -563,6 +563,7 @@ Revision history for Perl extension Imager.
        - initialize counter for packing 4 bit data
         - don't allocate hashboxes as locals since it overflows the 
          stack by default in Darwin
+        - applied T1 afm patch from Claes Jacobsson
 
 =================================================================
 
index 7c2cb7d9d0ac1765a0e2d6a3ec9df4d9c5086961..34ce9b5719341cd6716d95e4c52c1f4867991b8b 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -1252,7 +1252,7 @@ i_t1_set_aa(st)
               int     st
 
 int
-i_t1_new(pfb,afm=NULL)
+i_t1_new(pfb,afm)
                      char*    pfb
                      char*    afm
 
index cfb78f65bea8f7f83a82992b77a2d7389fa0f5d0..26687d2f247491660ed1f4beab9bb12371f150ef 100644 (file)
@@ -37,7 +37,20 @@ sub new {
   unless ($hsh{file} =~ m!^/! || $hsh{file} =~ m!^\./!) {
     $hsh{file} = './' . $hsh{file};
   }
-  my $id = Imager::i_t1_new($hsh{file});
+
+  if($hsh{afm}) {
+         unless (-e $hsh{afm}) {
+           $Imager::ERRSTR = "Afm file $hsh{afm} not found";
+           return;
+         }
+         unless ($hsh{afm} =~ m!^/! || $hsh{afm} =~ m!^\./!) {
+           $hsh{file} = './' . $hsh{file};
+         }
+  } else {
+         $hsh{afm} = 0;
+  }
+
+  my $id = Imager::i_t1_new($hsh{file},$hsh{afm});
   unless ($id >= 0) { # the low-level code may miss some error handling
     $Imager::ERRSTR = "Could not load font ($id)";
     return;