1 /* $NetBSD: dumpfont.c,v 1.5 1994/10/26 02:06:57 cgd Exp $ */
4 * This is a *real* hack to dump the topaz80 kernel font. This one is
5 * ways nicer than the ugly Mach font, but we'll have to dump it from a
6 * running system to not run against Commodore copyrights. *NEVER* distribute
7 * the generated font with BSD, always regenerate!
10 #include <exec/types.h>
11 #include <exec/memory.h>
13 #include <graphics/gfx.h>
14 #include <graphics/rastport.h>
15 #include <graphics/text.h>
17 #include <inline/exec.h>
18 #include <inline/graphics.h>
25 unsigned char str
[256], *pp
;
27 struct TextAttr ta
= { "topaz.font", 8, FS_NORMAL
, FPF_ROMFONT
};
29 struct BitMap bm
= { 256, /* bytes per row */
39 bm
.Planes
[0] = pp
= AllocRaster (256 * 8, 8);
43 fprintf (stderr
, "Can't allocate raster!\n");
51 fprintf (stderr
, "can't open topaz font.\n");
57 /* initialize string to be printed */
58 for (i
= 32; i
< 256; i
++) str
[i
- 32] = i
;
62 Text (&rp
, str
, 256 - 32);
64 int bin
= open ("bitmap", 1);
67 write (bin
, pp
, 256*8);
73 printf ("/* generated automatically by dumpfont.c. *DONT* distribute\n");
74 printf (" this file, it contains information Copyright by Commodore!\n");
76 printf (" This is the (new) topaz80 system font: */\n\n");
78 printf ("unsigned char kernel_font_width = 8;\n");
79 printf ("unsigned char kernel_font_height = 8;\n");
80 printf ("unsigned char kernel_font_lo = 32;\n");
81 printf ("unsigned char kernel_font_hi = 255;\n\n");
83 printf ("unsigned char kernel_cursor[] = {\n");
84 printf (" 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };\n\n");
85 printf ("unsigned char kernel_font[] = {\n");
87 for (i
= 0; i
< 256 - 32; i
++)
89 printf( "/* %c */ ", i
+ 32);
90 printf( "0x%02x, 0x%02x, 0x%02x, 0x%02x, "
91 "0x%02x, 0x%02x, 0x%02x, 0x%02x,\n",
92 pp
[i
+0*256], pp
[i
+1*256], pp
[i
+2*256], pp
[i
+3*256],
93 pp
[i
+4*256], pp
[i
+5*256], pp
[i
+6*256], pp
[i
+7*256]);
98 FreeRaster (pp
, 256 * 8, 8);