/** * Creates Font. * * @param string $fontName * @param string $fontDirectory * * @return Font * @throws \Exception */ private function createFont($fontName, $fontDirectory) { $font = new Font(); $fileName = $this->getFileName($fontName, $fontDirectory); $fileCollection = file($fileName); $font->setFileCollection($fileCollection); $font->setName($fontName); $font = $this->setFontParameters($font); $this->setCurrentFont($font); return $font; }