问题
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