/** * Note that typeface is not a font file name; example of typeface * name could be 'Times-Roman' or 'ArialUnicodeMS'. Note that * typeface names are for internal use only, as they do not * correspond to any system font names/parameters; all typeface * names and their relateions to system fonts are defined in html2ps * config * * @param $typeface String name of the font typeface * @param $encoding String * */ function &getTrueType($typeface, $encoding) { if (!isset($this->fonts[$typeface][$encoding])) { global $g_font_resolver_pdf; $fontfile = $g_font_resolver_pdf->ttf_mappings[$typeface]; $font = FontTrueType::create($fontfile, $encoding); if (is_null($font)) { $dummy = null; return $dummy; } $this->fonts[$typeface][$encoding] = $font; } return $this->fonts[$typeface][$encoding]; }
function create($fontfile, $encoding) { $font = new FontTrueType(); $font->_read(TTF_FONTS_REPOSITORY . $fontfile, $encoding); return $font; }