Pop\Font\TrueType\Table\Hmtx::__construct PHP Метод

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

Instantiate a TTF 'hmtx' table object.
public __construct ( AbstractFont $font ) : Hmtx
$font Pop\Font\AbstractFont
Результат Hmtx
    public function __construct(\Pop\Font\AbstractFont $font)
    {
        $bytePos = $font->tableInfo['hmtx']->offset;
        for ($i = 0; $i < $font->numberOfHMetrics; $i++) {
            $ary = unpack('nglyphWidth/', $font->read($bytePos, 2));
            $this->glyphWidths[$i] = $font->shiftToSigned($ary['glyphWidth']);
            $bytePos += 4;
        }
        while (count($this->glyphWidths) < $font->numberOfGlyphs) {
            $this->glyphWidths[] = end($this->glyphWidths);
        }
    }