Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4186 → Rev 4187

/trunk/contrib/font/bdf2c.pl
101,12 → 101,14
 
@chars = sort { $a <=> $b } (@chars);
 
print "#define FONT_GLYPHS " . @chars . "\n";
print "#define FONT_GLYPHS " . (@chars + 1). "\n";
print "#define FONT_SCANLINES " . $height . "\n";
 
print "\n";
print "index_t fb_font_glyph(const wchar_t ch)\n";
print "{";
print "{\n";
print "\tif (ch == 0x0000)\n";
print "\t\treturn 0;\n\n";
 
my $pos = 0;
my $start = -1;
117,11 → 119,12
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";
}
128,19 → 131,18
$start = $index;
$start_pos = $pos;
}
$pos++;
$prev = $index;
}
 
print "\treturn 31;\n";
print "\treturn " . @chars . ";\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;
149,8 → 151,14
printf "0x%.2x", $glyphs[$index]->[$y];
}
print "}";
$f1++;
print "},";
}
 
print "\n};\n";
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";
/trunk/kernel/genarch/include/fb/font-8x16.h
35,7 → 35,7
#ifndef KERN_FONT_8X16_H_
#define KERN_FONT_8X16_H_
 
#define FONT_GLYPHS 2898
#define FONT_GLYPHS 2899
#define FONT_WIDTH 8
#define FONT_SCANLINES 16
 
/trunk/kernel/genarch/src/fb/fb.c
77,6 → 77,7
 
#define BG_COLOR 0x000080
#define FG_COLOR 0xffff00
#define INV_COLOR 0xaaaaaa
 
#define CURSOR 0x2588
 
344,6 → 345,13
uint16_t glyph;
for (glyph = 0; glyph < FONT_GLYPHS; glyph++) {
uint32_t fg_color;
if (glyph == FONT_GLYPHS - 1)
fg_color = INV_COLOR;
else
fg_color = FG_COLOR;
unsigned int y;
for (y = 0; y < FONT_SCANLINES; y++) {
353,7 → 361,7
void *dst = &glyphs[GLYPH_POS(glyph, y) +
x * pixelbytes];
uint32_t rgb = (fb_font[glyph][y] &
(1 << (7 - x))) ? FG_COLOR : BG_COLOR;
(1 << (7 - x))) ? fg_color : BG_COLOR;
rgb_conv(dst, rgb);
}
}
/trunk/kernel/genarch/src/fb/font-8x16.c
66,22 → 66,22
return (ch - 104);
if (ch == 0x02ee)
return (ch - 120);
return 630;
if ((ch >= 0x0300) && (ch <= 0x0301))
return (ch - 137);
if (ch == 0x0303)
return (ch - 138);
return 633;
if (ch == 0x0309)
return (ch - 143);
return 634;
if ((ch >= 0x0312) && (ch <= 0x0314))
return (ch - 151);
if (ch == 0x0323)
return (ch - 165);
return 638;
if ((ch >= 0x0340) && (ch <= 0x0341))
return (ch - 193);
90,16 → 90,16
return (ch - 243);
if (ch == 0x037a)
return (ch - 247);
return 643;
if (ch == 0x037e)
return (ch - 250);
return 644;
if ((ch >= 0x0384) && (ch <= 0x038a))
return (ch - 255);
if (ch == 0x038c)
return (ch - 256);
return 652;
if ((ch >= 0x038e) && (ch <= 0x03a1))
return (ch - 257);
156,13 → 156,13
return (ch - 343);
if (ch == 0x060c)
return (ch - 366);
return 1182;
if (ch == 0x061b)
return (ch - 380);
return 1183;
if (ch == 0x061f)
return (ch - 383);
return 1184;
if ((ch >= 0x0621) && (ch <= 0x063a))
return (ch - 384);
180,19 → 180,19
return (ch - 403);
if (ch == 0x10d3)
return (ch - 2919);
return 1388;
if (ch == 0x10d7)
return (ch - 2922);
return 1389;
if (ch == 0x10da)
return (ch - 2924);
return 1390;
if (ch == 0x10dd)
return (ch - 2926);
return 1391;
if (ch == 0x10e6)
return (ch - 2934);
return 1392;
if ((ch >= 0x1e00) && (ch <= 0x1e9b))
return (ch - 6287);
213,7 → 213,7
return (ch - 6554);
if (ch == 0x2070)
return (ch - 6588);
return 1716;
if ((ch >= 0x2074) && (ch <= 0x208f))
return (ch - 6591);
234,19 → 234,19
return (ch - 6735);
if (ch == 0x2300)
return (ch - 6749);
return 2211;
if (ch == 0x2302)
return (ch - 6750);
return 2212;
if ((ch >= 0x2308) && (ch <= 0x230b))
return (ch - 6755);
if (ch == 0x2310)
return (ch - 6759);
return 2217;
if (ch == 0x2318)
return (ch - 6766);
return 2218;
if ((ch >= 0x231a) && (ch <= 0x231b))
return (ch - 6767);
261,7 → 261,7
return (ch - 6890);
if (ch == 0x23ce)
return (ch - 6906);
return 2260;
if ((ch >= 0x2409) && (ch <= 0x240d))
return (ch - 6964);
270,7 → 270,7
return (ch - 6985);
if (ch == 0x2426)
return (ch - 6986);
return 2268;
if ((ch >= 0x2500) && (ch <= 0x2595))
return (ch - 7203);
288,13 → 288,13
return (ch - 7225);
if (ch == 0x2620)
return (ch - 7237);
return 2523;
if (ch == 0x2622)
return (ch - 7238);
return 2524;
if (ch == 0x2626)
return (ch - 7241);
return 2525;
if ((ch >= 0x2628) && (ch <= 0x262b))
return (ch - 7242);
327,7 → 327,7
return (ch - 61890);
if (ch == 0xfc90)
return (ch - 61934);
return 2722;
if ((ch >= 0xfcf2) && (ch <= 0xfcf4))
return (ch - 62031);
336,7 → 336,7
return (ch - 62102);
if (ch == 0xfdf2)
return (ch - 62280);
return 2730;
if ((ch >= 0xfe50) && (ch <= 0xfe52))
return (ch - 62373);
351,15 → 351,15
return (ch - 62379);
if (ch == 0xfe74)
return (ch - 62380);
return 2760;
if ((ch >= 0xfe76) && (ch <= 0xfefc))
return (ch - 62381);
if (ch == 0xfeff)
return (ch - 62383);
return 2896;
return 31;
return 2898;
}
 
uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES] = {
3260,7 → 3260,10
{0x00, 0x00, 0x42, 0x22, 0x12, 0x0a, 0x04, 0x0c, 0x12, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x22, 0x12, 0x12, 0x0a, 0x0a, 0x0e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0xf1, 0x35, 0x55, 0x8a, 0xe0, 0x06, 0x95, 0xd6, 0xb5, 0x97, 0x00, 0xee, 0x8a, 0xee, 0x28, 0xe8},
{0x00, 0x38, 0x7c, 0x7c, 0xc6, 0x92, 0xf2, 0xe6, 0xfe, 0xe6, 0x7c, 0x7c, 0x38, 0x00, 0x00, 0x00}
{0x00, 0x38, 0x7c, 0x7c, 0xc6, 0x92, 0xf2, 0xe6, 0xfe, 0xe6, 0x7c, 0x7c, 0x38, 0x00, 0x00, 0x00},
/* Special glyph for unknown character */
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}
};
 
/** @}