File: hardcode-default-font

package info (click to toggle)
libsdl-perl 2.548-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 5,904 kB
  • sloc: perl: 13,985; ansic: 582; makefile: 35
file content (101 lines) | stat: -rw-r--r-- 2,860 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Description: Hardcode default font
 upstream SDL delivers a default font for SDLx::Text. This font is
 provided by package fonts-sil-gentium-basic in Debian. This patch
 hardcodes the default font path and remove the dependency on
 File::ShareDir which is no longer required.
Bug-Debian: #682338
Forwarded: no
Author: dod
--- a/lib/SDLx/Text.pm
+++ b/lib/SDLx/Text.pm
@@ -18,11 +18,8 @@
 	unless ( SDL::Config->has('SDL_ttf') ) {
 		Carp::cluck("SDL_ttf support has not been compiled");
 	}  
-	my $file = $options{'font'};
-    if (!$file) {
-        require File::ShareDir;
-        $file = File::ShareDir::dist_file('SDL', 'GenBasR.ttf');
-    }
+	my $file = $options{'font'}
+	         || '/usr/share/fonts/truetype/gentium-basic/GenBasR.ttf';
 
 	my $color = defined $options{'color'} ? $options{'color'} : [255, 255, 255];
 
--- a/Build.PL
+++ b/Build.PL
@@ -571,7 +571,6 @@
 		'ExtUtils::CBuilder' => '0.260301',
 		'Alien::SDL'         => '1.446',
 		'File::Find'         => '0',
-		'File::ShareDir'     => '1.0',
 		'Tie::Simple'        => '0',
 		"Module::Build"      => '0.40',
 		'Capture::Tiny'      => '0',
@@ -582,14 +581,12 @@
 		'Test::Most'        => '0.21',
 		'Alien::SDL'        => '1.446',
 		'File::Find'        => '0',
-		'File::ShareDir'    => '1.0',
 		'Tie::Simple'       => '0',
 		'Scalar::Util'      => '0',
 	},
 	requires => {
 		'Scalar::Util'   => '0',
 		'Tie::Simple'    => '0',
-		'File::ShareDir' => '1.0',
 		'CPAN'           => '1.92',
 		'perl'           => '5.008000',
 	},
--- a/META.json
+++ b/META.json
@@ -20,7 +20,6 @@
             "Capture::Tiny" : "0",
             "ExtUtils::CBuilder" : "0",
             "File::Find" : "0",
-            "File::ShareDir" : "1.0",
             "Scalar::Util" : "0",
             "Test::Most" : "0.21",
             "Test::Simple" : "0.88",
@@ -33,7 +32,6 @@
             "Capture::Tiny" : "0",
             "ExtUtils::CBuilder" : "0.260301",
             "File::Find" : "0",
-            "File::ShareDir" : "1.0",
             "Module::Build" : "0.40",
             "Tie::Simple" : "0"
          }
@@ -41,7 +39,6 @@
       "runtime" : {
          "requires" : {
             "CPAN" : "1.92",
-            "File::ShareDir" : "1.0",
             "Scalar::Util" : "0",
             "Tie::Simple" : "0",
             "perl" : "5.008000"
--- a/META.yml
+++ b/META.yml
@@ -7,7 +7,6 @@
   Capture::Tiny: '0'
   ExtUtils::CBuilder: '0'
   File::Find: '0'
-  File::ShareDir: '1.0'
   Scalar::Util: '0'
   Test::Most: '0.21'
   Test::Simple: '0.88'
@@ -17,7 +16,6 @@
   Capture::Tiny: '0'
   ExtUtils::CBuilder: '0.260301'
   File::Find: '0'
-  File::ShareDir: '1.0'
   Module::Build: '0.40'
   Tie::Simple: '0'
 dynamic_config: 1
@@ -273,7 +271,6 @@
     version: '2.548'
 requires:
   CPAN: '1.92'
-  File::ShareDir: '1.0'
   Scalar::Util: '0'
   Tie::Simple: '0'
   perl: '5.008000'