Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everybody
I'm going to create a single-color LED display.
I want to write a code that can convert any install font on the system to a binary (e.g 8*8 or 16*16) data.
Is there any solution?
All suggestion and recommendation are welcomed.
Regards
R.Mohseni.
Posted
Comments
Toli Cuturicu 29-Nov-10 10:20am    
That nice. Write the code then!
Rajesh Anuhya 30-Nov-10 9:26am    
Start Something First...,
OriginalGriff 30-Nov-10 12:38pm    
See updated answer
Reza29ir 8-Dec-10 2:02am    
I wrote the code.
It gets a TTF and converts it to a bitmap image.But the problem is the same as previous.
There are some pixels that are between 0 to 255 and if we use a thresholds the result is not good.I mean converting ttf to bitmap doesn't create binary image
Member 13147920 25-Apr-17 8:13am    
Hi,
I want to do same thing as your question above.
If you have any solution or idea , please kindly guide me.
My email is
Mailfordo@gmail.com

1 solution

Not a good idea. Fonts are hugely complicated things, which do not scale well when you try to reduce them to 8 or so pixels.

If you insist on this approach, use the Font.Height property, together with the Unit property of the font set to GraphicsUnit.Pixel, and draw the entire font onto a bitmap at the height you want. It won't work well though: most of the fonts are proportionally spaced, so "i" is a lot narrower than "W", and so forth.

The best result will be if you map out your own characters into your chosen size and display them.



"Thank so much of your answer.
Do you have a better idea?"



As I said, if you want it to look good, you will either have to search for a 8*7 or 16 * 15 matrix font.

Normal sizes for these things are 5*7 (odd numbers are easier to fit western characters into) and on up: Google for "5x7 LCD font source code" and that should get you started.
It's not as if this hasn't been done a few times before - I think I have created basic character shapes in three different assemblers, C, C++, and probably a few languages I've forgotten using... :laugh:
 
Share this answer
 
v2
Comments
Reza29ir 30-Nov-10 9:11am    
Thank so much of your answer.
Do you have a better idea?

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