I want to generate an image of a specific font based on the input text. according to the sample on php.net, the correct image cannot be generated. what should I do? Image in the example: My Image: code: {code ...} I used the lnmp one-click package environment. The compilation contains -- with-free-type-dir ,...
I want to generate an image of a specific font based on the input text. according to the sample on php.net, the correct image cannot be generated. what should I do?
Image in the example:
My images:
Code:
I used the lnmp one-click package environment. The compilation contains -- with-free-type-dir,
'./configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir' '--with-freetype-dir=/usr/local/freetype' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--with-gettext' '--disable-fileinfo' '--enable-intl' '--with-xsl'
Free type is also supported:
Update:
After I changed it to simhei. ttf (regular simhei font), it would be displayed normally. why...
Reply content:
I want to generate an image of a specific font based on the input text. according to the sample on php.net, the correct image cannot be generated. what should I do?
Image in the example:
My images:
Code:
I used the lnmp one-click package environment. The compilation contains -- with-free-type-dir,
'./configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir' '--with-freetype-dir=/usr/local/freetype' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--with-gettext' '--disable-fileinfo' '--enable-intl' '--with-xsl'
Free type is also supported:
Update:
After I changed it to simhei. ttf (regular simhei font), it would be displayed normally. why...
Imagettftext supports TrueType fonts and imagepstext supports PostScript Type1 fonts. Therefore, you need to find the corresponding font to take effect.