private function getFont($family, $style) { $map = array("serif" => "Times", "sans-serif" => "Helvetica", "fantasy" => "Symbol", "cursive" => "serif", "monospance" => "Courier"); $family = strtolower($family); if (isset($map[$family])) { $family = $map[$family]; } return $this->canvas->load_font($family, "unicode", "fontstyle={$style}"); }