tft.eSPI库自定义字体方法
先下载 processing 然后安装

到mixly安装目录下找到tft_eSPI文件夹
路径如:D:\Mixly1.20\arduino\portable\sketchbook\libraries\TFT_eSPI\Tools
将Tools文件夹单独复制出来如我的为 E:\tft_espi字体制作Tools
在tft_espi字体制作Tools下找到文件夹名为:Create_Smooth_Font 双击打开 在继续打开 Create_font
进入后有二个文件夹data是放字体文件如:simhei.ttf 字体可以在C:\Windows\Fonts找,找到要用的
字体文件复制到data文件夹下即可
第二个文件夹FontFiles 是生成字体文件如:simhei20.vlw
第三个文件是字体脚本。如processing成功安装会自动关联文件。可以直接双击打开
找到如下内容:
String fontName = "simhei"; //字体名字 这里就是 simhei.ttf
String fontType = ".ttf"; //字体后缀 如上 simhei.ttf 小写的.ttf
//String fontType = ".otf";
//String fontType = ".TTF"; //字体后缀
// Define the font size in points for the TFT_eSPI font file
int fontSize = 20; //这里是字符大小
// Font size to use in the Processing sketch display window that pops up (can be different to above)
int displayFontSize = 20; //这个可以和上边一样字体大小即可
在找到这行:中文转Unicode编码
// Here we specify particular individual Unicodes to be included (appended at end of selected range)
static final int[] specificUnicodes = {
0x6e29

本文详细介绍了如何在TFT_eSPI库中使用Processing和Mixly自定义字体,包括下载工具、设置字体参数、转换Unicode编码及创建.h字库文件的过程。

4128

被折叠的 条评论
为什么被折叠?



