예제 #1
0
 /**
  * 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();
 }
예제 #2
0
 /**
  * @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();
 }
예제 #3
0
파일: Header.php 프로젝트: phpfont/opentype
 /**
  * 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();
 }
예제 #4
0
 /**
  * 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();
 }
예제 #5
0
 /**
  * Reads the table from the given stream.
  *
  * @param StreamInterface $stream The stream to read from.
  */
 public function read(StreamInterface $stream)
 {
     $this->version = $stream->readFixed();
 }
예제 #6
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();
     }
 }
예제 #7
0
 /**
  * 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();
 }