FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:



Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


Author Topic: Screen Editor - how to create Font Metric Block  (Read 87 times)

TonyZ

  • Newbie
  • *
  • Posts: 3
    • View Profile
Screen Editor - how to create Font Metric Block
« on: September 24, 2018, 07:23:17 PM »

Hi all,

Using Screen Editor, I'm able to add a TTF font using the Add Content feature. Then I'm able to add text in this custom font to the window. But when I export the project, only the font data block is created, not the font metric block. Am I missing something? Or do I have to create it manually?

Thanks,
Tony
Logged

FTDI Community

  • Administrator
  • Full Member
  • *****
  • Posts: 154
    • View Profile
Re: Screen Editor - how to create Font Metric Block
« Reply #1 on: September 25, 2018, 11:00:27 AM »

Hello,

If you ensure that the 'Compressed' option is unselected in the Content pane for your custom font the resulting output from your export will include the metric block data at the start of the file.

Best Regards,
FTDI Community
Logged

TonyZ

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Screen Editor - how to create Font Metric Block
« Reply #2 on: October 04, 2018, 08:21:15 PM »

Hello,
Thank you for your reply.

I had actually already tried unchecking the "compressed" option and I can, indeed, see the metric block at the beginning of the output data. However, the
the starting address of RAMG always appears as 0,0,0,0 regardless of what I set it to in the screen editor. Is this a bug, or is the starting address irrelevant?

Note that I'm using SETFONT2, not SETFONT in my software.

Regards,
Tony
Logged

FTDI Community

  • Administrator
  • Full Member
  • *****
  • Posts: 154
    • View Profile
Re: Screen Editor - how to create Font Metric Block
« Reply #3 on: October 09, 2018, 12:09:17 PM »

Hi Tony,

In the output code file, you should see a definition corresponding to the 'address' field of the font properties. We used Consola here and so your definition may be different.


In the code below we set the start address defined as 1000 and so we got:

#define RAM_FONTS_CONSOLA 1000
static ft_uchar8_t fonts_consola[] = {
   /*('file properties: ', 'resolution ', 16, 'x', 22, 'format ', 'L8', 'stride ', 16)*/0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
[remainder of font data]


Then later at the bottom of the code you should see the following where the code is loaded into RAM_G beginning at location 1000
   Ft_Gpu_Hal_WrMem(phost,RAM_FONTS_CONSOLA, fonts_consola, sizeof(fonts_consola));
   Ft_Gpu_CoCmd_SetFont2(phost,0, 1000, 32);

Does this match what you see?

If you have some screenshots or further information you can also send it to our support address support1@ftdichip.com.

Best Regards, FTDI Community
Logged