@ISA = qw(Imager::Font);
BEGIN {
- $VERSION = "0.89";
+ $VERSION = "0.92";
require XSLoader;
XSLoader::load('Imager::Font::FT2', $VERSION);
$self->_valid
or return;
- return i_ft2_bbox($self->{id}, $input{size}, $input{sizew}, $input{string},
- $input{utf8});
+ my @result = i_ft2_bbox($self->{id}, $input{size}, $input{sizew},
+ $input{string}, $input{utf8});
+ unless (@result) {
+ Imager->_set_error(Imager->_error_as_msg);
+ return;
+ }
+
+ return @result;
}
sub dpi {
$Imager::ERRSTR = "No string supplied to \$font->has_chars()";
return;
}
- return i_ft2_has_chars($self->{id}, $hsh{string},
- _first($hsh{'utf8'}, $self->{utf8}, 0));
+ if (wantarray) {
+ my @result = i_ft2_has_chars($self->{id}, $hsh{string},
+ _first($hsh{'utf8'}, $self->{utf8}, 0));
+ unless (@result) {
+ Imager->_set_error(Imager->_error_as_msg);
+ return;
+ }
+
+ return @result;
+ }
+ else {
+ my $result = i_ft2_has_chars($self->{id}, $hsh{string},
+ _first($hsh{'utf8'}, $self->{utf8}, 0));
+ unless (defined $result) {
+ Imager->_set_error(Imager->_error_as_msg);
+ return;
+ }
+ return $result;
+ }
}
sub face_name {
}
sub can_glyph_names {
- i_ft2_can_do_glyph_names();
+ my ($self) = @_;
+
+ i_ft2_can_do_glyph_names()
+ or return;
+
+ if (ref $self) {
+ $self->_valid
+ or return;
+
+ i_ft2_face_has_glyph_names($self->{id})
+ or return;
+ }
+
+ return 1;
}
sub glyph_names {