Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/filter/font2.c
blob: ed57f500546090e4a76b7788d98c1194d0306201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "xfont16.c"

// Doubles the xfont16 font for a bigger output of font (xfont32)
// By Zoltan Kovacs <kovzol@particio.com>, 2006-04-25

// Compile it with "gcc -o font2 font2.c" and then run it with
// "./font2 > xfont32.c; indent xfont32.c".

main()
{
    int a, b, i, j, k;
    printf("#include <config.h>\nCONST unsigned char xfont32[] = {\n");

    for (i = 0; i < 256; ++i)	// 256 characters
    {
	for (j = 0; j < 16; ++j)	// 16 lines vertically
	{
	    a = xfont16[i * 16 + j];	// 8 bits of graphics read
	    b = 0;		// this will be the output
	    for (k = 0; k < 8; ++k) {
		b /= 4;
		if (a % 2 == 1)	// if the most right bit is set
		    b += 49152;	// the the output will be also set, twice
		a /= 2;
	    }
	    printf("0x%x, 0x%x, 0x%x, 0x%x", (b / 256), (b % 256),
		   (b / 256), (b % 256));
	    if (!(i == 255 && j == 15))
		printf(", ");
	}			// end of character
	printf("\n");
    }
    printf("};\n");

}