General Category > Discussion - Software

Screen Editor - how to create Font Metric Block

(1/3) > >>

TonyZ:
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

FTDI Community:
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

TonyZ:
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

FTDI Community:
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

TonyZ:
Hi,

Yes, I do see the "1000" in both places as the RAMG starting address. I see this in the code that the Screen Editor exports. This is good!

But my question was that the "1000" does not appear in the font metric block itself. There is a field toward the end of the 148 byte font metric block
that is supposed to hold the RAMG starting address. And the Screen Editor ALWAYS outputs 0 for this field, regardless of the specified starting address you use in Screen Editor.
(note: if I use FNT_CVT to convert a font, then the RAMG starting address does, indeed, show correctly in the font metric block)

Perhaps this field is not used by SETFONT2, since the actual starting address is passed as an argument in the SETFONT2 function. I haven't tried running the code
with an actual LCD screen, so I'm not sure if this matters.

On a related issue, do you know the name of the built-in fonts (ROM fonts) for handles 16, and 26-29. They look like "Ariel", but I wasn't sure.

Thank you,
Tony

Navigation

[0] Message Index

[#] Next page

Go to full version