From 8b4ace9c50842c5b83401ea7b179dcab940387e1 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 23 Sep 2020 10:22:15 +0100 Subject: gentoo resync : 23.09.2020 --- .../files/Font-AFM-1.20-custom-test-font.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch (limited to 'dev-perl/Font-AFM/files') diff --git a/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch b/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch new file mode 100644 index 000000000000..3e674599c33f --- /dev/null +++ b/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch @@ -0,0 +1,46 @@ +From 6291356c29004b58b7d0f18ce39738ebc2412ff9 Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Thu, 17 Sep 2020 13:28:34 +1200 +Subject: Allow overriding test font name + +This allows us to use helvetica-compatible fonts without needing an +actual font called "Helvetica" +--- + t/afm.t | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/t/afm.t b/t/afm.t +index 40addff..60ddcb8 100644 +--- a/t/afm.t ++++ b/t/afm.t +@@ -1,7 +1,13 @@ + require Font::AFM; + ++my $test_font = $ENV{TEST_FONT}; ++my $test_width = $ENV{TEST_FONT_WIDTH}; ++ ++$test_font = "Helvetica" unless defined $test_font and length $test_font; ++$test_width = 4279 unless defined $test_width and length $test_width; ++ + eval { +- $font = Font::AFM->new("Helvetica"); ++ $font = Font::AFM->new($test_font); + }; + if ($@) { + if ($@ =~ /Can't find the AFM file for/) { +@@ -18,9 +24,9 @@ print "1..1\n"; + + $sw = $font->stringwidth("Gisle Aas"); + +-if ($sw == 4279) { +- print "ok 1 Stringwith for Helvetica seems to work\n"; ++if ($sw == $test_width) { ++ print "ok 1 Stringwith for \"$test_font\"(font) seems to work\n"; + } else { +- print "not ok 1 The stringwidth of 'Gisle Aas' should be 4279 (it was $sw)\n"; ++ print "not ok 1 The stringwidth of 'Gisle Aas' should be $test_width (it was $sw)\n"; + } + +-- +2.28.0 + -- cgit v1.2.3