BRT Community

General Category => Discussion - EVE => Topic started by: iv_pb on January 13, 2021, 07:54:01 PM

Title: accessing custom font Glyphs in Flash
Post by: iv_pb on January 13, 2021, 07:54:01 PM
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)?



Title: Re: accessing custom font Glyphs in Flash
Post by: pauljiao on January 20, 2021, 02:38:54 AM
If the glyph is in ASTC and stored in flash, the address shall offset from 0x800000.
See the picture from programming guide
Title: Re: accessing custom font Glyphs in Flash
Post by: Rudolph on January 26, 2021, 08:26:30 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.