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

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

Method to convert a value to the representative value in EM.
public toEmSpace ( integer $value ) : integer
$value integer
Результат integer
    public function toEmSpace($value)
    {
        return $this->unitsPerEm == 1000 ? $value : ceil($value / $this->unitsPerEm * 1000);
    }

Usage Example

Пример #1
0
 /**
  * Constructor
  *
  * Instantiate a TTF 'hhea' table object.
  *
  * @param  \Pop\Font\AbstractFont $font
  * @return \Pop\Font\TrueType\Table\Hhea
  */
 public function __construct(\Pop\Font\AbstractFont $font)
 {
     $bytePos = $font->tableInfo['hhea']->offset + 4;
     $ary = unpack('nascent/' . 'ndescent', $font->read($bytePos, 4));
     $ary = $font->shiftToSigned($ary);
     $this->ascent = $font->toEmSpace($ary['ascent']);
     $this->descent = $font->toEmSpace($ary['descent']);
     $bytePos = $font->tableInfo['hhea']->offset + 34;
     $ary = unpack('nnumberOfHMetrics/', $font->read($bytePos, 2));
     $this->numberOfHMetrics = $ary['numberOfHMetrics'];
 }
All Usage Examples Of Pop\Font\AbstractFont::toEmSpace