Text/graphic C code for CFAF320240

S

shp

Guest
..Hello

Hello..COSMICVOID

i am located in Germany..
please answer my question..which i was asked in my previous forum..
 
I try to understand LCDChar()..

In this function if i pass 'A' in this function then after a = chr - firstchr_L; statement which value pass Decimal (65 - 32) or Hexa (0x41 - 0x20) of 'A' ...
After this which value of 'a' going in this statements
This is calculating the index (a) into the character tables. The tables start with char 'firstchr_x' at index 0.
len = lentbl_L[a]; // number of columns
bitp = chrtbl_L[a]; // bitmap data pointer
This is fetching the length (number of columns) and pointer to the bit pattern for the character at index 'a'.
Also tell me about this statements

CJ_code & FONT16
mask & bits
"CJ_code & FONT16" is testing the control/justify code to see if FONT16 size is specified.
"mask & bits" is testing if a bit in the column is set or clear. The "mask" is shifted every time through the loop to test for each bit.
can u please explain me this statements.. I try to understand LCDText()..
In this if i write strg.cj_code = FONT16 + ABSJ..then what is the value of column after this statement "column = JustTbl - a"...??
If "ABSJ" is specified, then the absolute column value is contained in strg.col, and is not gotten from the justify position table.

"column = JustTbl - a" is getting the column number from the justify position table (minus 1/2 the string length), so the string is centered at the justify position.

Are you happy now :) ?

I am currently working on a newer version of the Font Editor for another project, and it will now allow up to 64 x 64 pixel character size, and it will import PCL laser printer fonts. I have found some very nice 32 x 32 Helvetica and Times Roman fonts, and I may adapt the CFAF320 code to use the large character sizes.
 
S

shp

Guest
..Hello

hello...COSMICVOID

Thank u very much for ur explantion...

In ur job r u making Font editor..??

If u make larger font for CFAF320240 then please send me..or guide me for making large font..because 8 & 16 size r too small..

thanks in advance
 
I made some good progress, and the font editor is pretty much done. I should be posting it in a few days. Maybe some of you can be beta testers for me. Here is what the key features are:

User changeable cell heights of 8, 16, 32, 48, or 64 pixels.
User changeable cell widths, up to 64 pixels.
Tools to manipulate the character pixels.
More options when saving to code files.
Ability to import PCL (printer) bitmap font files.
Context sensitive help.

Meanwhile, I have updated my C code for the AVR and the CFAF320, and will post that soon also. Here is a sample:
 

Attachments

This is the "fun with fonts" version of my code samples. Since I am now able to use larger fonts (see post above), I adapted my AVR code to allow more font selections, and to allow text to be rotated. The rotation part was pretty simple, since the CFAF320240's controller chip, the SSD2119, has an entry mode register (11h) that lets you choose which direction the cursor address increments automatically. The only tricky part is training youself to think of "row and columns" in four different directions. For example, text rotated 90° CCW has its top toward the left side of the screen, so for a location of [row 10, column 20] the text starts 10 pixels from the left side, and 20 pixels up from the bottom. The LCDSetTCur() function takes care of the translation of rows and column for rotated text.

The new version of my Font Editor, CFE_64, makes the earlier version obsolete. So, if you have downloaded the old version, you should replace it with this one. You may like the greatly expanded interactive Help file that is included. Please report any bugs you may encounter, as my testing was less than totally exhaustive. I am including an assortment of PCL bitmap fonts for you to play with. These font files were part of the accessory package from a 20-some year old HP LaserJet II that I used in another lifetime.

BTW, the editor is named CFE_64 because of the 64 pixel cell size, it is a 32-bit Windows executable which has been tested on 32-bit and 64-bit cpus (Win2K, XP, Vista, and Win7).
UPDATE: Starting with build 25, I am adding a 64-bit executable, in the "CFE_64_x64_build_25.zip" file. This has only been tested on Win7HP, Win7Pro, and Win10H.

Note: Updated font editor files to Build 26, 07/26/2018. Version 2.0.1.26. Only 64-bit executable; if you need a 32-bit version, say so. Newest features:
  • Char Select dialog now resizable, within limits.
  • When char range selected, all selected cells are highlighted.
  • Char Edit line mode allows shift/flip/rotate/invert and multiple endpoint edits on selected line, which remains selected until de-selected.
  • Cell height resizing also adjusts baseline offset.
  • Add shortcut keys for commonly used menu items.
  • Fix code file commenting inconsistancies.
  • Fix subtle bugs in several areas.
  • LOTS of other small improvements & additions.
The changes are listed in the Change Log page in the help file. I debated renaming the program to "CFE_128", but decided it was too much hassle for no benefit. As the file sizes grow, especially the Help file with its many screen captures, I decided to split the package into two parts. Part 1 is the program and the help file. Part 2 is the assortment of PCL font samples, which now include larger point sizes to use with the 128 pixel cell size. Some of the largest PCL fonts "just barely" fit, but are useable. Originally, the font samples mainly included the extended characters, but the latest assortment has a lot of 95 character fonts along with the 220 character fonts.
 

Attachments

S

shp

Guest
..Hello

hello..

Ur work is too good

thank u very much for providing program code
 

Ralf_altman

New member
How to create hex table for large bitmap font for graphic LCD

Hi Cosmicvoid,

I have read your thread, downloaded your Build10 font creation and very impressed by that.

However, my application is a little bit different and I could not figure out how to get larger font for my graphic LCD application.

