File: Makefile.PL

package info (click to toggle)
libfont-freetype-perl 0.03-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 648 kB
  • ctags: 11
  • sloc: perl: 335; makefile: 3
file content (36 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (2)
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
use ExtUtils::MakeMaker;
use File::Spec::Functions;

WriteMakefile(
    NAME            => 'Font::FreeType',
    AUTHOR          => 'Geoff Richards <qef@laxan.com>',
    VERSION_FROM    => 'lib/Font/FreeType.pm',
    LIBS            => [ '-lfreetype' ],
    INC             => '-I/usr/include/freetype2',
    NO_META         => 1,
);


# Generate a listing of the characters in the BDF test font, for checking
# that the library can find them all.  See t/10metrics_5x7bdf.t
my $data_dir = catdir(qw( t data ));
my $font_filename = catfile($data_dir, '5x7.bdf');
open my $font_file, '<', $font_filename
  or die "error opening BDF font '$font_filename': $!";
my $list_filename = catfile($data_dir, 'bdf_glyphs.txt');
open my $list_file, '>', $list_filename
  or die "error opening glyph listing file '$list_filename': $!";
my $name;
while (<$font_file>) {
    if (/^STARTCHAR\s+(.*)$/) {
        $name = $1;
        next;
    }
    elsif (/ENCODING\s+(\d+)$/) {
        die "BDF file is broken" unless defined $name;
        printf $list_file "%04X\t$name\n", $1;
        $name = undef;
    }
}

# vi:ts=4 sw=4 expandtab: