Pop\Pdf\Parser\Font::__construct PHP Метод

__construct() публичный Метод

Instantiate a font parser object to be used by Pop_Pdf.
public __construct ( string $fle, integer $fi, integer $oi, boolean $comp = false ) : Font
$fle string
$fi integer
$oi integer
$comp boolean
Результат Font
    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();
    }