Ejemplo n.º 1
0
 /**
  * Load information about a font from its key name.
  *
  * @param  string  $fontkey  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_' . ucfirst(strtolower($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;
 }