Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4187 → Rev 4186

/trunk/contrib/font/bdf2c.pl
101,14 → 101,12
 
@chars = sort { $a <=> $b } (@chars);
 
print "#define FONT_GLYPHS " . (@chars + 1). "\n";
print "#define FONT_GLYPHS " . @chars . "\n";
print "#define FONT_SCANLINES " . $height . "\n";
 
print "\n";
print "index_t fb_font_glyph(const wchar_t ch)\n";
print "{\n";
print "\tif (ch == 0x0000)\n";
print "\t\treturn 0;\n\n";
print "{";
 
my $pos = 0;
my $start = -1;
119,12 → 117,11
if ($start != -1) {
if ($start == $prev) {
printf "\tif (ch == 0x%.4x)\n", $start;
print "\t\treturn " . $start_pos . ";\n";
} else {
printf "\tif ((ch >= 0x%.4x) && (ch <= 0x%.4x))\n", $start, $prev;
print "\t\treturn (ch - " . ($start - $start_pos) . ");\n";
}
print "\t\treturn (ch - " . ($start - $start_pos) . ");\n";
print "\t\n";
}
131,18 → 128,19
$start = $index;
$start_pos = $pos;
}
$pos++;
$prev = $index;
}
 
print "\treturn " . @chars . ";\n";
print "\treturn 31;\n";
print "}\n";
 
print "\n";
print "uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES] = {";
 
my $f1 = 0;
for $index (@chars) {
print "," if ($f1 > 0);
print "\n\t{";
my $y;
151,14 → 149,8
printf "0x%.2x", $glyphs[$index]->[$y];
}
print "},";
print "}";
$f1++;
}
 
print "\n\t\n\t/* Special glyph for unknown character */\n\t{";
my $y;
for ($y = 0; $y < $height; $y++) {
print ", " if ($y > 0);
printf "0x%.2x", $glyphs[63]->[$y];
}
 
print "}\n};\n";
print "\n};\n";