File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,18 @@ This library can be used to:
1212You can find a demo GUI [ here] ( http://pxd.me/php-font-lib/www/font_explorer.html ) .
1313
1414This 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+ ```
You can’t perform that action at this time.
0 commit comments