public function __construct($fle, $fi, $oi, $comp = false)
{
$this->fontIndex = $fi;
$this->objectIndex = $oi;
$this->fontDescIndex = $oi + 1;
$this->fontFileIndex = $oi + 2;
$this->compress = $comp;
$ext = strtolower(substr($fle, -4));
switch ($ext) {
case '.ttf':
$this->font = new \Pop\Font\TrueType($fle);
break;
case '.otf':
$this->font = new \Pop\Font\TrueType\OpenType($fle);
break;
case '.pfb':
$this->font = new \Pop\Font\Type1($fle);
if (null === $this->font->afmPath) {
throw new Exception('The AFM font file was not found.');
}
break;
default:
throw new Exception('That font type is not supported.');
}
$this->createFontObjects();
}