unifont-8.0.01.tar.gz
[unifont.git] / src / hex2bdf
index 7f600e3c8f9bfbd20aee46a32dcb95f0be2325b2..5255120e75587b0207131909035b5aee9880b8df 100755 (executable)
@@ -32,7 +32,7 @@ $result = GetOptions (
              );
 
 if (not $font_name) {
-   $font_name = "unifont";
+   $font_name = "Unifont";
 }
 if (not $vpixels) {
    $vpixels  = 16;
@@ -44,10 +44,11 @@ if (not $version) {
 $point_size   = $vpixels;
 $point_size10 = 10 * $point_size;
 
-while (<>) { chomp; $glyph{$1} = $2 if /(....):(.+)/; }
+while (<>) { chomp; $glyph{$1} = $2 if /^([0-9a-fA-F]+):([0-9a-fA-F]+)/; }
 @chars = sort keys %glyph;
 $nchars = $#chars + 1;
 
+
 print "STARTFONT 2.1
 FONT -gnu-${font_name}-Medium-R-Normal-Sans-${vpixels}-${point_size10}-75-75-c-80-iso10646-1
 SIZE $point_size 75 75
@@ -70,15 +71,15 @@ SPACING \"C\"
 AVERAGE_WIDTH 80
 CHARSET_REGISTRY \"ISO10646\"
 CHARSET_ENCODING \"1\"
-FONT_ASCENT 14
-FONT_DESCENT 2
 UNDERLINE_POSITION -2
 UNDERLINE_THICKNESS 1
 CAP_HEIGHT 10
 X_HEIGHT 8
+FONT_ASCENT 14
+FONT_DESCENT 2
 DEFAULT_CHAR 65533
 ENDPROPERTIES
-CHARS $nchars\n";
+CHARS $nchars\n" or die ("Cannot print to stdout.\n");
 
 # TODO: $swidth needs to be modified to accomodate different widths better
 #       for glyphs with height different than 16 pixels.
@@ -100,7 +101,7 @@ SWIDTH $swidth 0
 DWIDTH $dwidth 0
 BBX $dwidth $vpixels 0 -2
 BITMAP $glyph
-ENDCHAR\n";
+ENDCHAR\n" or die ("Cannot print to stdout.\n");
 }
 
-print "ENDFONT\n";
+print "ENDFONT\n" or die ("Cannot print to stdout.\n");