Text/graphic C code for CFAF320240

Great Program!!
Thanks!

I was thinking if I can use it for Text Overlay on a graphics background. The problem is that if the background matches the color of the font, it wouldn't be visible. Any ideas?
Only two ideas come to mind.

1. Put the text up with a background color in the cell that's different from the graphics background. Easy to do, but would look a bit tacky, I think.

2. Use an outline around the characters, probably black or white, depending on the gray scale value of the background.

What's interesting (to me) is that a few weeks ago, while I was playing with the code to do the Area Fill function, I thought about some way to generate an outline of the character. I didn't need that feature, but it seemed like a cool thing to impliment. But I've gotten virtually no feedback or suggestions from anyone about what they would want to see in the program, and it would take a bit of work to do an outlining algorithm, which I had no idea whether anyone even wanted, so I let the idea drop.

I was thinking that for small fonts (e.g. less than 32 pixels W/H) the outline might overwhelm the characters which have strokes only 1 or 2 pixels wide. But for larger fonts it would work well. For a font with only 96 characters (0x20~0x7F), the outlines could reside in the same file, offset by 96 or 128. Then for each character written to the display, you'd write char (n) and char (n+96) to the same location, using appropriate colors for each. But if you needed a font with extended character set, then the outlines would have to be in a separate file (due to the 224 char limit in my prog), which would be messy but doable.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

evarghese

New member
I tried the first idea. In my situation I have the RGB pixel and what I was doing is compare the background with the color that I was intending for the text, and if they match (or the difference is small enough) I invert the intended text color. It seems bit tricky still and the issue came in identifying how to judge the limits on the difference between the background and the text colors.

I think your second idea is the best. I guess I need to create the bitmap for the outline text as another font list (using your program) and apply both the text mask and the outline mask to each text. The only downside is that I need more memory space to save the outline mask as well. I was trying to avoid that if there is a way.

I appreciate your thoughts. Thanks!!!
 
... I need more memory space to save the outline mask ...
I guess your choice of cpu will affect that. Compilers like to put data in RAM, but typically there's not so much of that. I've been putting the font data in flash/ROM, since there is usually much more than you need for just the code; but you have to jump through a few hoops, using keywords to specify data location, and be sure the data is being fetched from ROM.

Since your post, I've been thinking more about adding the outline generation feature to my program, and maybe I'll do that, but no telling when I'll get around tuit. It might turn out to be easier than I think, but there's always the risk of breaking something else. And then there is the nuisance aspect of having to modify the dialog layouts, and grabbing screen shots to update the help file, yada, yada.
 

evarghese

New member
I guess your choice of cpu will affect that. Compilers like to put data in RAM, but typically there's not so much of that. I've been putting the font data in flash/ROM, since there is usually much more than you need for just the code; but you have to jump through a few hoops, using keywords to specify data location, and be sure the data is being fetched from ROM.

Since your post, I've been thinking more about adding the outline generation feature to my program, and maybe I'll do that, but no telling when I'll get around tuit. It might turn out to be easier than I think, but there's always the risk of breaking something else. And then there is the nuisance aspect of having to modify the dialog layouts, and grabbing screen shots to update the help file, yada, yada.
Yeah, In this project I just use the internal RAM to store the code, not even using the Flash..since it is FPGA based. I did do that sometime ago, but lazy to change the way things are I guess :)
If you make changes, I would appreciate if you post here or drop me a word.. BTW, your program is very professional and does the job well, Thanks for sharing. Is this done in Java?
 
... If you make changes, I would appreciate if you post here or drop me a word.. BTW, your program is very professional and does the job well, Thanks for sharing. Is this done in Java?
Actually, the program is written in a mix of C and C++, using STL and Win-API calls (no MFC :().

Your topic of character outlines has motivated me to add some more stuff to the program. You can see the info, and download here:
https://forum.crystalfontz.com/show...aphic-C-code-for-CFAF320240&p=28164#post28164
 

Attachments

I use my CFE_64 font editor from time to time for my own projects, and over the last few years, I decided it needed some features that make the program easier to use. So now I've finally gotten around to doing that. As I look at the code again after 4 years, I found some subtle bugs that have been fixed; and who knows, maybe I've added a few new ones. If you find a problem with CFE_64, I'd appreciate you letting me know.

You can download Build 26 in the usual place (post #28). Only a 64-bit version, if you need a 32-bit version, say so.

 
Top