readFixed() публичный Метод

Static method to read and return a fixed-point number
public readFixed ( integer $mantissaBits, integer $fractionBits, string $bytes ) : integer
$mantissaBits integer
$fractionBits integer
$bytes string
Результат integer
Пример #1
0
 /**
  * Constructor
  *
  * Instantiate a TTF 'post' table object.
  *
  * @param  \Pop\Font\AbstractFont $font
  * @return \Pop\Font\TrueType\Table\Post
  */
 public function __construct(\Pop\Font\AbstractFont $font)
 {
     $bytePos = $font->tableInfo['post']->offset + 4;
     $italicBytes = $font->read($bytePos, 4);
     $this->italicAngle = $font->readFixed(16, 16, $italicBytes);
     $bytePos += 8;
     $ary = unpack('nfixed/', $font->read($bytePos, 2));
     $ary = $font->shiftToSigned($ary);
     $this->fixed = $ary['fixed'];
 }
Пример #2
0
 /**
  * Constructor
  *
  * Instantiate a TTF 'head' table object.
  *
  * @param  \Pop\Font\AbstractFont $font
  * @return \Pop\Font\TrueType\Table\Head
  */
 public function __construct(\Pop\Font\AbstractFont $font)
 {
     $bytePos = $font->tableInfo['head']->offset;
     $tableVersionNumberBytes = $font->read($bytePos, 4);
     $tableVersionNumber = $font->readFixed(16, 16, $tableVersionNumberBytes);
     $bytePos += 4;
     $fontRevisionBytes = $font->read($bytePos, 4);
     $fontRevision = $font->readFixed(16, 16, $fontRevisionBytes);
     $versionArray = array('tableVersionNumber' => $tableVersionNumber, 'fontRevision' => $fontRevision);
     $bytePos += 4;
     $headerArray = unpack('NcheckSumAdjustment/' . 'NmagicNumber/' . 'nflags/' . 'nunitsPerEm', $font->read($bytePos, 12));
     $bytePos += 28;
     $bBox = unpack('nxMin/' . 'nyMin/' . 'nxMax/' . 'nyMax', $font->read($bytePos, 8));
     $bBox = $font->shiftToSigned($bBox);
     $bytePos += 14;
     $indexToLocFormat = unpack('nindexToLocFormat', $font->read($bytePos, 2));
     $headerArray['indexToLocFormat'] = $font->shiftToSigned($indexToLocFormat['indexToLocFormat']);
     $this->headerInfo = array_merge($versionArray, $headerArray, $bBox);
 }