PHP: Read TrueType/OpenType metadata of the font file

时间秒杀一切 提交于 2019-12-21 17:24:01

问题


How to read the fonts details? For example, fonts contain information like copyright, family name, designer, version, and more in their metadata. I would like also the script to be able to count the amount of glyphs in the file, as well as return what languages the font supports. For example, a typical font could contain western, swedish and romain language support, and have hundreds of glyphs. It should support truetype and opentype font files. Thanks in advance for any help on achieving this!


回答1:


I know this is an old thread, but there has been some movement on the topic over on this thread.




回答2:


I would recommend to take a look at php-font-lib @ https://github.com/PhenX/php-font-lib. This has all the features that you have asked for and supports other font formats as well. Look at the demo UI @ http://pxd.me/php-font-lib/www/font_explorer.html to get an idea what kind of information you can get from this library.



来源:https://stackoverflow.com/questions/4564577/php-read-truetype-opentype-metadata-of-the-font-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!