cms-token/@core/vendor/phenx/php-font-lib
mincreng1 062c41b4d3 Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
..
.github/workflows Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
maps Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
src/FontLib Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
.htaccess Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
LICENSE Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
README.md Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
bower.json Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
composer.json Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00
index.php Initial commit: add CMS Launchpad module 2025-04-25 10:11:30 +07:00

README.md

PHPUnit tests

PHP Font Lib

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