/** * Constructor * * Instantiate a Type1 font file object based on a pre-existing font file on disk. * * @param string $font * @return \Pop\Font\Type1 */ public function __construct($font) { parent::__construct($font); $dir = realpath($this->dir); if (strtolower($this->ext) == 'pfb') { $this->pfbPath = $this->fullpath; $this->parsePfb($this->fullpath); if (file_exists($dir . DIRECTORY_SEPARATOR . $this->filename . '.afm')) { $this->afmPath = $dir . DIRECTORY_SEPARATOR . $this->filename . '.afm'; } else { if (file_exists($dir . DIRECTORY_SEPARATOR . $this->filename . '.AFM')) { $this->afmPath = $dir . DIRECTORY_SEPARATOR . $this->filename . '.AFM'; } } if (null !== $this->afmPath) { $this->parseAfm($this->afmPath); } } else { if (strtolower($this->ext) == 'afm') { $this->afmPath = $this->fullpath; $this->parseAfm($this->afmPath); if (file_exists($dir . DIRECTORY_SEPARATOR . $this->filename . '.pfb')) { $this->pfbPath = $dir . DIRECTORY_SEPARATOR . $this->filename . '.pfb'; } else { if (file_exists($dir . DIRECTORY_SEPARATOR . $this->filename . '.PFB')) { $this->pfbPath = $dir . DIRECTORY_SEPARATOR . $this->filename . '.PFB'; } } if (null !== $this->pfbPath) { $this->parsePfb($this->pfbPath); } } } }
/** * Constructor * * Instantiate a TrueType font file object based on a pre-existing font file on disk. * * @param string $font * @return TrueType */ public function __construct($font) { parent::__construct($font); $this->parseTtfTable(); $this->parseName(); $this->parseCommonTables(); $this->parseRequiredTables(); }