2015-12-30 01:41 PM
I am working on my final year project and i have to change font of my display on LCD..
Only available fonts in library are 4Font16x24Font12x12Font8x12Font8x8i thought of creating my own font files but could not understand how these asciis are writtenconst uint16_t ASCII8x8_Table [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0xfe, 0x48, 0xfc, 0x48, 0x48, 0x38, 0x54, 0x50, 0x38, 0x14, 0x14, 0x54, 0x38, 0x44, 0xa8, 0xa8, 0x50, 0x14, 0x1a, 0x2a, 0x24, 0x10, 0x28, 0x28, 0x10, 0x74, 0x4c, 0x4c, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00, 0x24, 0x18, 0x3c, 0x18, 0x24, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x20, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x08, 0x18, 0x28, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x44, 0x00, 0x04, 0x08, 0x10, 0x20, 0x7c, 0x18, 0x24, 0x04, 0x18, 0x04, 0x04, 0x24, 0x18, 0x04, 0x0c, 0x14, 0x24, 0x44, 0x7e, 0x04, 0x04, 0x3c, 0x20, 0x20, 0x38, 0x04, 0x04, 0x24, 0x18, 0x18, 0x24, 0x20, 0x38, 0x24, 0x24, 0x24, 0x18, 0x3c, 0x04, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, 0x18, 0x24, 0x24, 0x18, 0x24, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x24, 0x1c, 0x04, 0x24, 0x18, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x04, 0x18, 0x20, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x20, 0x18, 0x04, 0x18, 0x20, 0x00, 0x18, 0x24, 0x04, 0x08, 0x10, 0x10, 0x00, 0x10, 0x3c, 0x42, 0x99, 0xa5, 0xa5, 0x9d, 0x42, 0x38, 0x38, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x44, 0x78, 0x1c, 0x22, 0x42, 0x40, 0x40, 0x42, 0x22, 0x1c, 0x70, 0x48, 0x44, 0x44, 0x44, 0x44, 0x48, 0x70, 0x7c, 0x40, 0x40, 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x3c, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x22, 0x42, 0x40, 0x4e, 0x42, 0x22, 0x1c, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x44, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x04, 0x04, 0x04, 0x04, 0x04, 0x24, 0x24, 0x18, 0x44, 0x48, 0x50, 0x70, 0x50, 0x48, 0x48, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x82, 0xc6, 0xc6, 0xaa, 0xaa, 0xaa, 0xaa, 0x92, 0x42, 0x62, 0x52, 0x52, 0x4a, 0x4a, 0x46, 0x42, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x2c, 0x1a, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x42, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x44, 0x38, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x44, 0x44, 0x28, 0x28, 0x28, 0x28, 0x28, 0x10, 0x92, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x04, 0x08, 0x10, 0x10, 0x20, 0x40, 0x7c, 0x1c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1c, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1c, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x04, 0x1c, 0x24, 0x24, 0x1c, 0x20, 0x20, 0x28, 0x34, 0x24, 0x24, 0x34, 0x28, 0x00, 0x00, 0x18, 0x24, 0x20, 0x20, 0x24, 0x18, 0x04, 0x04, 0x14, 0x2c, 0x24, 0x24, 0x2c, 0x14, 0x00, 0x00, 0x18, 0x24, 0x3c, 0x20, 0x24, 0x18, 0x00, 0x18, 0x10, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00, 0x18, 0x24, 0x24, 0x18, 0x04, 0x24, 0x18, 0x20, 0x20, 0x28, 0x34, 0x24, 0x24, 0x24, 0x24, 0x10, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x28, 0x10, 0x20, 0x20, 0x24, 0x28, 0x30, 0x28, 0x24, 0x24, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0xa6, 0xda, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x28, 0x34, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x28, 0x34, 0x24, 0x38, 0x20, 0x20, 0x20, 0x00, 0x14, 0x2c, 0x24, 0x1c, 0x04, 0x04, 0x04, 0x00, 0x00, 0x2c, 0x30, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x18, 0x24, 0x10, 0x08, 0x24, 0x18, 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x10, 0x18, 0x00, 0x00, 0x24, 0x24, 0x24, 0x24, 0x2c, 0x14, 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x28, 0x10, 0x00, 0x00, 0x92, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, 0x00, 0x00, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x3c, 0x04, 0x08, 0x10, 0x20, 0x3c, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x08, 0x08, 0x04, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x60, 0x92, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; so somebody please guide me so that i cld proceed..2015-01-02 08:15 AM
2015-01-02 09:10 AM
You need to think of the pixels represented as binary
0xAC4 1010 1100 0100 11001100 11110000 00110000 ; Double up bits in row, and repeat 11001100 11110000 00110000 0xCCF030 0xCCF0302015-01-02 04:11 PM
Thank you clive..
i am really grateful..Now I have to bold letters but in library there is no function of bold..so can u help me with the routine of bolding the letters..How should i BOLD..??2015-01-02 06:21 PM
You could try doing an overlaid print where the second printing is one pixel shifted to the right, or right-one, down-one
2015-01-03 06:47 AM
Thank you very much.. :)
2015-12-30 02:08 PM
i thought of creating my own font files but could not understand how these asciis are written
Ok, but what part exactly don't you understand? What character is which line? What bits are? How binary works? How bit maps are used to generate images? Who made the table/array? Take the line 0x00, 0x00, 0x24, 0x18, 0x3c, 0x18, 0x24, 0x00,0x00 -> --------
0x00 -> --------
0x24 -> --#--#--
0x18 -> ---##---
0x3C -> --####--
0x18 -> ---##---
0x24 -> --#--#--
0x00 -> --------
This is the representation of the '*' character.
2015-12-31 12:56 AM
eg in 16x24 font these are binaries for '}' character
0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000,in 12x120x0000,0x0000,0x0000,0x0000,0x7400,0x5800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,in 8x120x00,0x00,0x00,0x00,0x00,0x00,0xe8,0xb0,0x00,0x00,0x00,0x00,in 8x80x00, 0x00, 0x00, 0x60, 0x92, 0x0c, 0x00, 0x00,now i want my own font size of lets say 24x24 so i dont understand how to change these binaries.I understand what does eg 0x60 means as you mentioned in the line.Thanks for replying.. :)2015-12-31 04:21 AM
I think only the first example is the '{' character.
You'd have to create your own bit map descriptions, likely 24 x 32-bit vectors, and adapt the unpacking code if it only supports widths up to 16-bits. If you have a 12x12 font you could do a quick conversion of that where you double the bits in each line, and repeat each line twice. ie 0x555 -> 0x333333,0x333333 You might also be able to find some tools that will take Microsoft TrueType fonts and convert them to bitmap format in C arrays.