Pop\Font\AbstractFont::readFixed PHP Метод

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
    public function readFixed($mantissaBits, $fractionBits, $bytes)
    {
        $bitsToRead = $mantissaBits + $fractionBits;
        $number = $this->readInt($bitsToRead >> 3, $bytes) / (1 << $fractionBits);
        return $number;
    }

Usage Example

Пример #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'];
 }
All Usage Examples Of Pop\Font\AbstractFont::readFixed