dompdf / php-font-lib

A library to read, parse, export and make subsets of different types of font files.
GNU Lesser General Public License v2.1
1.73k stars 255 forks source link

Class 'Font_Metrics' not found #22

Closed elimentz closed 9 years ago

elimentz commented 9 years ago

Hi

I'm using dompdf to generate PDFs in my Laravel application. I'm trying to convert a font to so I can use it in a pdf, but there are some issues with it. Initially, I received the "Class 'Font' not found" error, which I was able to solve by downloading the repository and copying it to the right location as marked here on StackOverflow. This solved my issue, but in turn generated a new one: "Class 'Font_Metrics' not found", which I have not been able to solve.

Additional info:

vendor/dompdf/dompdf/load_font.php Arial /fonts/Arial.ttf /fonts/Arial-Bold.ttf /fonts/Arial-Italic.ttf /fonts/Arial-Bold-Italic.ttf

Stack trace:

PHP Fatal error:  Class 'Font_Metrics' not found in vendor/dompdf/dompdf/load_font.php on line 67
PHP Stack trace:
PHP   1. {main}() vendor/dompdf/dompdf/load_font.php:0
PHP   2. call_user_func_array:{vendor/dompdf/dompdf/load_font.php:171}() vendor/dompdf/dompdf/load_font.php:171
PHP   3. install_font_family() vendor/dompdf/dompdf/load_font.php:171

Any help is appreciated

bsweeney commented 9 years ago

When using dompdf make sure you are using the correct version of php-font-lib. With dompdf 0.6.1 you should be using php-font-lib 0.2.2.

elimentz commented 9 years ago

Thx for the quick assist, issue resolved