This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294KCPDT: grlib.h tFont and tFontEx warning

Part Number: TM4C1294KCPDT

i am using costom font using ftrasterize  function file in that when i am create custom font create then some warning display

like  

Description Resource Path Location Type
#169-D argument of type "const tFontEx *" is incompatible with parameter of type "const tFont *" All_Function.c /All_Function2 line 132 C/C++ Problem

//*****************************************************************************
//
// Details of this font:
// Characters: 46 to 58 inclusive
// Style: hemi head bold      (hhb)
// Size: 60 point
// Bold: no
// Italic: no
// Memory usage: 1372 bytes
//
//*****************************************************************************

i am using set for font function is    GrContextFontSet(&sContext, &g_sFontExHhb60);

that two line difine in grlib.h file :

extern const tFontEx g_sFontExHhb60;
#define g_psFontExHhb60 (const tFontEx *)&g_sFontExHhb60

how can remove that warning !

#169-D argument of type "const tFontEx *" is incompatible with parameter of type "const tFont *"

  • The TivaWare Graphics Library User's Guide contains the following in the description of the tFontEx typedef:

    This is a newer version of the structure which describes a font used for drawing text onto the screen. This variant allows a font to contain an arbitrary, contiguous block of codepoints from the 256 basic characters in an ISO8859-n font and allows support for accented characters in Western European languages and any left-to-right typeface supported by an ISO8859 variant. Fonts encoded in this format may be used interchangeably with the original fonts merely by casting the structure pointer when calling any function or macro which expects a font pointer as a parameter. More information on this and the other supported font structures may be found in the “Font Format” section of the user’s guide.

    Which suggests to remove the warning you need to add a cast. E.g. try:

    GrContextFontSet(&sContext, (const tFont *) &g_sFontExHhb60);

    Note that I haven't attempted to test this.