在嵌入式系统中,成本往往是敏感的,如果你的Flash足够大,就可以省去片外Flash,我用结构体实现了该功能,并分享给广大网友,最后附有下载链接。
在fonts.h中:
typedef
struct _tFont
{ const uint16_t *table;
uint16_t Width;
uint16_t Height;
} sFONT;
extern sFONT
Font8x8;
extern sFONT Font8x12_bold;
extern sFONT Font8x12;
extern sFONT Font12x12;
extern sFONT Font16x24;
#define
GL_Font8x8 Font8x8
#define
GL_Font8x12_bold Font8x12_bold
#define
GL_Font8x12 Font8x12
#define
GL_Font12x12 Font12x12
#define
GL_Font16x24 Font16x24
在fonts.c中
const uint16_t
ASCII16x24_Table
[]={………………}; //字模
sFONT Font16x24 = {
ASCII16x24_Table,
16,
24,
};
sFONT Font12x12 = {
A