From 53fb6eea070aee6026baa8348fc0f80f33791317 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sat, 18 Jun 2011 21:53:19 +0200 Subject: [PATCH] Add more error messages for debugging --- tools/makefont.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/makefont.pl b/tools/makefont.pl index f6c7cfd..aada3f9 100755 --- a/tools/makefont.pl +++ b/tools/makefont.pl @@ -90,7 +90,7 @@ print "Writing $title to ${file}.c\n"; $heightb=int(($heightpx-1)/8)+1; # Round up print "Chars are ",$heightpx,"px ($heightb bytes) high\n"; -open (C,">",$file.".c")||die; +open (C,">",$file.".c")||die "Can't create $file.c: $!"; if(defined $licence){ $licence=~s/\n/\n * /g; @@ -261,7 +261,7 @@ printf C " */\n"; close(C); -open (H,">",$file.".h")||die; +open (H,">",$file.".h")||die "Can't create $file.h: $!"; print H <"); my($bb); - open($bdf,"<",$font) || die; + open($bdf,"<",$font) || die "Can't open $font: $!"; while(<$bdf>){ chomp; @@ -620,6 +620,10 @@ sub init_ttf { ($mx,$my)=($bounds[2],$bounds[3]); ($top,$bottom)=($bounds[7],$my); + if(!defined $mx){ + die "GD::Image failed: $@\n"; + }; + die "Increase width" if $mx>$width; die "Increase height" if $my>$width; die "Increase xoff" if $bounds[7]<0;