/** * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->tableVersionNumber = $stream->readFixed(); $this->fontRevision = $stream->readFixed(); $this->checkSumAdjustment = $stream->readULong(); $this->magicNumber = $stream->readULong(); if ($this->magicNumber != self::MAGIC_NUMBER) { throw new \Exception(sprintf('Magic number for head table should be set to 0x%x but we got 0x%x', self::MAGIC_NUMBER, $this->magicNumber)); } $this->flags = $stream->readUShort(); $this->unitsPerEm = $stream->readUShort(); $this->created = $stream->readLongDateTime(); $this->modified = $stream->readLongDateTime(); $this->xMin = $stream->readShort(); $this->yMin = $stream->readShort(); $this->xMax = $stream->readShort(); $this->yMax = $stream->readShort(); $this->macStyle = $stream->readUShort(); $this->lowestRecPPEM = $stream->readUShort(); $this->fontDirectionHint = $stream->readShort(); $this->indexToLocFormat = $stream->readShort(); $this->glyphDataFormat = $stream->readShort(); }