windows字体位置 C:\Windows\Fonts
linux字体位置 /usr/share/fonts/DroidSansFallback.ttf
库文件libfont.a
链接:https://pan.baidu.com/s/1BYamH8s_v54IlSrvQe21hg?pwd=mft7
提取码:mft7
font.h
#ifndef __font_h__
#define __font_h__
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/mman.h>
#include<unistd.h>
#define color u32
#define getColor(a, b, c, d) (a|b<<8|c<<16|d<<24)
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef char s8;
typedef short s16;
typedef int s32;
typedef long long s64;
typedef struct stbtt_fontinfo
{
void * userdata;
unsigned char * data; // pointer to .ttf file
int fontstart; // offset of start of font
int numGlyphs;