Forum


Replies: 2   Views: 2311
Class 'phpdocx\libs\font_metrics' not found
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 29-01-2019 - 07:56

Hello,

That error appears when trying to use a not supported font family. Although the next release of phpdocx will remove it, you can update the method replacing this line:

$font = Font_Metrics::get_font($family, $subtype);

with:

$font = $family;

And:

$family = null;
if ($DEBUGCSS)  print '(default)';
$font = Font_Metrics::get_font($family, $subtype);

with:

$family = null;
//if ($DEBUGCSS)  print '(default)';
$font = $family;

Also remove the Exception in the same method:

throw new Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] ."'");

Regards.