]> git.imager.perl.org - imager.git/blobdiff - W32/W32.pm
Imager 1.004_004
[imager.git] / W32 / W32.pm
index f27ebd5ed3be6b5d04df85e87b894b9d63d1741e..89feecea7dcf80c719aa8a10100e08f7b544ce4b 100644 (file)
@@ -5,24 +5,23 @@ use vars qw($VERSION @ISA);
 @ISA = qw(Imager::Font);
 
 BEGIN {
 @ISA = qw(Imager::Font);
 
 BEGIN {
-  $VERSION = "0.77";
-
-  eval {
-    require XSLoader;
-    XSLoader::load('Imager::Font::W32', $VERSION);
-    1;
-  } or do {
-    require DynaLoader;
-    push @ISA, 'DynaLoader';
-    bootstrap Imager::Font::W32 $VERSION;
-  };
+  $VERSION = "0.89";
+
+  require XSLoader;
+  XSLoader::load('Imager::Font::W32', $VERSION);
 }
 
 # called by Imager::Font::new()
 # since Win32's HFONTs include the size information this
 # is just a stub
 sub new {
 }
 
 # called by Imager::Font::new()
 # since Win32's HFONTs include the size information this
 # is just a stub
 sub new {
-  my ($class, %opts) = @_;
+  my $class = shift;
+  my %opts =
+      (
+       color => Imager::Color->new(255, 0, 0),
+       size => 15,
+       @_,
+      );
 
   return bless \%opts, $class;
 }
 
   return bless \%opts, $class;
 }
@@ -31,6 +30,12 @@ sub _bounding_box {
   my ($self, %opts) = @_;
   
   my @bbox = i_wf_bbox($self->{face}, $opts{size}, $opts{string}, $opts{utf8});
   my ($self, %opts) = @_;
   
   my @bbox = i_wf_bbox($self->{face}, $opts{size}, $opts{string}, $opts{utf8});
+  unless (@bbox) {
+    Imager->_set_error(Imager->_error_as_msg);
+    return;
+  }
+
+  return @bbox;
 }
 
 sub _draw {
 }
 
 sub _draw {
@@ -38,12 +43,12 @@ sub _draw {
 
   my %input = @_;
   if (exists $input{channel}) {
 
   my %input = @_;
   if (exists $input{channel}) {
-    i_wf_cp($self->{face}, $input{image}{IMG}, $input{x}, $input{'y'},
+    return i_wf_cp($self->{face}, $input{image}{IMG}, $input{x}, $input{'y'},
            $input{channel}, $input{size},
            $input{string}, $input{align}, $input{aa}, $input{utf8});
   }
   else {
            $input{channel}, $input{size},
            $input{string}, $input{align}, $input{aa}, $input{utf8});
   }
   else {
-    i_wf_text($self->{face}, $input{image}{IMG}, $input{x}, 
+    return i_wf_text($self->{face}, $input{image}{IMG}, $input{x}, 
              $input{'y'}, $input{color}, $input{size}, 
              $input{string}, $input{align}, $input{aa}, $input{utf8});
   }
              $input{'y'}, $input{color}, $input{size}, 
              $input{string}, $input{align}, $input{aa}, $input{utf8});
   }
@@ -54,6 +59,10 @@ sub utf8 {
   return 1;
 }
 
   return 1;
 }
 
+sub can_glyph_names {
+  return;
+}
+
 1;
 
 __END__
 1;
 
 __END__
@@ -85,7 +94,7 @@ renamed it.
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
-Tony Cook <tony@imager.perl.org>
+Tony Cook <tonyc@cpan.org>
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO