- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfont.c
More file actions
Latest commit
20 lines (17 loc) · 632 Bytes
/
Copy pathfont.c
File metadata and controls
20 lines (17 loc) · 632 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
externvoiddraw_pixel(intx, inty, unsigned intcolor);
// 8x8 ASCII font matrix table (256 characters x 8 bytes)
externconstunsigned charfont8x8[256][8];
voiddraw_char(intx, inty, charc, unsigned intcolor) {
for (introw=0; row<8; row++) {
for (intcol=0; col<8; col++) {
if ((font8x8[(unsigned char)c][row] >> (7-col)) &1) {
draw_pixel(x+col, y+row, color);
}
}
}
}
voiddraw_string(intx, inty, constchar*str, unsigned intcolor) {
for (inti=0; str[i] !='\0'; i++) {
draw_char(x+ (i*8), y, str[i], color);
}
}