I am doing a Uni project and working on 2.4" and 3.2" graphic LCD (240 x 320) demo kit. In the firmware package provided with the kit, there is a header file contains the 8x8 & 8x16 font (see attachment). But I don't know how they did create that.

If it's possible, could you please advise whether your program can convert character with much larger font (e.g. 80 x 160???) to hex format in similar format with the file I have attached.

Or any suggestion from you would be very much appreciated.

Best Regards,
Ralf
 

Attachments

... I could not figure out how to get larger font for my graphic LCD application.
So, you're saying that you need a font that is larger than 64*64 pixels? I'm not sure how that would be used on a 240*320 display. You could only fit a few characters across the screen.
I am doing a Uni project and working on 2.4" and 3.2" graphic LCD (240 x 320) demo kit. In the firmware package provided with the kit, there is a header file contains the 8x8 & 8x16 font (see attachment). But I don't know how they did create that.
It looks like they might have used a program similar to mine and others available online. The only difference I see is their font is one huge 2 dimensional array, whereas mine has each character declared individually, along with an array of pointers to the chars.
If it's possible, could you please advise whether your program can convert character with much larger font (e.g. 80 x 160???) to hex format in similar format with the file I have attached.
I'm sorry, but my program is rather limited, and can only handle 64*64 bit characters. I decided this because the 64 bit integer is the largest that is convenient to use in programming. To make larger pixel arrays would take a lot more work, and I was trying to be lazy about this program:rolleyes:. Plus, I can't think of any real use for bitmap characters larger than 64 bits; if you need larger, it might be better to use a different program to scale up a TrueType font (or other scalable type) to the size you need.
Or any suggestion from you would be very much appreciated.
I'm not really sure what your goal is with huge fonts on a small display. If you only need a few symbols (not a whole alphabet), then you could divide your symbols into 64*64 bit chunks, and make up the chunks so that putting them adjacent to each other on the screen (like an array of cells) will produce the large symbol. Else, I don't have any suggestion, unless you can give more details.
 

evplasmaman

New member
Trouble with largest font

Hello cosmicvoid,
I have used your very nice program to import some fonts to my project and most of them work fantastically. The issue I have is with the largest one which seems to be missing bottom half of each char. Instead it seems to repeat the top part again. I went through and converted the 'H' from hex to bin fromthe output file.
Code:
[SIZE="1"]
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 11111111, 11111111, 11111111,
	00001111, 11111111, 11111111, 11111111,
	00001111, 11111111, 11111111, 11111111,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00000000, 00000000, 00000000, 00000000,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 10000000, 00000000, 00011111,
	00001111, 11111111, 11111111, 11111111,
	00001111, 11111111, 11111111, 11111111,
	00001111, 11111111, 11111111, 11111111
[/SIZE]
This was the result. Am I doing something incorrectly or is this a bug?

Many thanks!
Note: formatted by moderator.
 

Attachments

I can't tell what the problem might be just by looking at your bit patterns and photo. If you attach the source font file, then I can check for problems in my code. Also, tell me which options you used when creating the code file.
 
Thanks to evplasmaman for discovering this bug. I was able to reproduce it, and I think it is now fixed. You should go back to this post
https://forum.crystalfontz.com/showpost.php?p=28164&postcount=28
and download build 12. Let me know if you still have a problem with your font.

The bug was due to a quirk of the compiler when doing 64 bit shifts using a 32 bit number as the shift count, it would only shift 32 bits. I think this bug was introduced only in the last few versions, but since I use 'column' format for my projects, I didn't notice it.
 

wdawson61

New member
Where is the 8x8 font ??

Hi Cosimic void. I dl'd your tool and its very nice. For my app I need a subset of "Windows Latin" in an 8x8 font. I looked at the fonts included with your software but could find no 8x8 fonts. I also see noticed that the characters don't appear to be in any encoding I'm familiar with. Is there an 8x8 font in any recognizable encoding? Even if its a subset, it would be a real help to not have too generate the whole font.

Thanks very much for contributing the tool!

-Wade
 
Hi Cosmic void. I dl'd your tool and its very nice.
Thanx.
For my app I need a subset of "Windows Latin" in an 8x8 font. I looked at the fonts included with your software but could find no 8x8 fonts.
I only have two PCL fonts that are 8 pixels high, and they are so nasty looking that I didn't include them in the package, but you can have them. I also have a homemade 8x8 font that I used for small LCD displays; you can have that also. You realize that an 8x8 font will not be very pretty.
I also see noticed that the characters don't appear to be in any encoding I'm familiar with. Is there an 8x8 font in any recognizable encoding? Even if its a subset, it would be a real help to not have too generate the whole font.
Well, if you're talking about the font files I supplied, the PCL encoded fonts are not exactly 'rare', though there is not much call for them in the Windows OS environment, but you can find them online if you search a bit (there are even programs than will convert Windows fonts to PCL fonts); if you're talking about the font files that my program stores data in, those are my own proprietary format.
 

Attachments

wdawson61

New member
Thanks for the response. I do indeed realize this, I'm currently using a font "based" on the windows Terminal8 fixed font, and you're definitely right; gnarly at best, but the fact the the display controller I'm using is page-based makes doing page-spanning operations a bit more cycle hungry than this system is able to cope with. I'm using a dma channel to handle (spi) data transfers, but the actual pixel manipulation is the bottleneck. I've tried to keep operations, "page-based" wherever possible, though I do use a Breshenham line function that resorts to setting individual pixels in some cases.

Thanks again for your responses!
 

evarghese

New member
Cosmicvoid,
Great Program!! 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? Appreciate the inputs!
 
Top