function &create($typeface, $encoding, $font_resolver, &$error_message) { $font = new Font(); $font->underline_position = 0; $font->underline_thickness = 0; $font->ascender; $font->descender; $font->char_widths = array(); $font->bbox = array(); global $g_last_assigned_font_id; $g_last_assigned_font_id++; $font->name = "font" . $g_last_assigned_font_id; // Get and load the metrics file $afm = $font_resolver->get_afm_mapping($typeface); if (!$font->_parse_afm($afm, $typeface, $encoding)) { $error_message = $font->error_message(); $dummy = null; return $dummy; } return $font; }