Hello community,
here is the log from the commit of package perl-Font-FreeType for
openSUSE:Factory checked in at 2015-07-20 11:22:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Font-FreeType (Old)
and /work/SRC/openSUSE:Factory/.perl-Font-FreeType.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Font-FreeType"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Font-FreeType/perl-Font-FreeType.changes
2015-04-25 09:54:26.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Font-FreeType.new/perl-Font-FreeType.changes
2015-07-20 11:22:45.000000000 +0200
@@ -1,0 +2,12 @@
+Sat Jul 18 08:44:06 UTC 2015 - [email protected]
+
+- updated to 0.06
+ see /usr/share/doc/packages/perl-Font-FreeType/Changes
+
+ 0.06 2015-01-27 [email protected]
+ - No changes since 0.06_1
+
+ 0.06_1 2015-01-27 [email protected]
+ - Allow optionally fallback to missing glyph
+
+-------------------------------------------------------------------
Old:
----
Font-FreeType-0.05.tar.gz
New:
----
Font-FreeType-0.06.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Font-FreeType.spec ++++++
--- /var/tmp/diff_new_pack.lrbReJ/_old 2015-07-20 11:22:46.000000000 +0200
+++ /var/tmp/diff_new_pack.lrbReJ/_new 2015-07-20 11:22:46.000000000 +0200
@@ -17,7 +17,7 @@
Name: perl-Font-FreeType
-Version: 0.05
+Version: 0.06
Release: 0
%define cpan_name Font-FreeType
Summary: Read Font Files and Render Glyphs From Perl Using Freetype2
++++++ Font-FreeType-0.05.tar.gz -> Font-FreeType-0.06.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/Changes
new/Font-FreeType-0.06/Changes
--- old/Font-FreeType-0.05/Changes 2015-01-27 18:42:23.000000000 +0100
+++ new/Font-FreeType-0.06/Changes 2015-07-17 14:03:28.000000000 +0200
@@ -1,3 +1,9 @@
+0.06 2015-01-27 [email protected]
+ - No changes since 0.06_1
+
+0.06_1 2015-01-27 [email protected]
+ - Allow optionally fallback to missing glyph
+
0.05 2015-01-27 [email protected]
- No changes since 0.05_02
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/FreeType.xs
new/Font-FreeType-0.06/FreeType.xs
--- old/Font-FreeType-0.05/FreeType.xs 2015-01-23 16:55:31.000000000 +0100
+++ new/Font-FreeType-0.06/FreeType.xs 2015-07-13 19:36:00.000000000 +0200
@@ -778,12 +778,12 @@
SV *
-qefft2_face_glyph_from_char_code (Font_FreeType_Face face, FT_ULong char_code)
+qefft2_face_glyph_from_char_code (Font_FreeType_Face face, FT_ULong char_code,
int fallback = 0)
PREINIT:
FT_UInt glyph_idx;
CODE:
glyph_idx = FT_Get_Char_Index(face, char_code);
- if (glyph_idx)
+ if (glyph_idx || fallback)
RETVAL = make_glyph(SvRV(ST(0)), char_code, glyph_idx);
else
RETVAL = &PL_sv_undef;
@@ -792,7 +792,7 @@
SV *
-qefft2_face_glyph_from_char (Font_FreeType_Face face, SV *sv)
+qefft2_face_glyph_from_char (Font_FreeType_Face face, SV *sv, int fallback = 0)
PREINIT:
FT_UInt glyph_idx;
const char *str;
@@ -806,7 +806,8 @@
croak("string has no characters");
char_code = *str;
glyph_idx = FT_Get_Char_Index(face, char_code);
- if (glyph_idx)
+ fallback = SvOK(ST(2)) ? SvIV(ST(2)) : 0;
+ if (glyph_idx || fallback)
RETVAL = make_glyph(SvRV(ST(0)), char_code, glyph_idx);
else
RETVAL = &PL_sv_undef;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/MANIFEST
new/Font-FreeType-0.06/MANIFEST
--- old/Font-FreeType-0.05/MANIFEST 2015-01-23 16:55:31.000000000 +0100
+++ new/Font-FreeType-0.06/MANIFEST 2015-07-13 19:50:45.000000000 +0200
@@ -8,6 +8,7 @@
examples/render-glyph.pl
FreeType.xs
lib/Font/FreeType.pm
+lib/Font/FreeType/BoundingBox.pm
lib/Font/FreeType/CharMap.pm
lib/Font/FreeType/Face.pm
lib/Font/FreeType/Glyph.pm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/META.json
new/Font-FreeType-0.06/META.json
--- old/Font-FreeType-0.05/META.json 2015-01-27 18:44:07.000000000 +0100
+++ new/Font-FreeType-0.06/META.json 2015-07-17 14:04:41.000000000 +0200
@@ -4,7 +4,7 @@
"Geoff Richards <[email protected]>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter
version 2.143240",
+ "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter
version 2.150001",
"license" : [
"perl_5"
],
@@ -45,5 +45,5 @@
"url" : "https://github.com/zmughal/p5-Font-FreeType"
}
},
- "version" : "0.05"
+ "version" : "0.06"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/META.yml
new/Font-FreeType-0.06/META.yml
--- old/Font-FreeType-0.05/META.yml 2015-01-27 18:44:07.000000000 +0100
+++ new/Font-FreeType-0.06/META.yml 2015-07-17 14:04:41.000000000 +0200
@@ -10,7 +10,7 @@
ExtUtils::MakeMaker: '6.64'
File::Which: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version
2.143240'
+generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version
2.150001'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,4 +24,4 @@
perl: '5.008001'
resources:
repository: https://github.com/zmughal/p5-Font-FreeType
-version: '0.05'
+version: '0.06'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/lib/Font/FreeType/BoundingBox.pm
new/Font-FreeType-0.06/lib/Font/FreeType/BoundingBox.pm
--- old/Font-FreeType-0.05/lib/Font/FreeType/BoundingBox.pm 1970-01-01
01:00:00.000000000 +0100
+++ new/Font-FreeType-0.06/lib/Font/FreeType/BoundingBox.pm 2015-06-24
23:25:49.000000000 +0200
@@ -0,0 +1,53 @@
+package Font::FreeType::BoundingBox;
+use warnings;
+use strict;
+
+1;
+
+__END__
+
+=head1 NAME
+
+Font::FreeType::BoundingBox - a structure used to hold an outline's bounding
box
+
+=head1 SYNOPSIS
+
+ use Font::FreeType;
+
+ my $freetype = Font::FreeType->new;
+ my $face = $freetype->face('Vera.ttf');
+ my ($x_min, $y_min, $x_max, $y_max) =
+ ($face->x_min, $face->y_min, $face->x_max, $face->y_max);
+
+=head1 DESCRIPTION
+
+A structure used to hold an outline's bounding box, i.e., the coordinates of
+its extrema in the horizontal and vertical directions.
+
+The bounding box is specified with the coordinates of the lower left and the
+upper right corner. In PostScript, those values are often called (llx,lly)
+and (urx,ury), respectively.
+
+If I<y_min> is negative, this value gives the glyph's descender. Otherwise, the
+glyph doesn't descend below the baseline. Similarly, if I<y_max> is positive,
+this value gives the glyph's ascender.
+
+I<x_min> gives the horizontal distance from the glyph's origin to the left
+edge of the glyph's bounding box. If I<x_min> is negative, the glyph extends
+to the left of the origin.
+
+=head1 METHODS
+
+=over 4
+
+=item x_min
+
+=item y_min
+
+=item x_max
+
+=item y_max
+
+=back
+
+=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/lib/Font/FreeType/Face.pm
new/Font-FreeType-0.06/lib/Font/FreeType/Face.pm
--- old/Font-FreeType-0.05/lib/Font/FreeType/Face.pm 2015-01-23
16:55:31.000000000 +0100
+++ new/Font-FreeType-0.06/lib/Font/FreeType/Face.pm 2015-07-13
19:50:07.000000000 +0200
@@ -106,7 +106,7 @@
For an example see the program I<list-characters.pl> provided in the
distribution.
-=item glyph_from_char(I<character>)
+=item glyph_from_char(I<character>, I<fallback = 0>)
Returns a L<Font::FreeType::Glyph|Font::FreeType::Glyph> object for the
glyph corresponding to the first character in the string provided.
@@ -114,15 +114,19 @@
this, so you might be better using the C<glyph_from_char_code()>
method below and the Perl C<ord> function.
-Returns I<undef> if the glyph is not available in the font.
+Returns I<undef> if the glyph is not available in the font and
+I<fallback> isn't defined; otherwise, i.e. if I<fallback = true>
+returns fonts I<missing glyph>.
-=item glyph_from_char_code(I<char-code>)
+=item glyph_from_char_code(I<char-code>, I<fallback = 0>)
Returns a L<Font::FreeType::Glyph|Font::FreeType::Glyph> object for the
glyph corresponding to Unicode character I<char-code>. FreeType supports
using other character sets, but this module doesn't yet.
-Returns I<undef> if the glyph is not available in the font.
+Returns I<undef> if the glyph is not available in the font and
+I<fallback> isn't defined; otherwise, i.e. if I<fallback = true>
+returns fonts I<missing glyph>.
=item has_glyph_names()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/lib/Font/FreeType.pm
new/Font-FreeType-0.06/lib/Font/FreeType.pm
--- old/Font-FreeType-0.05/lib/Font/FreeType.pm 2015-01-27 18:41:06.000000000
+0100
+++ new/Font-FreeType-0.06/lib/Font/FreeType.pm 2015-07-17 14:02:14.000000000
+0200
@@ -2,7 +2,7 @@
use warnings;
use strict;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
require DynaLoader;
our @ISA = qw( DynaLoader );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Font-FreeType-0.05/t/10metrics_verasans.t
new/Font-FreeType-0.06/t/10metrics_verasans.t
--- old/Font-FreeType-0.05/t/10metrics_verasans.t 2015-01-23
17:17:26.000000000 +0100
+++ new/Font-FreeType-0.06/t/10metrics_verasans.t 2015-07-13
19:38:36.000000000 +0200
@@ -7,7 +7,9 @@
use strict;
use warnings;
-use Test::More tests => 78 + 5 * 2 + 256 * 2;
+use utf8;
+
+use Test::More tests => 78 + 5 * 2 + 256 * 2 + 5;
use File::Spec::Functions;
use Font::FreeType;
@@ -192,4 +194,14 @@
map { $vera->glyph_from_char($_)->index } 'A', 'V');
is($kern_x, -131, "horizontal kerning of 'AV' in scalar context");
+my $missing_glyph = $vera->glyph_from_char('˗');
+is $missing_glyph, undef, "no fallback glyph";
+
+$missing_glyph = $vera->glyph_from_char('˗', 1);
+isnt $missing_glyph, undef, "fallback glyph is defined";
+is $missing_glyph->horizontal_advance, 1229, "missing glyph has horizontal
advance";
+
+is $vera->glyph_from_char_code(ord '˗', 0), undef, "no fallback glyph";
+isnt $vera->glyph_from_char_code(ord '˗', 1), undef, "missing glyph is
defined";
+
# vim:ft=perl ts=4 sw=4 expandtab: