BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: BT815 and custom fonts in SPI flash  (Read 16629 times)

marbalon

  • Newbie
  • *
  • Posts: 3
    • View Profile
BT815 and custom fonts in SPI flash
« on: September 10, 2019, 04:25:03 PM »

Hi,

I'm using fonts legacy raw fonts generated by fnt_cvt using SETFON2 function. Question is: Can I use these fonts directly from SPI flash? Just by providing address 0x8xxxxxxxx  to the SETFON2? I wan't to store all fonts into the SPI flash and then use it by SETFON2 when needed without copying to RAM_G because RAM_G is used mostly for full-screen pictures.

BR,
Marcin.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #1 on: September 11, 2019, 11:53:45 AM »

Hello,

Unfortunately, you must load any custom font data from the flash into RAM_G before it can be used by EVE.

Best Regards,
BRT Community
Logged

marbalon

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #2 on: September 11, 2019, 03:40:23 PM »

Thanks for answer, but this is the worst scenario... So if I want to display full screen jpg file on 800x480 display, plus 3-4 labels with custom fonts it is not possible because everything must be stored in RAM_G ? Or maybe I don't know all the possibilities ?
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #3 on: September 11, 2019, 05:31:26 PM »

Unfortunately, you must load any custom font data from the flash into RAM_G before it can be used by EVE.

I don't know, but isn't that answer a little generic?
This somehow implies that BT815 can not use any font from FLASH while only legacy fonts can not be used from FLASH.

So re-converting the fonts to extended format with ASTC compression would be the way to go.
Only the font structure for some reason still needs to be loaded into RAM_G, but it is way smaller than the glyphs.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #4 on: September 12, 2019, 01:05:55 PM »

Hello,

Also, as Rudolph mentioned, the BT81x can use font .glyph flies directly from FLASH. But the .xfont file should be copied to RAM_G. This can either be stored on the MCU or can be stored on flash and then copied by your code to RAM_G.

Code: [Select]
void SAMAPP_ExtendedFormat_Font()
{
SAMAPP_API_Screen("Unicode Font");
#define UNICODE_HANDLE 30
Gpu_FontsExt_t font;
uint32_t fontAddr = RAM_G;
//Load glyph file into BT815's flash
//Load xfont file into graphics RAM

/* Switch Flash to FULL Mode */
Gpu_CoCmd_FlashHelper_SwitchFullMode(g_phost);
Gpu_Hal_LoadImageToMemory(g_phost, TEST_DIR "\\mssong_20.xfont", fontAddr, LOAD);
Gpu_Hal_WaitCmdfifo_empty(g_phost);

Gpu_CoCmd_Dlstart(g_phost);
App_WrCoCmd_Buffer(g_phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(g_phost, COLOR_RGB(255, 255, 255));

Gpu_CoCmd_SetFont2(g_phost, UNICODE_HANDLE, fontAddr, 0);
Gpu_CoCmd_Text(g_phost, 0, 0, UNICODE_HANDLE, 0, u8"BRT的EVE技术是一个革命性的概念,");
Gpu_CoCmd_Text(g_phost, 0, 30, UNICODE_HANDLE, 0, u8"利用面向对象的方法创建高质量的人机界面(HMI) 同时支持显示,");
Gpu_CoCmd_Text(g_phost, 0, 60, UNICODE_HANDLE, 0, u8"音频和触摸功能。");
App_WrCoCmd_Buffer(g_phost, DISPLAY());
Gpu_CoCmd_Swap(g_phost);
App_Flush_Co_Buffer(g_phost);
Gpu_Hal_WaitCmdfifo_empty(g_phost);
Gpu_Hal_Sleep(4000);
}

Best Regards,
BRT Community
Logged

marbalon

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #5 on: September 12, 2019, 07:16:47 PM »

Thanks for all answers.

Like I said this is still not a solution when you have to switch between fonts in few font sizes etc. because for the same font 60pkt size glyph file is about 4MB, but L2 raw fill acceptable in this app is about 100kb. So if I have to load few fonts for one screen to the flash from Sd card this will take some time...

So maybe there is a trick to load one big file glyph and use it for smaller rescaled fonts?

Or any other tricks allow me to display full-screen jpeg file + few labels in different sizes.

BR,
Marcin.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #6 on: September 13, 2019, 02:31:03 PM »

Hello,

The .xfont should be loaded into RAM_G, while the .glyph should loaded into the flash.
Given an appropriately sized flash chip, you can load all your .glyphs onto there during start-up and access them when needed in your application. Copying the desired new .xfont files to RAM_G when you wish to change the font being used.

Best Regards,
BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #7 on: September 16, 2019, 05:16:26 PM »

Use a bigger FLASH?
EVE takes up to 2Gbit, that is 256 mByte.
Logged

pauljiao

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #8 on: September 19, 2019, 04:10:51 AM »

If you are not using the full unicode font characters,  you shall define your own set of characters to be used in your application.  It can minimize the size of font data.  Here is the screenshot of
EAB. Try to use ASTC8x8 or ASTC10x10 to see if the quality meets your needs and it saves the space too.

Hope it is helpful for you.
Logged

b2mishra

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #9 on: October 07, 2019, 04:34:09 PM »

Hello,

Is there a sample file for the "Characters to be converted" for Generating Font?
I am not sure how exactly that works, and I have not been able to get it to work yet. 

Thanks
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: BT815 and custom fonts in SPI flash
« Reply #10 on: October 08, 2019, 01:03:42 PM »

Hello,

Please see attached for the text file used to denote which characters are to be converted in the font convertor for BRT_AN_014.

Best Regards,
BRT Community
Logged