This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

const array missing element

I am using the nRF GFX library to print some text on an LCD. The font, prepared with The Dot Factory v.0.1.4, is stored in flash per the examples in the sdk.

The problem is that all characters in the table after the "\" are offset by one so that the text "This is a test" appears on the LCD as "Tijt jt b uftu". As can be seen in the first attached screenshot, the table entry for the "]" is missing from the code, causing the offset. It looks like the compiler is not including that entry. In the second screenshot, adding a second entry for "]" causes an entry to be created.

In the supplied samples in the SDK, this is not a problem and I cannot see why I am getting this with identical fonts.

I'd appreciate any help.

Regards,

Jas

Each entry stored as a 16bit uint.

Adding a dummy "]" creates an entry!

Parents Reply
  • No I haven't compared but I'm using the same settings for both, just changing the initialisation of the fonts to the new ones. See below, I comment out the 8 pt referenc and use 10 pt instead.

    //extern const nrf_gfx_font_desc_t orkney_8ptFontInfo;
    //extern const FONT_INFO orkney_8ptFontInfo;               
    //static const FONT_INFO * p_font = &orkney_8ptFontInfo;   
    
    extern const nrf_gfx_font_desc_t orkney_10ptFontInfo;
    extern const FONT_INFO orkney_10ptFontInfo;              
    static const FONT_INFO * p_font = &orkney_10ptFontInfo;  
    
    

Children
Related