Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/Font-AFM/files/, dev-perl/Font-AFM/
Date: Thu, 17 Sep 2020 01:48:43
Message-Id: 1600307258.1d4c1e9575c0d95a488795974150ffa550d97716.kentnl@gentoo
1 commit: 1d4c1e9575c0d95a488795974150ffa550d97716
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 17 01:47:06 2020 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 17 01:47:38 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d4c1e95
7
8 dev-perl/Font-AFM: -r bump to use urw-fonts instead for tests
9
10 - Add patch allowing use of arbitrary font names and arbitrary metrics
11 - Augment tests and deps to use a font from the urw-fonts pack
12
13 Package-Manager: Portage-3.0.4, Repoman-3.0.1
14 Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org>
15
16 dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild | 30 ++++++++++++++
17 .../files/Font-AFM-1.20-custom-test-font.patch | 46 ++++++++++++++++++++++
18 2 files changed, 76 insertions(+)
19
20 diff --git a/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild b/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild
21 new file mode 100644
22 index 00000000000..b279f82659d
23 --- /dev/null
24 +++ b/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild
25 @@ -0,0 +1,30 @@
26 +# Copyright 1999-2020 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +DIST_AUTHOR=GAAS
32 +DIST_VERSION=1.20
33 +inherit perl-module
34 +
35 +DESCRIPTION="Parse Adobe Font Metric files"
36 +
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~ia64 ~ppc ~sparc ~x86"
39 +IUSE="test"
40 +RESTRICT="!test? ( test )"
41 +BDEPEND="
42 + test? (
43 + media-fonts/urw-fonts
44 + )
45 +"
46 +PATCHES=(
47 + "${FILESDIR}/${PN}-1.20-custom-test-font.patch"
48 +)
49 +src_test() {
50 + # nimbus sans l medium r normal iso8859-1
51 + TEST_FONT="n019003l" \
52 + TEST_FONT_WIDTH="4279" \
53 + METRICS="${EPREFIX}/usr/share/fonts/urw-fonts" \
54 + perl-module_src_test
55 +}
56
57 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
58 new file mode 100644
59 index 00000000000..3e674599c33
60 --- /dev/null
61 +++ b/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch
62 @@ -0,0 +1,46 @@
63 +From 6291356c29004b58b7d0f18ce39738ebc2412ff9 Mon Sep 17 00:00:00 2001
64 +From: Kent Fredric <kentnl@g.o>
65 +Date: Thu, 17 Sep 2020 13:28:34 +1200
66 +Subject: Allow overriding test font name
67 +
68 +This allows us to use helvetica-compatible fonts without needing an
69 +actual font called "Helvetica"
70 +---
71 + t/afm.t | 14 ++++++++++----
72 + 1 file changed, 10 insertions(+), 4 deletions(-)
73 +
74 +diff --git a/t/afm.t b/t/afm.t
75 +index 40addff..60ddcb8 100644
76 +--- a/t/afm.t
77 ++++ b/t/afm.t
78 +@@ -1,7 +1,13 @@
79 + require Font::AFM;
80 +
81 ++my $test_font = $ENV{TEST_FONT};
82 ++my $test_width = $ENV{TEST_FONT_WIDTH};
83 ++
84 ++$test_font = "Helvetica" unless defined $test_font and length $test_font;
85 ++$test_width = 4279 unless defined $test_width and length $test_width;
86 ++
87 + eval {
88 +- $font = Font::AFM->new("Helvetica");
89 ++ $font = Font::AFM->new($test_font);
90 + };
91 + if ($@) {
92 + if ($@ =~ /Can't find the AFM file for/) {
93 +@@ -18,9 +24,9 @@ print "1..1\n";
94 +
95 + $sw = $font->stringwidth("Gisle Aas");
96 +
97 +-if ($sw == 4279) {
98 +- print "ok 1 Stringwith for Helvetica seems to work\n";
99 ++if ($sw == $test_width) {
100 ++ print "ok 1 Stringwith for \"$test_font\"(font) seems to work\n";
101 + } else {
102 +- print "not ok 1 The stringwidth of 'Gisle Aas' should be 4279 (it was $sw)\n";
103 ++ print "not ok 1 The stringwidth of 'Gisle Aas' should be $test_width (it was $sw)\n";
104 + }
105 +
106 +--
107 +2.28.0
108 +