/** * Reads the table from the given stream. * * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->version = $stream->readFixed(); $this->scriptList = $stream->readOffset(); $this->featureList = $stream->readOffset(); $this->lookupList = $stream->readOffset(); }
/** * @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(); }
/** * Reads the header from the given stream. * * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->sfntVersion = $stream->readFixed(); $this->numTables = $stream->readUShort(); $this->searchRange = $stream->readUShort(); $this->entrySelector = $stream->readUShort(); $this->rangeShift = $stream->readUShort(); }
/** * Reads the table from the given stream. * * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->version = $stream->readFixed(); $this->numSizes = $stream->readULong(); }
/** * Reads the table from the given stream. * * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->version = $stream->readFixed(); }
/** * 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(); } }
/** * Reads information from the given stream. * * @param StreamInterface $stream The stream to read from. */ public function read(StreamInterface $stream) { $this->tableVersionNumber = $stream->readFixed(); $this->ascender = $stream->readFWord(); $this->descender = $stream->readFWord(); $this->lineGap = $stream->readFWord(); $this->advanceWidthMax = $stream->readUFWord(); $this->minLeftSideBearing = $stream->readFWord(); $this->minRightSideBearing = $stream->readFWord(); $this->xMaxExtent = $stream->readFWord(); $this->caretSlopeRise = $stream->readShort(); $this->caretSlopeRun = $stream->readShort(); $this->caretOffset = $stream->readShort(); // Read reserved values: $stream->readShort(); $stream->readShort(); $stream->readShort(); $stream->readShort(); $this->metricDataFormat = $stream->readShort(); $this->numberOfHMetrics = $stream->readUShort(); }