Skip to content

Commit

Permalink
Merge pull request #54 from winternet-studio/patch-1
Browse files Browse the repository at this point in the history
Added example on how to access basic font information
  • Loading branch information
PhenX authored Feb 11, 2017
2 parents 010c3e0 + e73b5c9 commit 19ad2be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ This library can be used to:
You can find a demo GUI [here](http://pxd.me/php-font-lib/www/font_explorer.html).

This project was initiated by the need to read font files in the [DOMPDF project](https://github.com/dompdf/dompdf).

Usage Example
-------------

```
$font = \FontLib\Font::load('../../fontfile.ttf');
$font->parse(); // for getFontWeight() to work this call must be done first!
echo $font->getFontName() .'<br>';
echo $font->getFontSubfamily() .'<br>';
echo $font->getFontSubfamilyID() .'<br>';
echo $font->getFontFullName() .'<br>';
echo $font->getFontVersion() .'<br>';
echo $font->getFontWeight() .'<br>';
echo $font->getFontPostscriptName() .'<br>';
```

0 comments on commit 19ad2be

Please sign in to comment.