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);
}
}