1. Use the sfnttool tool. sfnttool is a java tar package. The download address is Alibaba Cloud Disk.
2. Unzip after downloading, open powershell in the download folder for windows, and run the following commands directly in the current folder for linux (the java runtime environment is required, and the configuration method of the Java environment is searched by yourself)
java -jar sfnttool.jar -s '测试文字' 源字体.ttf 压缩后的字体.ttf
The following content appears to indicate that it can be used normally
java -jar sfnttool.jar -h subset [-?|-h|-help] [-b] [-s string] fontfile outfile prototype font subsetter -?,-help print this help information -s,-string string to subset -b,-bench benchmark (run 10000 iterations)
…
The post PHP+java to dynamically generate fonts first appeared on Lenix Blog .
This article is reprinted from https://blog.p2hp.com/archives/9805
This site is for inclusion only, and the copyright belongs to the original author.