Пример #1
0
 /**
  * Reads the header from the given stream.
  *
  * @param StreamInterface $stream The stream to read from.
  */
 public function read(StreamInterface $stream)
 {
     $this->tag = $stream->readTag();
     if ($this->tag !== self::TTCF_ID) {
         throw new RuntimeException(sprintf('Invalid id provided, should be 0x%x but we got 0x%x', self::TTCF_ID, $this->tag));
     }
     $this->version = $stream->readFixed();
     $this->numFonts = $stream->readULong();
     for ($i = 0; $i < $this->numFonts; ++$i) {
         $this->offsetTable[] = $stream->readULong();
     }
     if ($this->version > 1) {
         $this->ulDsigTag = $stream->readULong();
         $this->ulDsigLength = $stream->readULong();
         $this->ulDsigOffset = $stream->readULong();
     }
 }