f166ced15e6220c602c61a3cee89433d99479e67
[yaffs-website] / vendor / phenx / php-font-lib / README.md
1 # PHP Font Lib
2
3 [![Build Status](https://travis-ci.org/PhenX/php-font-lib.svg?branch=master)](https://travis-ci.org/PhenX/php-font-lib)
4
5
6 This library can be used to:
7  * Read TrueType, OpenType (with TrueType glyphs), WOFF font files
8  * Extract basic info (name, style, etc)
9  * Extract advanced info (horizontal metrics, glyph names, glyph shapes, etc)
10  * Make an Adobe Font Metrics (AFM) file from a font
11
12 You can find a demo GUI [here](http://pxd.me/php-font-lib/www/font_explorer.html).
13
14 This project was initiated by the need to read font files in the [DOMPDF project](https://github.com/dompdf/dompdf).
15
16 Usage Example
17 -------------
18
19 ```
20 $font = \FontLib\Font::load('../../fontfile.ttf');
21 $font->parse();  // for getFontWeight() to work this call must be done first!
22 echo $font->getFontName() .'<br>';
23 echo $font->getFontSubfamily() .'<br>';
24 echo $font->getFontSubfamilyID() .'<br>';
25 echo $font->getFontFullName() .'<br>';
26 echo $font->getFontVersion() .'<br>';
27 echo $font->getFontWeight() .'<br>';
28 echo $font->getFontPostscriptName() .'<br>';
29 ```