]> git.imager.perl.org - imager.git/blobdiff - lib/Imager/Font/FreeType2.pm
added has_chars() method to Imager::Font::FreeType2
[imager.git] / lib / Imager / Font / FreeType2.pm
index 1e1461bb17ab5db9397d4c9575907a385449f0ca..bac577fb9fcee7daef7e85983ab775a54085dd5a 100644 (file)
@@ -102,6 +102,17 @@ sub utf8 {
   return 1;
 }
 
+# check if the font has the characters in the given string
+sub has_chars {
+  my ($self, %hsh) = @_;
+
+  unless (defined $hsh{string} && length $hsh{string}) {
+    $Imager::ERRSTR = "No string supplied to \$font->has_chars()";
+    return;
+  }
+  return i_ft2_has_chars($self->{id}, $hsh{string}, $hsh{utf8} || 0);
+}
+
 1;
 
 __END__