/** * Parses header table (head) and sticks it in the indicated font */ function get_head_table($font) { if ($this->head_table != '') { return $this->head_table; } $head =& $font->tables['head']; $fh = $font->open(); fseek($fh, $head->offset); // see http://www.microsoft.com/typography/otspec/head.htm $head = new OTTTFontHEAD(); $head->Table_version_number = FileRead::read_Fixed($fh); $head->fontRevision = FileRead::read_Fixed($fh); $head->checkSumAdjustment = FileRead::read_ULONG($fh); $head->magicNumber = FileRead::read_ULONG($fh); $head->flags = FileRead::read_USHORT($fh); $head->unitsPerEm = FileRead::read_USHORT($fh); $head->created = FileRead::read_LONGDATETIME($fh); $head->modified = FileRead::read_LONGDATETIME($fh); $head->xMin = FileRead::read_SHORT($fh); $head->yMin = FileRead::read_SHORT($fh); $head->xMax = FileRead::read_SHORT($fh); $head->yMax = FileRead::read_SHORT($fh); $head->macStyle = FileRead::read_USHORT($fh); $head->lowestRecPPEM = FileRead::read_USHORT($fh); $head->fontDirectionHint = FileRead::read_SHORT($fh); $head->indexToLocFormat = FileRead::read_SHORT($fh); $head->glyphDataFormat = FileRead::read_SHORT($fh); $this->head_table = $head; fclose($fh); return $this->get_head_table($font); }