diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-08-24 09:38:26 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-08-24 09:38:26 +0000 |
commit | c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e (patch) | |
tree | ee105d8281e3ff8ed03bbbbc32eaa7e2c5378609 /tools | |
parent | e8cad94e3c944e4acfeac7157eb9a06db92634d7 (diff) | |
download | rockbox-c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e.tar.gz rockbox-c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e.zip |
exclude fonts from the zip file that are larger than the maximum size we can
load with this firmware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5011 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildzip.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 9d7af3db40..ce9188f6fd 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -1,5 +1,13 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
2 | 2 | ||
3 | sub filesize { | ||
4 | my ($filename)=@_; | ||
5 | my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, | ||
6 | $atime,$mtime,$ctime,$blksize,$blocks) | ||
7 | = stat($filename); | ||
8 | return $size; | ||
9 | } | ||
10 | |||
3 | sub buildlangs { | 11 | sub buildlangs { |
4 | my ($outputlang)=@_; | 12 | my ($outputlang)=@_; |
5 | my $dir = "../apps/lang"; | 13 | my $dir = "../apps/lang"; |
@@ -54,6 +62,16 @@ sub buildzip { | |||
54 | my @fonts = grep { /\.bdf$/ && -f "../fonts/$_" } readdir(DIR); | 62 | my @fonts = grep { /\.bdf$/ && -f "../fonts/$_" } readdir(DIR); |
55 | closedir DIR; | 63 | closedir DIR; |
56 | 64 | ||
65 | my $maxfont; | ||
66 | open(HEADER, "<../firmware/export/font.h"); | ||
67 | while(<HEADER>) { | ||
68 | if(/^\#define MAX_FONT_SIZE[ \t]*(\d+)/) { | ||
69 | $maxfont = $1; | ||
70 | } | ||
71 | } | ||
72 | close(HEADER); | ||
73 | die "no decent max font size" if ($maxfont < 2000); | ||
74 | |||
57 | for(@fonts) { | 75 | for(@fonts) { |
58 | my $f = $_; | 76 | my $f = $_; |
59 | 77 | ||
@@ -63,6 +81,14 @@ sub buildzip { | |||
63 | my $cmd ="../tools/convbdf -s 32 -l 255 -f -o \".rockbox/fonts/$o\" \"../fonts/$f\" >/dev/null 2>&1"; | 81 | my $cmd ="../tools/convbdf -s 32 -l 255 -f -o \".rockbox/fonts/$o\" \"../fonts/$f\" >/dev/null 2>&1"; |
64 | print "CMD: $cmd\n" if($verbose); | 82 | print "CMD: $cmd\n" if($verbose); |
65 | `$cmd`; | 83 | `$cmd`; |
84 | |||
85 | # no need to add fonts we cannot load anyway | ||
86 | my $fontsize = filesize(".rockbox/fonts/$o"); | ||
87 | print STDERR "$maxfont $fontsize $o\n"; | ||
88 | if($fontsize > $maxfont) { | ||
89 | print STDERR "unlink\n"; | ||
90 | unlink(".rockbox/fonts/$o"); | ||
91 | } | ||
66 | } | 92 | } |
67 | 93 | ||
68 | if($image) { | 94 | if($image) { |