Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: Read TrueType/OpenType metadata of the font file

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!

like image 402
Sarah Avatar asked Dec 30 '10 17:12

Sarah


1 Answers

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.

like image 185
dors Avatar answered Oct 02 '22 17:10

dors