General Category > Discussion - Software

FT813 (or BT815) few fonts at the same time.

(1/2) > >>

marbalon:
In our application, we need to have possibility to use few fonts with different sizes. Now I'm working on FT813 and found that custom fonts must be uploaded to RAM_G, but custom font means 1 x font in 1 x size yes ? So, I can't upload font in size 20 and then use it in smaller size ?

I found that new chip from BT81x family have possibility to use external flash to store fonts/bitmaps. So in this way we can upload few fonts in to the external flash and use later? But in FT813 we can not overwrite existing fonts ?

Is there any example how to use external flash fonts ? The documentation is not clear for me.

FTDI Community:
Hi,

Although in theory you can scale individual characters of text like an image, it is normally more feasible to load the font several times converted to different sizes. If you don't need all characters (e.g. maybe just numbers and maths symbols) you can save some space there too. Or in many cases you can try L2 or L4 format or even L1 which won't take up as much space. You can experiment a bit to see what looks good on the screen.

If you want just a few sizes, then loading each to a different bitmap handle should work well.

For BT81x, we have a beta sample app below which you can refer to for BT81x. See SampleApp folder in this file and in particular within sampleapp go to src -> Application -> Set_10.c -> ExtendedFormatFont() for an example.

BT81x Sample Apps

Note that the file is around 200MBytes.

Best Regards, FTDI Community

marbalon:
Thanks for all the hints I will try to do some different test and see what will be best and fast. But just to confirm - can I use fonts directly (without copying to RAM_G) from the external flash in BT815?

Rudolph:
The chance of getting an answer from the community might be a little higer over in the BRT community forum. :-)

The BT815 can use font.glyph flies directly from FLASH but it also needs the font.xfont file that is also generated
and the .xfont has to be copied to RAM_G.

I just put these both in FLASH, the .glyph first and then use cmd_flashread to to the .xfont into RAM_G.

marbalon:
Ok, I after some tests and L2 fonts seem to be fine in most cases. But I have a new problem to resolve. I'm loading fonts to the RAM_G from SD card, then on the FT813/BT815 I can use two commands:

- SETFONT - this ok but I have to provide: stride, widht,  and heigh - the question is how can I get these values? The best if I can calculate it based on the size + L1/L2/L4/L8 method. Advantage of this command is that I can upload the font to any RAM address I want and it is working.
- SETFONT2 - seems to be better because I only need to provide font address, but problem is that loading address is "compiled" into the raw file when it is generated ??? When I use this command with different address then provided in the the font converter then it is not working.

In my case, I can have dynamic content on the screen controlled by the server. So I want to use a few fonts on the same screen, but I don't know what combination of these fonts will be used.

Like I mentioned before we are going to switch from FT813 to BT815 to have external flash capability. But Can I use this flash for commands above by putting FLASH address instead RAM_G?

What is the best to resolve the case above???

BR,
Marcin.

Edit.
I found a "hack" for SETFONT2 command and now I can use this command no mather what offset was provided using EVE font converter. I found that in the raw file at offset 0x90 RAM_G address is located (value = RAM_G offset+148), so when I modify this in the memory everything is working ;-)


--- Code: --- EVE_cmd_load_from_sd(fontFileAddress, EVE_OPT_NODL, font_name, CMD_LOAD);
offsetValueFix = fontFileAddress+148;
EVE_memWrite_flash_buffer(fontFileAddress+0x90, (uint8_t*)&offsetValueFix, 4);

--- End code ---

The question is - can I use SETFONT2 command for fonts stored in external flash in BT815 ?

Edit2.
Does the SPI flash can be used to save RAM_G only for dynamic pictures ? Or all displayed data must be in RAM_G including fonts etc.

Navigation

[0] Message Index

[#] Next page

Go to full version