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.zip rockbox-c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e.tar.gz rockbox-c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e.tar.bz2 rockbox-c4d463bd7c2ecb2c52fcb30aebfe1565a042a23e.tar.xz | |
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 9d7af3d..ce9188f 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl @@ -1,5 +1,13 @@ #!/usr/bin/perl +sub filesize { + my ($filename)=@_; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) + = stat($filename); + return $size; +} + sub buildlangs { my ($outputlang)=@_; my $dir = "../apps/lang"; @@ -54,6 +62,16 @@ sub buildzip { my @fonts = grep { /\.bdf$/ && -f "../fonts/$_" } readdir(DIR); closedir DIR; + my $maxfont; + open(HEADER, "<../firmware/export/font.h"); + while(<HEADER>) { + if(/^\#define MAX_FONT_SIZE[ \t]*(\d+)/) { + $maxfont = $1; + } + } + close(HEADER); + die "no decent max font size" if ($maxfont < 2000); + for(@fonts) { my $f = $_; @@ -63,6 +81,14 @@ sub buildzip { my $cmd ="../tools/convbdf -s 32 -l 255 -f -o \".rockbox/fonts/$o\" \"../fonts/$f\" >/dev/null 2>&1"; print "CMD: $cmd\n" if($verbose); `$cmd`; + + # no need to add fonts we cannot load anyway + my $fontsize = filesize(".rockbox/fonts/$o"); + print STDERR "$maxfont $fontsize $o\n"; + if($fontsize > $maxfont) { + print STDERR "unlink\n"; + unlink(".rockbox/fonts/$o"); + } } if($image) { |