General Category > Discussion - Software

FT813 - Fonts bigger than 39 not working

(1/2) > >>

toty04:
Hi all,

I'm having a problem when trying to draw big fonts on a 5" display.
The display is Riverdi: RVT50UQFNWC01, which uses the FT813 chip as controller.
I have tried to create my own fonts and it works fine with sizes smaller than 39 (depending on the font type, it might be more or less than 39).
For the font conversion I've been using the Font_Converter_Tool_V0.4 with the following commands:

* fnt_cvt.exe -i tt0010m_.ttf -s 40 -u myletters.txt -d 1000 -c setfont2
fnt_cvt.exe -i tt0010m_.ttf -s 39 -u myletters.txt -d 1000 -c setfont2
* From the generated files I pick up the ".rawh" file (L2 format) and convert it to a C header file.
After that I run the following code:
// Write Font to RAM
   Gpu_Hal_WrMem(phost, 1000, font_test, sizeof(font_test));

   // Init display buffer
   Gpu_CoCmd_Dlstart(phost);
   App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(0,0,0));
   App_WrCoCmd_Buffer(phost, CLEAR(1,1,1));
   App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));

   // Set Font
   Gpu_CoCmd_SetFont2(phost, 1, 1000, 1);

   // Write
   Gpu_CoCmd_Text(phost, 230, DispHeight/2, 1, OPT_CENTERX|OPT_CENTERY,
               (const char8_t*)"Bienvenido!");

   // Show buffer
   App_WrCoCmd_Buffer(phost, DISPLAY());
   Gpu_CoCmd_Swap(phost);
   App_Flush_Co_Buffer(phost);
   Gpu_Hal_WaitCmdfifo_empty(phost);

With the size 39 font, the letters are displayed perfectly, but with the size 40 it simply appears a white block, where the text should be.
Am I missing some commands? Is there any specific sequence I need to follow for bigger font size?
Any help would be useful.

Thanks in advance
Santiago

FTDI Community:
Hello,

Section 6 of the following has an example of using customer fonts:
FT81X Simple PIC Library Examples

Can you show me the section of code where you assign the bitmap properties to your custom font?

Best Regards,
FTDI Community

toty04:
Hi,
thanks for the answer. I've realized I was missing some code lines (although I've been doing this for both size and for the small one works fine). Now I've added the code to assign the bitmap properties to my custom font, but still not working.

Complete code:

   // Write Font to RAM
   Gpu_Hal_WrMem(phost, 1000, font_test, sizeof(font_test));

   // Init display buffer
   Gpu_CoCmd_Dlstart(phost);
   App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(0,0,0));
   App_WrCoCmd_Buffer(phost, CLEAR(1,1,1));

   App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(1));
   App_WrCoCmd_Buffer(phost, BITMAP_SOURCE(1000 + 148));
   App_WrCoCmd_Buffer(phost, BITMAP_LAYOUT(L2,11,48));

   App_WrCoCmd_Buffer(phost, BITMAP_SIZE(NEAREST,BORDER,BORDER,42,48));

   App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));

   // Set Font
   Gpu_CoCmd_SetFont2(phost, 1, 1000, 1);

   // Write
   Gpu_CoCmd_Text(phost, 230, DispHeight/2, 1, OPT_CENTERX|OPT_CENTERY,
               (const char8_t*)"Bienvenido!");

   // Show buffer
   App_WrCoCmd_Buffer(phost, DISPLAY());
   Gpu_CoCmd_Swap(phost);
   App_Flush_Co_Buffer(phost);
   Gpu_Hal_WaitCmdfifo_empty(phost);

Best regards, Santiago

FTDI Community:
Hello,

By any chance are you loading both fonts into RAM_G concurrently?
I cant see any glaring issues with your code, looks like you've set everything correctly for the 'not working' font data.

Best Regards,
FTDI Community

toty04:
Hi,

I also don't understand what am I doing wrong.
Only one file is load and has to be changed manually to get the other one.
Please find attached the complete project.
Sources, includes and EVE HAL layer.
The project is running on an STM32F407 MCU, so I have omitted all the MCU related files.

Any idea of what can I test?

Best regards,
Santiago

Navigation

[0] Message Index

[#] Next page

Go to full version