donation/vendor/phenx/php-font-lib
2020-11-23 15:46:19 +05:30
..
maps GOWTHAM 2020-11-23 15:46:19 +05:30
sample-fonts GOWTHAM 2020-11-23 15:46:19 +05:30
src/FontLib GOWTHAM 2020-11-23 15:46:19 +05:30
tests/FontLib GOWTHAM 2020-11-23 15:46:19 +05:30
.gitattributes GOWTHAM 2020-11-23 15:46:19 +05:30
.gitignore GOWTHAM 2020-11-23 15:46:19 +05:30
.htaccess GOWTHAM 2020-11-23 15:46:19 +05:30
.travis.yml GOWTHAM 2020-11-23 15:46:19 +05:30
bower.json GOWTHAM 2020-11-23 15:46:19 +05:30
composer.json GOWTHAM 2020-11-23 15:46:19 +05:30
index.php GOWTHAM 2020-11-23 15:46:19 +05:30
LICENSE GOWTHAM 2020-11-23 15:46:19 +05:30
phpunit.xml.dist GOWTHAM 2020-11-23 15:46:19 +05:30
README.md GOWTHAM 2020-11-23 15:46:19 +05:30

PHP Font Lib

Build Status

This library can be used to:

  • Read TrueType, OpenType (with TrueType glyphs), WOFF font files
  • Extract basic info (name, style, etc)
  • Extract advanced info (horizontal metrics, glyph names, glyph shapes, etc)
  • Make an Adobe Font Metrics (AFM) file from a font

You can find a demo GUI here.

This project was initiated by the need to read font files in the DOMPDF project.

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>';