Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Embedded systems (CPU slow, limited memory) is often used dot matrix font, such as 12 * 16 dot matrix can be binary, see the linked image http://hi.csdn.net/attachment/201111/3/3652857_1320325279YaZf.jpg[^]

But this memory is memory space occupied.
How to use the appropriate algorithm to optimize, and analyse their advantages and disadvantages of the given code and the time and space complexity of algorithms?
Posted
Updated 6-Nov-11 0:22am
v9
Comments
Mehdi Gholam 6-Nov-11 1:54am    
Your image file is forbidden, please fix it.
PEIYANGXINQU 6-Nov-11 5:01am    
I have try to fix it many times ,but I can not do it. <img src="http://hi.csdn.net/attachment/201111/3/3652857_1320325279YaZf.jpg" alt="picture"/>Can you tell me how to upload a picture to this websit?Thank you!

1 solution

Without seeing you linked image (as Medhi says, it gives 403 - forbidden) it is difficult to be accurate, but...

It varies, depending on the application and the hardware. And to a certain extent the programmers personal preferences.

If you are talking about low resolution text, and a limited processor, then storing character fonts as direct binary can be the best method: it is reasonably compact (each character in a 12*16 array only needs 24 bytes) and it is a fixed length, so it is simple to index to the appropriate character for display. If you start to get clever with your storage, you can save space, and even store characters in an arrangement that makes life easier when you display them - but this depends heavily on your hardware, and also on your processing power - the more complex the character storage algorithm, the longer it takes to display a character, and this may be a very important criteria of an embedded system - if you miss your "slot" you will not get the chance again.

For example, I had one embedded system for printing on cardboard cartons as they moved down a production line. The print head was vertical, at 90 degrees to the movement of the boxes, and the resolution was reasonably high - 180 dpi, 128 separate dots. So my font storage was optimized for printing: each character was stored as a number of vertical lines in a vertical slice through the character - since I only had a Z80 to do the processing, and 32K of RAM in total, I had to be quick, but densly packed. As it became time to print each vertical column of the character, it was a simple case of clear the memory area, and set the appropriate black pixels. If I had stored this in a format suitable for an LCD display, then it would have been in horizontal slices by byte, and much slower to output from the print head.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900