第一步: extern void (*gui_measure_string) (UI_string_type text, S32 *width, S32 *height);
第二步:/*----------------------------------------------------------------------------
Function Pointer: gui_measure_string
Description: Returns the width and height of a string in pixels
Input Parameters: text pointer to the string
Output Parameters: width pointer to width of string in pixels
height pointer to height of string in pixels
Returns: void
Remarks: This works with reference to the current font.
See gui_set_font()
----------------------------------------------------------------------------*/
第三步:然后找到gui_set_font
/*----------------------------------------------------------------------------
Function Pointer: gui_set_font
Description: Sets the font to be used by text display functions
Input Parameters: f is the font to be used
Output Parameters: none
Returns: void
Remarks: See UI_font_type (Abstract type)
----------------------------------------------------------------------------*/
第四步:
typedef struct stFontAttribute
{
U8 bold;
U8 italic;
U8 underline;
U8 size;
U8 color;
U8 type;
U8 oblique;
U8 smallCaps;
} stFontAttribute;
typedef stFontAttribute* UI_font_type;