/** * @param int $fontId * @return Font_TrueType */ function getFont($fontId) { $this->parse(); if (!isset($this->collectionOffsets[$fontId])) { throw new OutOfBoundsException(); } if (isset($this->collection[$fontId])) { return $this->collection[$fontId]; } $font = new Font_TrueType(); $font->f = $this->f; $font->setTableOffset($this->collectionOffsets[$fontId]); return $this->collection[$fontId] = $font; }