参考链接: https://github.com/littlevgl/lv_utils
Install PHP: sudo apt-get install php7.0-cli
Intall the Image manipulator extension for PHP: sudo apt-get install php7.0-gd
Clone or download the lv_utils repository: git clone https://github.com/littlevgl/lv_utils.git
拷贝字库 arial.ttf 到 lv_utils 目录
执行 php font_conv_core.php "name=arial_20&font=arial.ttf&height=20&bpp=4&uni_first=32&uni_last=126"
那么 airal_20.c 就是你需要的结果
离线
windows下提示:
Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() i
n D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.php:299
Stack trace:
#0 D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.php(101):
height_corr()
#1 {main}
thrown in D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.
php on line 299
离线
windows下提示:
Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() i
n D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.php:299
Stack trace:
#0 D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.php(101):
height_corr()
#1 {main}
thrown in D:\Documents\Downloads\php-7.0.30-nts-Win32-VC14-x64\font_conv_core.
php on line 299
缺php_gd2.dll
首先找下php7安装目录extension下有没有这个文件,
然后去 php.ini 开启: extension=php_gd2.dll
离线