参考内容博客地址:http://elkpi.com/topics/libgd-notes.html
libgd官网网址:https://libgd.github.io/
今天接着学习相关如何将中文字符串转成图片。
#include <stdio.h>
#include <string.h>
#include "gd.h"
int main(int argc, char **argv)
{
gdImagePtr stImg; //声明图像结构体,具体内容gd.h文件
FILE *pfJpeg = NULL; //声明输出文件格式
int black; //声明颜色索引
int white;
char *pcMsg = "hello, 你好"; //转换字符串内容
double sz = 100.0; //字体高度
char *err = NULL;
int x; //存储图片生成高度
int y; //存储图片生成宽度
//linux中文字体为文泉驿微米黑,系统路径为/usr/share/fonts/wqy-microhei.ttc
char *pcFont = "/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc";
//计算单个字体宽度&#