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

Main Menu

accessing custom font Glyphs in Flash

Started by iv_pb, January 13, 2021, 07:54:01 PM

Previous topic - Next topic

iv_pb

Currently I am setting the “start_of_Graphic_data”  (p + 32),  to the location of where the glyph file is in RAM.

        local Xfont = assetLoader.ImageInfo[xfont].index;
        local Glyph = assetLoader.ImageInfo[glyph].index;
        MCU_WriteMem32(Xfont + 32, Glyph);



For a glyph stored in Flash ([0x02F000 -> 0x057000]) for instance,
How would I compute the flash address to store in the “start_of_Graphic_data”  ?
Is there anything else I need to modify in the xfont (Font Metrics Block)?




pauljiao

If the glyph is in ASTC and stored in flash, the address shall offset from 0x800000.
See the picture from programming guide

Rudolph

Quote from: iv_pb on January 13, 2021, 07:54:01 PM
Is there anything else I need to modify in the xfont (Font Metrics Block)?

You do not really need to modify anything in the xfont data.
When you store SomeFont_xx.glyph and SomeFont_xx.xfont in a flash-file the .xfont data
is adjusted automatically by the EVE Asset Builder already.
You just need the offset and the length for the .xfont file, copy it to somewhere in RAM_G
with CMD_FLASHREAD and use CMD_SETFONT2  to assign the .xfont to a bitmap handle.