Horde_Pdf_Writer::_getFontFile PHP Method

_getFontFile() protected static method

Load information about a font from its key name.
protected static _getFontFile ( string $fontkey ) : array
$fontkey string Font name key
return array Array of all font widths, including this font.
    protected static function _getFontFile($fontkey)
    {
        if (!isset(self::$_font_widths[$fontkey])) {
            $fontClass = 'Horde_Pdf_Font_' . Horde_String::ucfirst(Horde_String::lower($fontkey));
            if (!class_exists($fontClass)) {
                throw new Horde_Pdf_Exception(sprintf('Could not include font metric class: %s', $fontClass));
            }
            $font = new $fontClass();
            self::$_font_widths = array_merge(self::$_font_widths, $font->getWidths());
            if (!isset(self::$_font_widths[$fontkey])) {
                throw new Horde_Pdf_Exception(sprintf('Could not include font metric class: %s', $fontClass));
            }
        }
        return self::$_font_widths;
    }