protected function parseCommonTables()
{
// head
if (isset($this->tableInfo['head'])) {
$this->tables['head'] = new TrueType\Table\Head($this);
$this->unitsPerEm = $this->tables['head']->unitsPerEm;
$this->tables['head']->xMin = $this->toEmSpace($this->tables['head']->xMin);
$this->tables['head']->yMin = $this->toEmSpace($this->tables['head']->yMin);
$this->tables['head']->xMax = $this->toEmSpace($this->tables['head']->xMax);
$this->tables['head']->yMax = $this->toEmSpace($this->tables['head']->yMax);
$this->bBox = new \ArrayObject(array('xMin' => $this->tables['head']->xMin, 'yMin' => $this->tables['head']->yMin, 'xMax' => $this->tables['head']->xMax, 'yMax' => $this->tables['head']->yMax), \ArrayObject::ARRAY_AS_PROPS);
$this->header = $this->tables['head'];
}
// hhea
if (isset($this->tableInfo['hhea'])) {
$this->tables['hhea'] = new TrueType\Table\Hhea($this);
$this->ascent = $this->tables['hhea']->ascent;
$this->descent = $this->tables['hhea']->descent;
$this->capHeight = $this->ascent + $this->descent;
$this->numberOfHMetrics = $this->tables['hhea']->numberOfHMetrics;
}
// maxp
if (isset($this->tableInfo['maxp'])) {
$this->tables['maxp'] = new TrueType\Table\Maxp($this);
$this->numberOfGlyphs = $this->tables['maxp']->numberOfGlyphs;
}
// post
if (isset($this->tableInfo['post'])) {
$this->tables['post'] = new TrueType\Table\Post($this);
if ($this->tables['post']->italicAngle != 0) {
$this->flags->isItalic = true;
$this->italicAngle = $this->tables['post']->italicAngle;
}
if ($this->tables['post']->fixed != 0) {
$this->flags->isFixedPitch = true;
}
}
// hmtx
if (isset($this->tableInfo['hmtx'])) {
$this->tables['hmtx'] = new TrueType\Table\Hmtx($this);
$this->glyphWidths = $this->tables['hmtx']->glyphWidths;
if (isset($this->glyphWidths[0])) {
$this->missingWidth = round(1000 / $this->unitsPerEm * $this->glyphWidths[0]);
}
foreach ($this->glyphWidths as $key => $value) {
$this->glyphWidths[$key] = round(1000 / $this->unitsPerEm * $value);
}
}
// cmap
if (isset($this->tableInfo['cmap'])) {
$this->tables['cmap'] = new TrueType\Table\Cmap($this);
}
}