Lines Matching refs:i

216 			for ($i = 1; $i <= $this->numTTCFonts; $i++) {
217 $this->TTCFonts[$i]['offset'] = $this->read_ulong();
234 for ($i = 0; $i < $this->numTables; $i++) {
296 for ($i = 0; $i < $len; $i += 4) {
297 $hi += (ord($data[$i]) << 8) + ord($data[$i + 1]);
298 $lo += (ord($data[$i + 2]) << 8) + ord($data[$i + 3]);
483 for ($i = 0; $i < $numRecords; $i++) {
542 for ($i = 0; $i < count($psName); $i++) {
543 $c = $psName[$i];
755 for ($i = 0; $i < $cmapTableCount; $i++) {
801 // Format 12 CMAP does characters above Unicode BMP i.e. some HKCS characters U+20000 and above
813 for ($i = 0; $i < $nGroups; $i++) {
917 for ($i = 0; $i < $nPairs; $i++) {
1106 for ($i = 0; $i < $MarkSetCount; $i++) {
1109 for ($i = 0; $i < $MarkSetCount; $i++) {
1110 $this->seek($MarkSetOffset[$i]);
1112 $this->MarkGlyphSets[$i] = $this->formatClassArr($glyphs);
1114 $this->mpdf->WriteHTML('<h3>Mark Glyph Set class: ' . $i . '</h3>');
1149 for ($i = 0; $i < $GlyphCount; $i++) {
1150 $gid = $StartGlyph + $i;
1157 for ($i = 0; $i < $tableCount; $i++) {
1189 for ($i = 0; $i < $ScriptCount; $i++) {
1204 for ($i = 0; $i < $LangSysCount; $i++) {
1225 for ($i = 0; $i < $FeatureCount; $i++) {
1236 for ($i = 0; $i < $FeatureCount; $i++) {
1237 $Feature[$i] = ['tag' => $this->read_tag()];
1238 $Feature[$i]['offset'] = $FeatureList_offset + $this->read_ushort();
1240 for ($i = 0; $i < $FeatureCount; $i++) {
1241 $this->seek($Feature[$i]['offset']);
1243 $Feature[$i]['LookupCount'] = $Lookupcount = $this->read_ushort();
1244 $Feature[$i]['LookupListIndex'] = [];
1246 $Feature[$i]['LookupListIndex'][] = $this->read_ushort();
1267 // list of Lookups in order they need to be run i.e. order listed in Lookup table
1312 for ($i = 0; $i < $LookupCount; $i++) {
1313 $Offsets[$i] = $LookupList_offset + $this->read_ushort();
1315 for ($i = 0; $i < $LookupCount; $i++) {
1316 $this->seek($Offsets[$i]);
1317 $GSLookup[$i]['Type'] = $this->read_ushort();
1318 $GSLookup[$i]['Flag'] = $flag = $this->read_ushort();
1319 $GSLookup[$i]['SubtableCount'] = $SubtableCount[$i] = $this->read_ushort();
1320 for ($c = 0; $c < $SubtableCount[$i]; $c++) {
1321 $GSLookup[$i]['Subtables'][$c] = $Offsets[$i] + $this->read_ushort();
1325 $GSLookup[$i]['MarkFilteringSet'] = $this->read_ushort();
1327 // else { $GSLookup[$i]['MarkFilteringSet'] = ''; }
1329 if ($GSLookup[$i]['Type'] == 7) {
1331 for ($c = 0; $c < $SubtableCount[$i]; $c++) {
1332 $this->seek($GSLookup[$i]['Subtables'][$c]);
1335 $GSLookup[$i]['Subtables'][$c] = $GSLookup[$i]['Subtables'][$c] + $this->read_ulong();
1337 $GSLookup[$i]['Type'] = $type;
1345 for ($i = 0; $i < $LookupCount; $i++) {
1346 for ($c = 0; $c < $GSLookup[$i]['SubtableCount']; $c++) {
1347 $this->seek($GSLookup[$i]['Subtables'][$c]);
1350 if ($GSLookup[$i]['Type'] == 5 && $PosFormat == 3) {
1353 if ($GSLookup[$i]['Type'] == 6 && $PosFormat == 3) {
1358 // NB Coverage only looks at glyphs for position 1 (i.e. 5.3 and 6.3) // NEEDS TO READ ALL ********************
1359 $Coverage = $GSLookup[$i]['Subtables'][$c] + $this->read_ushort();
1362 $this->GSLuCoverage[$i][$c] = implode('|', $glyphs);
1393 for ($i = 0; $i < $LookupCount; $i++) {
1394 $Lookup[$i]['offset'] = $LookupList_offset + $this->read_ushort();
1396 for ($i = 0; $i < $LookupCount; $i++) {
1397 $this->seek($Lookup[$i]['offset']);
1398 $Lookup[$i]['Type'] = $this->read_ushort();
1399 $Lookup[$i]['Flag'] = $flag = $this->read_ushort();
1400 $Lookup[$i]['SubtableCount'] = $this->read_ushort();
1401 for ($c = 0; $c < $Lookup[$i]['SubtableCount']; $c++) {
1402 $Lookup[$i]['Subtable'][$c]['Offset'] = $Lookup[$i]['offset'] + $this->read_ushort();
1406 $Lookup[$i]['MarkFilteringSet'] = $this->read_ushort();
1408 $Lookup[$i]['MarkFilteringSet'] = '';
1412 if ($Lookup[$i]['Type'] == 7) {
1414 for ($c = 0; $c < $Lookup[$i]['SubtableCount']; $c++) {
1415 $this->seek($Lookup[$i]['Subtable'][$c]['Offset']);
1418 $Lookup[$i]['Subtable'][$c]['Offset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ulong();
1420 $Lookup[$i]['Type'] = $type;
1427 for ($i = 0; $i < $LookupCount; $i++) {
1428 for ($c = 0; $c < $Lookup[$i]['SubtableCount']; $c++) {
1429 $this->seek($Lookup[$i]['Subtable'][$c]['Offset']);
1431 $Lookup[$i]['Subtable'][$c]['Format'] = $SubstFormat;
1442 7 Extension Substitution Extension mechanism for other substitutions (i.e. this excludes the Extension type substitution itself)
1447 if ($Lookup[$i]['Type'] == 1) {
1448 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1450 $Lookup[$i]['Subtable'][$c]['DeltaGlyphID'] = $this->read_short();
1455 $Lookup[$i]['Subtable'][$c]['Glyphs'][] = $this->read_ushort();
1461 if ($Lookup[$i]['Type'] == 2) {
1462 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1463 $Lookup[$i]['Subtable'][$c]['SequenceCount'] = $SequenceCount = $this->read_short();
1465 $Lookup[$i]['Subtable'][$c]['Sequences'][$s]['Offset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_short();
1469 $this->seek($Lookup[$i]['Subtable'][$c]['Sequences'][$s]['Offset']);
1470 $Lookup[$i]['Subtable'][$c]['Sequences'][$s]['GlyphCount'] = $this->read_short();
1471 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['Sequences'][$s]['GlyphCount']; $g++) {
1472 $Lookup[$i]['Subtable'][$c]['Sequences'][$s]['SubstituteGlyphID'][] = $this->read_ushort();
1477 if ($Lookup[$i]['Type'] == 3) {
1478 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1479 $Lookup[$i]['Subtable'][$c]['AlternateSetCount'] = $AlternateSetCount = $this->read_short();
1481 $Lookup[$i]['Subtable'][$c]['AlternateSets'][$s]['Offset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_short();
1486 $this->seek($Lookup[$i]['Subtable'][$c]['AlternateSets'][$s]['Offset']);
1487 $Lookup[$i]['Subtable'][$c]['AlternateSets'][$s]['GlyphCount'] = $this->read_short();
1488 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['AlternateSets'][$s]['GlyphCount']; $g++) {
1489 $Lookup[$i]['Subtable'][$c]['AlternateSets'][$s]['SubstituteGlyphID'][] = $this->read_ushort();
1494 if ($Lookup[$i]['Type'] == 4) {
1495 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1496 $Lookup[$i]['Subtable'][$c]['LigSetCount'] = $LigSetCount = $this->read_short();
1498 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Offset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_short();
1502 $this->seek($Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Offset']);
1503 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigCount'] = $this->read_short();
1504 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigCount']; $g++) {
1505 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigatureOffset'][$g] = $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Offset'] + $this->read_ushort();
1509 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigCount']; $g++) {
1511 $this->seek($Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigatureOffset'][$g]);
1512 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['LigGlyph'] = $this->read_ushort();
1513 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['CompCount'] = $this->read_ushort();
1514 for ($l = 1; $l < $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['CompCount']; $l++) {
1515 $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['GlyphID'][$l] = $this->read_ushort();
1521 if ($Lookup[$i]['Type'] == 5) {
1524 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1525 $Lookup[$i]['Subtable'][$c]['SubRuleSetCount'] = $SubRuleSetCount = $this->read_short();
1527 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['Offset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_short();
1531 $this->seek($Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['Offset']);
1532 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleCount'] = $this->read_short();
1533 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleCount']; $g++) {
1534 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleOffset'][$g] = $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['Offset'] + $this->read_ushort();
1539 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleCount']; $g++) {
1541 $this->seek($Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleOffset'][$g]);
1543 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['GlyphCount'] = $this->read_ushort();
1544 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['SubstCount'] = $this->read_ushort();
1546 for ($l = 1; $l < $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['GlyphCount']; $l++) {
1547 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['Input'][$l] = $this->read_ushort();
1550 for ($l = 0; $l < $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['SubstCount']; $l++) {
1551 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['SubstLookupRecord'][$l]['SequenceIndex'] = $this->read_ushort();
1552 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$g]['SubstLookupRecord'][$l]['LookupListIndex'] = $this->read_ushort();
1559 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1560 $Lookup[$i]['Subtable'][$c]['ClassDefOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1561 $Lookup[$i]['Subtable'][$c]['SubClassSetCnt'] = $this->read_ushort();
1562 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['SubClassSetCnt']; $b++) {
1565 $Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][] = 0;
1567 $Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $offset;
1571 throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Lookup[$i]['Type'] . ", Format " . $SubstFormat . " not supported (ttfontsuni.php).");
1576 if ($Lookup[$i]['Type'] == 6) {
1579 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1580 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetCount'] = $this->read_ushort();
1581 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetCount']; $b++) {
1582 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetOffset'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1587 $Lookup[$i]['Subtable'][$c]['CoverageTableOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1588 $Lookup[$i]['Subtable'][$c]['BacktrackClassDefOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1589 $Lookup[$i]['Subtable'][$c]['InputClassDefOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1590 $Lookup[$i]['Subtable'][$c]['LookaheadClassDefOffset'] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1591 $Lookup[$i]['Subtable'][$c]['ChainSubClassSetCnt'] = $this->read_ushort();
1592 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['ChainSubClassSetCnt']; $b++) {
1595 $Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][] = $offset;
1597 $Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $offset;
1603 $Lookup[$i]['Subtable'][$c]['BacktrackGlyphCount'] = $this->read_ushort();
1604 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['BacktrackGlyphCount']; $b++) {
1605 $Lookup[$i]['Subtable'][$c]['CoverageBacktrack'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1607 $Lookup[$i]['Subtable'][$c]['InputGlyphCount'] = $this->read_ushort();
1608 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['InputGlyphCount']; $b++) {
1609 $Lookup[$i]['Subtable'][$c]['CoverageInput'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1611 $Lookup[$i]['Subtable'][$c]['LookaheadGlyphCount'] = $this->read_ushort();
1612 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['LookaheadGlyphCount']; $b++) {
1613 $Lookup[$i]['Subtable'][$c]['CoverageLookahead'][] = $Lookup[$i]['Subtable'][$c]['Offset'] + $this->read_ushort();
1615 $Lookup[$i]['Subtable'][$c]['SubstCount'] = $this->read_ushort();
1616 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['SubstCount']; $b++) {
1617 $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['SequenceIndex'] = $this->read_ushort();
1618 $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['LookupListIndex'] = $this->read_ushort();
1628 throw new \Mpdf\Exception\FontException("Lookup Type " . $Lookup[$i]['Type'] . " not supported.");
1641 for ($i = 0; $i < $LookupCount; $i++) {
1642 for ($c = 0; $c < $Lookup[$i]['SubtableCount']; $c++) {
1643 $SubstFormat = $Lookup[$i]['Subtable'][$c]['Format'];
1646 if ($Lookup[$i]['Type'] == 1) {
1647 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1654 if ($this->_checkGSUBignore($Lookup[$i]['Flag'], $replace[0], $Lookup[$i]['MarkFilteringSet'])) {
1657 if (isset($Lookup[$i]['Subtable'][$c]['DeltaGlyphID'])) { // Format 1
1658 $substitute[] = unicode_hex($this->glyphToChar[($glyphs[$g] + $Lookup[$i]['Subtable'][$c]['DeltaGlyphID'])][0]);
1660 $substitute[] = unicode_hex($this->glyphToChar[($Lookup[$i]['Subtable'][$c]['Glyphs'][$g])][0]);
1662 $Lookup[$i]['Subtable'][$c]['subs'][] = ['Replace' => $replace, 'substitute' => $substitute];
1666 if ($Lookup[$i]['Type'] == 2) {
1667 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1674 if ($this->_checkGSUBignore($Lookup[$i]['Flag'], $replace[0], $Lookup[$i]['MarkFilteringSet'])) {
1677 if (!isset($Lookup[$i]['Subtable'][$c]['Sequences'][$g]['SubstituteGlyphID']) || count($Lookup[$i]['Subtable'][$c]['Sequences'][$g]['SubstituteGlyphID']) == 0) {
1680 foreach ($Lookup[$i]['Subtable'][$c]['Sequences'][$g]['SubstituteGlyphID'] as $sub) {
1683 $Lookup[$i]['Subtable'][$c]['subs'][] = ['Replace' => $replace, 'substitute' => $substitute];
1687 if ($Lookup[$i]['Type'] == 3) {
1688 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1695 if ($this->_checkGSUBignore($Lookup[$i]['Flag'], $replace[0], $Lookup[$i]['MarkFilteringSet'])) {
1699 for ($gl = 0; $gl < $Lookup[$i]['Subtable'][$c]['AlternateSets'][$g]['GlyphCount']; $gl++) {
1700 $gid = $Lookup[$i]['Subtable'][$c]['AlternateSets'][$g]['SubstituteGlyphID'][$gl];
1704 //$gid = $Lookup[$i]['Subtable'][$c]['AlternateSets'][$g]['SubstituteGlyphID'][0];
1707 $Lookup[$i]['Subtable'][$c]['subs'][] = ['Replace' => $replace, 'substitute' => $substitute];
1709 if ($i == 166) {
1710 print_r($Lookup[$i]['Subtable']);
1715 if ($Lookup[$i]['Type'] == 4) {
1716 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1718 $LigSetCount = $Lookup[$i]['Subtable'][$c]['LigSetCount'];
1720 for ($g = 0; $g < $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['LigCount']; $g++) {
1725 if ($this->_checkGSUBignore($Lookup[$i]['Flag'], $replace[0], $Lookup[$i]['MarkFilteringSet'])) {
1728 for ($l = 1; $l < $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['CompCount']; $l++) {
1729 $gid = $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['GlyphID'][$l];
1732 if ($this->_checkGSUBignore($Lookup[$i]['Flag'], $rpl, $Lookup[$i]['MarkFilteringSet'])) {
1737 $gid = $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['LigGlyph'];
1739 $Lookup[$i]['Subtable'][$c]['subs'][] = ['Replace' => $replace, 'substitute' => $substitute, 'CompCount' => $Lookup[$i]['Subtable'][$c]['LigSet'][$s]['Ligature'][$g]['CompCount']];
1744 if ($Lookup[$i]['Type'] == 5) {
1747 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1748 $Lookup[$i]['Subtable'][$c]['CoverageGlyphs'] = $CoverageGlyphs = $this->_getCoverage();
1750 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['SubRuleSetCount']; $s++) {
1751 $SubRuleSet = $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s];
1752 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['FirstGlyph'] = $CoverageGlyphs[$s];
1753 for ($r = 0; $r < $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRuleCount']; $r++) {
1754 $GlyphCount = $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$r]['GlyphCount'];
1756 $glyphID = $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$r]['Input'][$g];
1757 $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'][$r]['InputGlyphs'][$g] = unicode_hex($this->glyphToChar[$glyphID][0]);
1764 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1765 $Lookup[$i]['Subtable'][$c]['CoverageGlyphs'] = $CoverageGlyphs = $this->_getCoverage();
1767 $InputClasses = $this->_getClasses($Lookup[$i]['Subtable'][$c]['ClassDefOffset']);
1768 $Lookup[$i]['Subtable'][$c]['InputClasses'] = $InputClasses;
1770 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['SubClassSetCnt']; $s++) {
1771 if ($Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][$s] > 0) {
1772 $this->seek($Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][$s]);
1773 $Lookup[$i]['Subtable'][$c]['SubClassSet'][$s]['SubClassRuleCnt'] = $SubClassRuleCnt = $this->read_ushort();
1776 $SubClassRule[$b] = $Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][$s] + $this->read_ushort();
1777 $Lookup[$i]['Subtable'][$c]['SubClassSet'][$s]['SubClassRule'][$b] = $SubClassRule[$b];
1782 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['SubClassSetCnt']; $s++) {
1783 $SubClassRuleCnt = $Lookup[$i]['Subtable'][$c]['SubClassSet'][$s]['SubClassRuleCnt'];
1785 if ($Lookup[$i]['Subtable'][$c]['SubClassSetOffset'][$s] > 0) {
1786 $this->seek($Lookup[$i]['Subtable'][$c]['SubClassSet'][$s]['SubClassRule'][$b]);
1798 $Lookup[$i]['Subtable'][$c]['SubClassSet'][$s]['SubClassRule'][$b] = $Rule;
1805 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['InputGlyphCount']; $b++) {
1806 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageInput'][$b]);
1808 $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'][] = implode("|", $glyphs);
1816 if ($Lookup[$i]['Type'] == 6) {
1819 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1820 $Lookup[$i]['Subtable'][$c]['CoverageGlyphs'] = $CoverageGlyphs = $this->_getCoverage();
1822 $ChainSubRuleSetCnt = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetCount'];
1825 $this->seek($Lookup[$i]['Subtable'][$c]['ChainSubRuleSetOffset'][$s]);
1826 $ChainSubRuleCnt = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRuleCount'] = $this->read_ushort();
1828 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRuleOffset'][$r] = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetOffset'][$s] + $this->read_ushort();
1832 $ChainSubRuleCnt = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRuleCount'];
1835 $this->seek($Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRuleOffset'][$r]);
1837 $BacktrackGlyphCount = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['BacktrackGlyphCount'] = $this->read_ushort();
1840 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['BacktrackGlyphs'][$g] = unicode_hex($this->glyphToChar[$glyphID][0]);
1843 $InputGlyphCount = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['InputGlyphCount'] = $this->read_ushort();
1846 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['InputGlyphs'][$g] = unicode_hex($this->glyphToChar[$glyphID][0]);
1849 $LookaheadGlyphCount = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['LookaheadGlyphCount'] = $this->read_ushort();
1852 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['LookaheadGlyphs'][$g] = unicode_hex($this->glyphToChar[$glyphID][0]);
1855 $SubstCount = $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['SubstCount'] = $this->read_ushort();
1857 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['SequenceIndex'][$lu] = $this->read_ushort();
1858 $Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'][$r]['LookupListIndex'][$lu] = $this->read_ushort();
1865 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageTableOffset']);
1866 $Lookup[$i]['Subtable'][$c]['CoverageGlyphs'] = $CoverageGlyphs = $this->_getCoverage();
1868 $BacktrackClasses = $this->_getClasses($Lookup[$i]['Subtable'][$c]['BacktrackClassDefOffset']);
1869 $Lookup[$i]['Subtable'][$c]['BacktrackClasses'] = $BacktrackClasses;
1871 $InputClasses = $this->_getClasses($Lookup[$i]['Subtable'][$c]['InputClassDefOffset']);
1872 $Lookup[$i]['Subtable'][$c]['InputClasses'] = $InputClasses;
1874 $LookaheadClasses = $this->_getClasses($Lookup[$i]['Subtable'][$c]['LookaheadClassDefOffset']);
1875 $Lookup[$i]['Subtable'][$c]['LookaheadClasses'] = $LookaheadClasses;
1877 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['ChainSubClassSetCnt']; $s++) {
1878 if ($Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][$s] > 0) {
1879 $this->seek($Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][$s]);
1880 $Lookup[$i]['Subtable'][$c]['ChainSubClassSet'][$s]['ChainSubClassRuleCnt'] = $ChainSubClassRuleCnt = $this->read_ushort();
1883 $ChainSubClassRule[$b] = $Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][$s] + $this->read_ushort();
1884 $Lookup[$i]['Subtable'][$c]['ChainSubClassSet'][$s]['ChainSubClassRule'][$b] = $ChainSubClassRule[$b];
1889 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['ChainSubClassSetCnt']; $s++) {
1890 $ChainSubClassRuleCnt = $Lookup[$i]['Subtable'][$c]['ChainSubClassSet'][$s]['ChainSubClassRuleCnt'];
1892 if ($Lookup[$i]['Subtable'][$c]['ChainSubClassSetOffset'][$s] > 0) {
1893 $this->seek($Lookup[$i]['Subtable'][$c]['ChainSubClassSet'][$s]['ChainSubClassRule'][$b]);
1913 $Lookup[$i]['Subtable'][$c]['ChainSubClassSet'][$s]['ChainSubClassRule'][$b] = $Rule;
1920 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['BacktrackGlyphCount']; $b++) {
1921 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageBacktrack'][$b]);
1923 $Lookup[$i]['Subtable'][$c]['CoverageBacktrackGlyphs'][] = implode("|", $glyphs);
1925 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['InputGlyphCount']; $b++) {
1926 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageInput'][$b]);
1928 $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'][] = implode("|", $glyphs);
1931 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['LookaheadGlyphCount']; $b++) {
1932 $this->seek($Lookup[$i]['Subtable'][$c]['CoverageLookahead'][$b]);
1934 $Lookup[$i]['Subtable'][$c]['CoverageLookaheadGlyphs'][] = implode("|", $glyphs);
1983 foreach ($lul as $i => $tag) {
1987 $html .= '<bookmark level="1" content="' . $tag . ' [#' . $i . ']">';
1989 $html .= 'Lookup #' . $i . ' [tag: <span style="color:#000066;">' . $tag . '</span>]</h5>';
1990 $ignore = $this->_getGSUBignoreString($Lookup[$i]['Flag'], $Lookup[$i]['MarkFilteringSet']);
1995 $Type = $Lookup[$i]['Type'];
1996 $Flag = $Lookup[$i]['Flag'];
2003 for ($c = 0; $c < $Lookup[$i]['SubtableCount']; $c++) {
2010 $SubstFormat = $Lookup[$i]['Subtable'][$c]['Format'];
2013 if ($Lookup[$i]['Type'] == 1) {
2015 for ($s = 0; $s < count($Lookup[$i]['Subtable'][$c]['subs']); $s++) {
2016 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['subs'][$s]['Replace'];
2017 $substitute = $Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute'][0];
2043 if ($Lookup[$i]['Type'] == 2) {
2045 for ($s = 0; $s < count($Lookup[$i]['Subtable'][$c]['subs']); $s++) {
2046 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['subs'][$s]['Replace'];
2047 $substitute = $Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute'];
2073 if ($Lookup[$i]['Type'] == 3) {
2075 for ($s = 0; $s < count($Lookup[$i]['Subtable'][$c]['subs']); $s++) {
2076 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['subs'][$s]['Replace'];
2077 $substitute = $Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute'][0];
2099 if (count($Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute']) > 1) {
2100 for ($alt = 1; $alt < count($Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute']); $alt++) {
2101 $substitute = $Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute'][$alt];
2111 if ($Lookup[$i]['Type'] == 4) {
2113 for ($s = 0; $s < count($Lookup[$i]['Subtable'][$c]['subs']); $s++) {
2114 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['subs'][$s]['Replace'];
2115 $substitute = $Lookup[$i]['Subtable'][$c]['subs'][$s]['substitute'][0];
2141 if ($Lookup[$i]['Type'] == 5) {
2146 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['SubRuleSetCount']; $s++) {
2150 foreach ($Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['SubRule'] as $rctr => $rule) {
2157 $inputGlyphs[0] = $Lookup[$i]['Subtable'][$c]['SubRuleSet'][$s]['FirstGlyph'];
2210 foreach ($Lookup[$i]['Subtable'][$c]['SubClassSet'] as $inputClass => $cscs) {
2218 $inputGlyphs[0] = $Lookup[$i]['Subtable'][$c]['InputClasses'][$inputClass];
2224 $inputGlyphs[$gcl] = $Lookup[$i]['Subtable'][$c]['InputClasses'][$classindex];
2229 $class0excl = implode('|', $Lookup[$i]['Subtable'][$c]['InputClasses']);
2296 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'];
2298 $nInput = $Lookup[$i]['Subtable'][$c]['InputGlyphCount'];
2308 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['SubstCount']; $b++) {
2309 $lup = $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['LookupListIndex'];
2310 $seqIndex = $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['SequenceIndex'];
2347 //print_r($Lookup[$i]);
2351 if ($Lookup[$i]['Type'] == 6) {
2356 for ($s = 0; $s < $Lookup[$i]['Subtable'][$c]['ChainSubRuleSetCount']; $s++) {
2360 $firstInputGlyph = $Lookup[$i]['Subtable'][$c]['CoverageGlyphs'][$s]; // First input gyyph
2361 foreach ($Lookup[$i]['Subtable'][$c]['ChainSubRuleSet'][$s]['ChainSubRule'] as $rctr => $rule) {
2453 foreach ($Lookup[$i]['Subtable'][$c]['ChainSubClassSet'] as $inputClass => $cscs) {
2460 // $Lookup[$i]['Subtable'][$c]['InputClasses'][(class)] e.g. 02E6|02E7|02E8
2461 // $Lookup[$i]['Subtable'][$c]['LookaheadClasses'][(class)]
2462 // $Lookup[$i]['Subtable'][$c]['BacktrackClasses'][(class)]
2468 $inputGlyphs[0] = $Lookup[$i]['Subtable'][$c]['InputClasses'][$inputClass];
2473 $inputGlyphs[$gcl] = $Lookup[$i]['Subtable'][$c]['InputClasses'][$classindex];
2477 $class0excl = implode('|', $Lookup[$i]['Subtable'][$c]['InputClasses']);
2484 $backtrackGlyphs[$gcl] = $Lookup[$i]['Subtable'][$c]['BacktrackClasses'][$classindex];
2493 $lookaheadGlyphs[$gcl] = $Lookup[$i]['Subtable'][$c]['LookaheadClasses'][$classindex];
2584 //print_r($Lookup[$i]['Subtable'][$c]); exit;
2590 $inputGlyphs = $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'];
2592 $nInput = $Lookup[$i]['Subtable'][$c]['InputGlyphCount'];
2594 if ($Lookup[$i]['Subtable'][$c]['BacktrackGlyphCount']) {
2595 $backtrackGlyphs = $Lookup[$i]['Subtable'][$c]['CoverageBacktrackGlyphs'];
2600 if ($Lookup[$i]['Subtable'][$c]['LookaheadGlyphCount']) {
2601 $lookaheadGlyphs = $Lookup[$i]['Subtable'][$c]['CoverageLookaheadGlyphs'];
2624 for ($b = 0; $b < $Lookup[$i]['Subtable'][$c]['SubstCount']; $b++) {
2625 $lup = $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['LookupListIndex'];
2626 $seqIndex = $Lookup[$i]['Subtable'][$c]['SubstLookupRecord'][$b]['SequenceIndex'];
2821 for ($i = 0; $i < $nInput; $i++) {
2822 if ($i > 0) {
2825 if ($i >= $seqIndex && $i < ($seqIndex + $mLen)) {
2826 $str .= "" . $lookupGlyphs[($i - $seqIndex)] . "";
2828 $str .= "" . $inputGlyphs[($i)] . "";
2842 for ($i = 1; $i <= count($inputGlyphs); $i++) {
2843 if ($i > 1) {
2846 $str .= "" . $inputGlyphs[($i - 1)] . "";
2860 for ($i = (count($backtrackGlyphs) - 1); $i >= 0; $i--) {
2861 $str .= "" . $backtrackGlyphs[$i] . " " . $ignore . " ";
2875 for ($i = 0; $i < count($lookaheadGlyphs); $i++) {
2876 $str .= $ignore . " " . $lookaheadGlyphs[$i] . "";
2987 for ($i = 0; $i < $GlyphCount; $i++) {
2988 $startGlyphID = $StartGlyph + $i;
2989 $endGlyphID = $StartGlyph + $i;
3000 for ($i = 0; $i < $tableCount; $i++) {
3042 for ($i = 0; $i < $ScriptCount; $i++) {
3057 for ($i = 0; $i < $LangSysCount; $i++) {
3078 for ($i = 0; $i < $FeatureCount; $i++) {
3089 for ($i = 0; $i < $FeatureCount; $i++) {
3090 $Feature[$i] = ['tag' => $this->read_tag()];
3091 $Feature[$i]['offset'] = $FeatureList_offset + $this->read_ushort();
3093 for ($i = 0; $i < $FeatureCount; $i++) {
3094 $this->seek($Feature[$i]['offset']);
3096 $Feature[$i]['LookupCount'] = $Lookupcount = $this->read_ushort();
3097 $Feature[$i]['LookupListIndex'] = [];
3099 $Feature[$i]['LookupListIndex'][] = $this->read_ushort();
3121 // list of Lookups in order they need to be run i.e. order listed in Lookup table
3162 for ($i = 0; $i < $LookupCount; $i++) {
3163 $Offsets[$i] = $LookupList_offset + $this->read_ushort();
3165 for ($i = 0; $i < $LookupCount; $i++) {
3166 $this->seek($Offsets[$i]);
3167 $Lookup[$i]['Type'] = $this->read_ushort();
3168 $Lookup[$i]['Flag'] = $flag = $this->read_ushort();
3169 $Lookup[$i]['SubtableCount'] = $SubtableCount[$i] = $this->read_ushort();
3170 for ($c = 0; $c < $SubtableCount[$i]; $c++) {
3171 $Lookup[$i]['Subtables'][$c] = $Offsets[$i] + $this->read_ushort();
3175 $Lookup[$i]['MarkFilteringSet'] = $this->read_ushort();
3177 // else { $Lookup[$i]['MarkFilteringSet'] = ''; }
3179 if ($Lookup[$i]['Type'] == 9) {
3181 for ($c = 0; $c < $SubtableCount[$i]; $c++) {
3182 $this->seek($Lookup[$i]['Subtables'][$c]);
3185 $Lookup[$i]['Subtables'][$c] = $Lookup[$i]['Subtables'][$c] + $this->read_ulong();
3187 $Lookup[$i]['Type'] = $type;
3456 // i.e. Class1Count = 5; Class1 will contain array(indices 1-4);
3462 for ($i = 0; $i < $Class1Count; $i++) {
3478 for ($c1 = 0; $c1 < count($Class1[$i]); $c1++) {
3479 $FirstGlyph = $Class1[$i][$c1];
3545 for ($i = 0; $i < $EntryExitCount; $i++) {
3546 $EntryAnchors[$i] = $this->read_ushort();
3547 $ExitAnchors[$i] = $this->read_ushort();
3552 for ($i = 0; $i < $EntryExitCount; $i++) {
3554 $pdfWidth = $this->mpdf->_getCharWidth($this->mpdf->fonts[$this->fontkey]['cw'], hexdec($Glyphs[$i]));
3555 $EntryAnchor = $EntryAnchors[$i];
3556 $ExitAnchor = $ExitAnchors[$i];
3558 $html .= '<span class="unchanged">' . $this->formatEntity($Glyphs[$i]) . ' </span> ';
3559 $html .= '<span class="unicode"> ' . $this->formatUni($Glyphs[$i]) . ' => ';
3605 for ($i = 0; $i < count($MarkGlyphs); $i++) {
3606 if ($level == 2 && strpos($lcoverage, $MarkGlyphs[$i]) === false) {
3610 $firstMark = $MarkGlyphs[$i];
3613 $html .= ' ' . $this->formatEntity($MarkGlyphs[$i]) . ' ';
3653 for ($i = 0; $i < count($MarkGlyphs); $i++) {
3654 if ($level == 2 && strpos($lcoverage, $MarkGlyphs[$i]) === false) {
3658 $firstMark = $MarkGlyphs[$i];
3662 $MarkRecord[$i] = $this->_getMarkRecord($MarkArray, $i);
3663 //Mark Class is = $MarkRecord[$i]['Class']
3664 $html .= ' ' . $this->formatEntity($MarkGlyphs[$i]) . ' ';
3683 for ($i=0;$i<count($MarkGlyphs);$i++) {
3685 $html .= '<span class="unchanged">'.$this->formatEntity($MarkGlyphs[$i]).'</span>';
3696 if ($offset!= 0 && $class == $MarkRecord[$i]['Class']) {
3724 for ($i = 0; $i < count($Mark1Glyphs); $i++) {
3725 if ($level == 2 && strpos($lcoverage, $Mark1Glyphs[$i]) === false) {
3729 $firstMark = $Mark1Glyphs[$i];
3732 $html .= ' ' . $this->formatEntity($Mark1Glyphs[$i]) . ' ';
4199 for ($i = 0; $i < $segCount; $i++) {
4204 for ($i = 0; $i < $segCount; $i++) {
4208 for ($i = 0; $i < $segCount; $i++) {
4213 for ($i = 0; $i < $segCount; $i++) {