FTDI Community

General Category => General Discussion => Topic started by: ppaing126 on January 20, 2022, 03:58:15 PM

Title: Font L2 format
Post by: ppaing126 on January 20, 2022, 03:58:15 PM
Hello;

I'm trying to develop a utility to preview custom fonts for my FT813 display.
Currently I have bought 4 displays 800x480.

When I open a L2  *.raw font file to parse the byte content:

i.e:   myfont1.raw
Format: 17  (0x11)
Stride: 44  (0x2C)
Widht: 176  (0xB0)
Height: 282  (0x11A)

If I plot the pixels all the width long (176) by all the height (282) what I can see is the character repeated 4 times.
Reading the documentation I can see the L2 format has 4 pixels data. Is this the reason it plot 4 times the data with slightly different values...?
This mean data is Alpha, R, G, B for each line...?

Someone knows how structured are the bytes on a .raw L2 uncompressed font file...?
I appreciate some deeper help on this topic.




Title: Re: Font L2 format
Post by: FTDI Community on January 21, 2022, 12:11:19 PM
Hi,

The L2 format uses two bits per pixel, giving four levels of grayscale per pixel. The stride is the number of bytes which contain one row of the image.  44 bytes will have the data for 176 pixels as you get four pixels per byte.

In general, a font converted (for example by our Asset Builder) will have the characters arranged as a vertical bitmap (one character wide by four tall if you have four letters) if you were to view it as an image (the asset builder outputs a png of the converted font where you can see this).

When displaying the font, make sure to set your format to L2 so that EVE knows how to display it.
If you look through the data then each pixel will be two bits and so look at pairs of bits for each pixel.

What settings did you use in the Asset Builder to convert it and what code were you using to display it?

p.s. We have a new forum for EVE on our BRT Community and so we recommend to post any EVE questions there http://www.brtcommunity.com/index.php?board=7.0

Best Regards, FTDI Community