??? 05/30/08 05:41 Read: times Msg Score: +1 +1 Informative |
#155274 - Here is a 9Wx7H Font Responding to: ???'s previous message |
Mahmood:
Here is a bitmap font initializer for you. It's in "C" code but could be very easily converted to assembler source through the use of a robust text editor. If you want lower case you would have to add them since my application did not use lower case characters. The bytes define vertical strokes of pixels from left to right with the LSB of each byte being the lower extreme of each stroke when the character glyphs are read in normal presentation. The MSB of each byte is not used since the font is 7 dots high. The blank font positions in the font (i.e. the lower case character holes) are flagged with the MSB of the first byte being set so those characters can be skipped by your rasterizer routine. If you need the pixels in a bytes = rows format you could write a tool to flop the bitmaps for each character. Michael Karas unsigned char font[][9]={ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 20H SPACE */ {0x00,0x00,0x00,0x00,0x79,0x00,0x00,0x00,0x00}, /* 21H ! */ {0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x70,0x00}, /* 22H " */ {0x14,0x00,0x7F,0x00,0x14,0x00,0x7F,0x00,0x14}, /* 23H # */ {0x10,0x2A,0x80,0x2A,0x55,0x2A,0x00,0x2A,0x04}, /* 24H $ */ {0x60,0x01,0x62,0x04,0x08,0x10,0x23,0x40,0x03}, /* 25H PERCENT */ {0x06,0x09,0x20,0x51,0x08,0x55,0x22,0x01,0x06}, /* 26H & */ {0x00,0x00,0x10,0x60,0x00,0x00,0x00,0x00,0x00}, /* 27H ' */ {0x00,0x00,0x00,0x1C,0x22,0x00,0x41,0x00,0x00}, /* 28H ( */ {0x00,0x00,0x41,0x00,0x22,0x1C,0x00,0x00,0x00}, /* 29H ) */ {0x08,0x00,0x2A,0x14,0x08,0x14,0x2A,0x00,0x08}, /* 2AH * */ {0x08,0x00,0x08,0x00,0x3E,0x00,0x08,0x00,0x08}, /* 2BH + */ {0x00,0x00,0x00,0x0C,0x01,0x0E,0x00,0x00,0x00}, /* 2CH , */ {0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08}, /* 2DH - */ {0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x00,0x00}, /* 2EH . */ {0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x00}, /* 2FH / */ {0x3E,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x3E}, /* 30H 0 */ {0x00,0x10,0x00,0x21,0x00,0x7F,0x00,0x01,0x00}, /* 31H 1 */ {0x21,0x00,0x43,0x00,0x45,0x00,0x49,0x00,0x31}, /* 32H 2 */ {0x42,0x01,0x40,0x01,0x40,0x09,0x50,0x29,0x46}, /* 33H 3 */ {0x04,0x08,0x14,0x20,0x44,0x00,0x0F,0x00,0x04}, /* 34H 4 */ {0x71,0x00,0x51,0x00,0x51,0x00,0x51,0x0A,0x04}, /* 35H 5 */ {0x06,0x09,0x10,0x29,0x40,0x09,0x00,0x09,0x06}, /* 36H 6 */ {0x40,0x00,0x40,0x03,0x44,0x08,0x50,0x20,0x40}, /* 37H 7 */ {0x06,0x29,0x50,0x09,0x40,0x09,0x50,0x29,0x06}, /* 38H 8 */ {0x30,0x48,0x00,0x48,0x01,0x4A,0x04,0x48,0x30}, /* 39H 9 */ {0x00,0x00,0x00,0x36,0x00,0x36,0x00,0x00,0x00}, /* 3AH : */ {0x00,0x00,0x00,0x6C,0x01,0x6E,0x00,0x00,0x00}, /* 3BH ; */ {0x08,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x41}, /* 3CH < */ {0x14,0x00,0x14,0x00,0x14,0x00,0x14,0x00,0x14}, /* 3DH = */ {0x41,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x08}, /* 3EH > */ {0x00,0x20,0x40,0x00,0x45,0x08,0x50,0x20,0x00}, /* 3FH ? */ {0x06,0x29,0x40,0x09,0x40,0x0F,0x40,0x21,0x1E}, /* 40H @ */ {0x07,0x08,0x94,0x20,0x44,0x20,0x14,0x08,0x07}, /* 41H A */ {0x7F,0x00,0x49,0x00,0x49,0x00,0x49,0x30,0x06}, /* 42H B */ {0x00,0x1C,0x22,0x41,0x00,0x41,0x00,0x41,0x22}, /* 43H C */ {0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x22,0x1C}, /* 44H D */ {0x7F,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x41}, /* 45H E */ {0x7F,0x00,0x48,0x00,0x48,0x00,0x48,0x00,0x40}, /* 46H F */ {0x1C,0x22,0x41,0x00,0x49,0x00,0x49,0x00,0x4F}, /* 47H G */ {0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F}, /* 48H H */ {0x00,0x01,0x40,0x01,0x7E,0x01,0x40,0x01,0x00}, /* 49H I */ {0x02,0x01,0x00,0x01,0x00,0x01,0x7E,0x00,0x00}, /* 4AH J */ {0x7F,0x00,0x08,0x00,0x10,0x08,0x24,0x02,0x41}, /* 4BH K */ {0x7F,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01}, /* 4CH L */ {0x7F,0x00,0x20,0x10,0x08,0x10,0x20,0x00,0x7F}, /* 4DH M */ {0x7F,0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x7F}, /* 4EH N */ {0x1C,0x22,0x00,0x41,0x00,0x41,0x00,0x22,0x1C}, /* 4FH O */ {0x00,0x7F,0x00,0x48,0x00,0x48,0x00,0x48,0x30}, /* 50H P */ {0x1C,0x22,0x00,0x41,0x08,0x45,0x02,0x20,0x1D}, /* 51H Q */ {0x00,0x7F,0x00,0x48,0x00,0x48,0x04,0x4A,0x31}, /* 52H R */ {0x32,0x49,0x00,0x49,0x00,0x49,0x00,0x49,0x26}, /* 53H S */ {0x40,0x00,0x40,0x00,0x7F,0x00,0x40,0x00,0x40}, /* 54H T */ {0x7C,0x02,0x01,0x00,0x01,0x00,0x01,0x02,0x7C}, /* 55H U */ {0x70,0x08,0x04,0x02,0x01,0x02,0x04,0x08,0x70}, /* 56H V */ {0x7E,0x01,0x02,0x04,0x08,0x04,0x02,0x01,0x7E}, /* 57H W */ {0x00,0x41,0x22,0x14,0x08,0x14,0x22,0x41,0x00}, /* 58H X */ {0x40,0x20,0x10,0x08,0x07,0x08,0x10,0x20,0x40}, /* 59H Y */ {0x00,0x41,0x02,0x45,0x08,0x51,0x20,0x41,0x00}, /* 5AH Z */ {0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x41,0x00}, /* 5BH [ */ {0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00}, /* 5CH REVERSE SLASH */ {0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7F,0x00}, /* 5DH ] */ {0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04}, /* 5EH UP ARROW */ {0x7F,0x00,0x7F,0x00,0x7F,0x00,0x7F,0x00,0x7F}, /* 5FH BOX MARK */ {0x00,0x00,0x00,0x00,0x00,0x60,0x10,0x00,0x00}, /* 60H GRAVE ACCENT */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 61H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 62H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 63H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 64H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 65H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 66H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 67H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 68H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 69H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6AH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6BH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6CH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6DH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6EH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 6FH */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 70H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 71H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 72H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 73H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 74H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 75H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 76H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 77H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 78H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 79H */ {0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* 7AH */ {0x00,0x08,0x00,0x36,0x41,0x00,0x41,0x00,0x00}, /* 7BH OPEN BRACE */ {0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00}, /* 7CH VERTICAL LINE */ {0x00,0x00,0x41,0x00,0x41,0x36,0x00,0x08,0x00}, /* 7DH CLOSE BRACE */ {0x08,0x10,0x00,0x10,0x08,0x04,0x00,0x04,0x08}, /* 7EH TILDE */ {0x44,0x08,0x11,0x22,0x44,0x08,0x11,0x22,0x44}};/* 7FH DELETE */ |