Lines Matching refs:i

313 				for ($i = 0; $i < count($this->OTLdata); $i++) {
314 if ($this->OTLdata[$i]['uni'] == 8204 || $this->OTLdata[$i]['uni'] == 8205) {
315 array_splice($this->OTLdata, $i, 1);
352 // Sets $this->OTLdata[$i]['wordend']=true at possible end of word boundaries
356 // Sets $this->OTLdata[$i]['wordend']=true at possible end of word boundaries
441 for ($i = 0; $i < count($this->OTLdata); $i++) {
443 // Kashida marker is inverse of priority i.e. Priority 1 => 7, Priority 7 => 1.
447 if ($this->OTLdata[$i]['uni'] == 0x0640) {
448 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 8; // Put before the next character
453 elseif ($this->OTLdata[$i]['uni'] == 0xFEB3 || $this->OTLdata[$i]['uni'] == 0xFEB4 || $this->OTLdata[$i]['uni'] == 0xFEBB || $this->OTLdata[$i]['uni'] == 0xFEBC) {
454 $checkpos = $i + 1;
465 elseif ($this->OTLdata[$i]['uni'] == 0xFE94 || $this->OTLdata[$i]['uni'] == 0xFEA2 || $this->OTLdata[$i]['uni'] == 0xFEAA) {
466 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 6;
471 elseif ($this->OTLdata[$i]['uni'] == 0xFE8E || $this->OTLdata[$i]['uni'] == 0xFEC2 || $this->OTLdata[$i]['uni'] == 0xFEDE || $this->OTLdata[$i]['uni'] == 0xFEDA || $this->OTLdata[$i]['uni'] == 0xFB93) {
472 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 5;
478 elseif ($this->OTLdata[$i]['uni'] == 0xFEAE || $this->OTLdata[$i]['uni'] == 0xFEF2 || $this->OTLdata[$i]['uni'] == 0xFEF0 || $this->OTLdata[$i]['uni'] == 0xFEF4 || $this->OTLdata[$i]['uni'] == 0xFBE9 || $this->OTLdata[$i]['uni'] == 0xFBFD || $this->OTLdata[$i]['uni'] == 0xFBFF
480 $checkpos = $i - 1;
491 elseif ($this->OTLdata[$i]['uni'] == 0xFEEE || $this->OTLdata[$i]['uni'] == 0xFECA || $this->OTLdata[$i]['uni'] == 0xFED6 || $this->OTLdata[$i]['uni'] == 0xFED2) {
492 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 3;
505 if (!isset($this->OTLdata[$i]['GPOSinfo']['kashida'])) {
506 if (strpos($this->GSUBdata[$this->GSUBfont]['finals'], $this->OTLdata[$i]['hex']) !== false) { // ANY OTHER FINAL FORM
507 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 2;
508 } elseif (strpos('0FEAE 0FEF0 0FEF2', $this->OTLdata[$i]['hex']) !== false) { // not already included in 5 above
509 $this->OTLdata[$i]['GPOSinfo']['kashida'] = 1;
552 for ($i = 0; $i < count($sub); $i++) {
553 $newinfo[$i] = [];
554 $ucd_record = Ucdn::get_ucd_record($sub[$i]);
555 $newinfo[$i]['general_category'] = $ucd_record[0];
556 $newinfo[$i]['bidi_type'] = $ucd_record[2];
557 $charasstr = $this->unicode_hex($sub[$i]);
559 $newinfo[$i]['group'] = 'M';
561 $newinfo[$i]['group'] = 'C';
563 $newinfo[$i]['uni'] = $sub[$i];
564 $newinfo[$i]['hex'] = $charasstr;
935 for($i=0;$i<count($sub);$i++) {
936 $newinfo[$i] = array();
937 $ucd_record = Ucdn::get_ucd_record($sub[$i]);
938 $newinfo[$i]['general_category'] = $ucd_record[0];
939 $newinfo[$i]['bidi_type'] = $ucd_record[2];
940 $charasstr = $this->unicode_hex($sub[$i]);
941 if (strpos($this->GlyphClassMarks, $charasstr)!==false) { $newinfo[$i]['group'] = 'M'; }
942 else { $newinfo[$i]['group'] = 'C'; }
943 $newinfo[$i]['uni'] = $sub[$i];
944 $newinfo[$i]['hex'] = $charasstr;
991 for ($i = count($this->OTLdata) - 1; $i > 0; $i--) {
993 if (isset($this->OTLdata[$i]['wordend']) && $this->OTLdata[$i]['wordend'] &&
994 isset($this->OTLdata[$i + 1]['uni']) && (!isset($this->OTLdata[$i + 1]['syllable']) || !isset($this->OTLdata[$i + 1]['syllable']) || $this->OTLdata[$i + 1]['syllable'] != $this->OTLdata[$i]['syllable'])) {
995 array_splice($this->OTLdata, $i + 1, 0, $newinfo);
996 $this->_updateLigatureMarks($i, 1);
997 } elseif ($this->OTLdata[$i]['uni'] == 0x2e) { // Word end if Full-stop.
998 array_splice($this->OTLdata, $i + 1, 0, $newinfo);
999 $this->_updateLigatureMarks($i, 1);
1009 for ($i = 0; $i < count($this->OTLdata); $i++) {
1010 if ($this->OTLdata[$i]['uni'] == 8204 || $this->OTLdata[$i]['uni'] == 8205) {
1011 array_splice($this->OTLdata, $i, 1);
1012 $this->_updateLigatureMarks($i, -1);
1087 for ($i = (count($this->OTLdata) - 1); $i >= 0; $i--) {
1088 if (isset($this->Entry[$i]) && isset($this->Entry[$i]['Y']) && $this->Entry[$i]['dir'] == 'RTL') {
1089 $nextbase = $i - 1; // Set as next base ignoring marks (next base reading RTL in logical oder
1094 $diff = $this->Entry[$i]['Y'] - $this->Exit[$nextbase]['Y'];
1100 for ($j = ($i - 1); $j >= $nextbase; $j--) {
1107 if (isset($this->Exit[$i]['X']) && isset($this->Entry[$nextbase]['X'])) {
1108 $adj = -($this->Entry[$i]['X'] - $this->Exit[$nextbase]['X']);
1120 } elseif (strpos($this->GlyphClassMarks, $this->OTLdata[$i]['hex']) !== false) {
1129 for ($i = 0; $i < count($this->OTLdata); $i++) {
1130 if (isset($this->Exit[$i]) && isset($this->Exit[$i]['Y']) && $this->Exit[$i]['dir'] == 'LTR') {
1131 $nextbase = $i + 1; // Set as next base ignoring marks
1136 $diff = $this->Exit[$i]['Y'] - $this->Entry[$nextbase]['Y'];
1142 for ($j = ($i + 1); $j <= $nextbase; $j++) {
1149 if (isset($this->Exit[$i]['X']) && isset($this->Entry[$nextbase]['X'])) {
1150 $adj = -($this->Exit[$i]['X'] - $this->Entry[$nextbase]['X']);
1162 } elseif (strpos($this->GlyphClassMarks, $this->OTLdata[$i]['hex']) !== false) {
1190 for ($i = 0; $i < count($this->schOTLdata[$sch]); $i++) {
1191 if (isset($this->schOTLdata[$sch][$i]['GPOSinfo'])) {
1192 $newGPOSinfo[$ectr] = $this->schOTLdata[$sch][$i]['GPOSinfo'];
1194 $newchar_data[$ectr] = ['bidi_class' => $this->schOTLdata[$sch][$i]['bidi_type'], 'uni' => $this->schOTLdata[$sch][$i]['uni']];
1195 $newgroup .= $this->schOTLdata[$sch][$i]['group'];
1196 $e .= UtfString::code2utf($this->schOTLdata[$sch][$i]['uni']);
1198 $this->mpdf->CurrentFont['subset'][$this->schOTLdata[$sch][$i]['uni']] = $this->schOTLdata[$sch][$i]['uni'];
1232 for ($i = 0; $i < count($m[0]); $i++) {
1233 $t = $m[1][$i];
1245 for ($i = 0; $i < count($m[0]); $i++) {
1246 $t = $m[1][$i];
1258 for ($i = 0; $i < count($m[0]); $i++) {
1259 $t = $m[1][$i];
1262 $usetags .= ' ' . $m[0][$i]; // - may include integer: salt4
1271 for ($i = 0; $i < count($m[0]); $i++) {
1272 $t = $m[1][$i];
1519 // i.e. new spec but GSUB tables have Consonant-Halant in Lookups e.g. FreeSerif, which
1569 // i.e. new spec but GSUB tables have Consonant-Halant in Lookups e.g. FreeSerif, which
1591 // LigatureSet i.e. all starting with the same Glyph $nextGlyph [Consonant]
1719 // i.e. if this is 'salt' alternate may be set to 2
1771 // LigatureSet i.e. all starting with the same first Glyph $currGlyph
2430 for ($i = 0; $i < count($substitute); $i++) {
2431 $uni = $substitute[$i];
2432 $newOTLdata[$i] = [];
2433 $newOTLdata[$i]['uni'] = $uni;
2434 $newOTLdata[$i]['hex'] = $this->unicode_hex($uni);
2443 if (strpos($this->GlyphClassMarks, $newOTLdata[$i]['hex']) !== false) {
2453 $newOTLdata[$i]['bidi_type'] = $bt;
2454 $newOTLdata[$i]['group'] = $gp;
2457 $newOTLdata[$i]['general_category'] = $this->OTLdata[$pos]['general_category'];
2460 $newOTLdata[$i]['indic_category'] = $this->OTLdata[$pos]['indic_category'];
2461 $newOTLdata[$i]['indic_position'] = $this->OTLdata[$pos]['indic_position'];
2463 $newOTLdata[$i]['myanmar_category'] = $this->OTLdata[$pos]['myanmar_category'];
2464 $newOTLdata[$i]['myanmar_position'] = $this->OTLdata[$pos]['myanmar_position'];
2467 $newOTLdata[$i]['mask'] = $this->OTLdata[$pos]['mask'];
2470 $newOTLdata[$i]['syllable'] = $this->OTLdata[$pos]['syllable'];
2498 for ($i = 0; $i < count($GlyphPos); $i++) {
2500 $unistr = $this->OTLdata[$GlyphPos[$i]]['hex'];
2501 if ($this->restrictToSyllable && isset($this->OTLdata[$GlyphPos[$i]]['syllable']) && $this->OTLdata[$GlyphPos[$i]]['syllable'] != $current_syllable) {
2517 for ($i = 1; $i < count($GlyphPos); $i++) {
2519 // $unistr = $this->OTLdata[$GlyphPos[$i]]['hex'];
2523 if (isset($this->assocMarks[$GlyphPos[$i]])) {
2524 $nextMarkAssoc = $this->assocMarks[$GlyphPos[$i]];
2540 unset($this->assocMarks[$GlyphPos[$i]]);
2589 for ($i = 0; $i < count($GlyphPos); $i++) {
2590 if ($i > 0 && isset($this->assocLigs[$GlyphPos[$i]])) { // One of the other components is already a ligature
2591 $nc = $this->assocLigs[$GlyphPos[$i]];
2598 while ((($i == count($GlyphPos) - 1) || (isset($GlyphPos[$i + 1]) && ($GlyphPos[$i] + $ic) < $GlyphPos[$i + 1])) && isset($this->OTLdata[($GlyphPos[$i] + $ic)]) && strpos($this->GlyphClassMarks, $this->OTLdata[($GlyphPos[$i] + $ic)]['hex']) !== false) {
2600 if (isset($this->assocMarks[$GlyphPos[$i] + $ic])) { // One of the inbetween Marks is already associated with a Lig
2602 // if ($this->assocMarks[($GlyphPos[$i]+$ic)]['ligPos'] != ($GlyphPos[$i]+$ic)) { die("Problem #1"); }
2603 $newComp += $this->assocMarks[($GlyphPos[$i] + $ic)]['compID'];
2605 $this->assocMarks[($GlyphPos[$i] + $ic)] = ['compID' => $newComp, 'ligPos' => $pos];
2672 for ($i = count($GlyphPos) - 1; $i > 0; $i--) {
2673 $gpos = $GlyphPos[$i];
2685 for ($i = 0; $i < count($GlyphPos); $i++) {
2686 if ($i > 0 && $p > $GlyphPos[$i]) {
2717 // JOIN TO FOLLOWING LETTER IN LOGICAL ORDER (i.e. AS INITIAL/MEDIAL FORM) = Unicode Left-Joining (+ Dual-Joining + Join_Causing 00640)
2758 /* JOIN TO PREVIOUS LETTER IN LOGICAL ORDER (i.e. AS FINAL/MEDIAL FORM) = Unicode Right-Joining (+ Dual-Joining + Join_Causing) */
2841 for ($i = 0; $i < count($this->OTLdata); $i++) {
2842 $chars[] = $this->OTLdata[$i]['hex'];
2850 for ($i = $max - 1; $i >= 0; $i--) {
2851 $crntChar = $chars[$i];
2852 if ($i > 0) {
2853 $prevChar = hexdec($chars[$i - 1]);
2857 if ($prevChar && isset($this->arabTransparentJoin[$prevChar]) && isset($chars[$i - 2])) {
2858 $prevChar = hexdec($chars[$i - 2]);
2859 if ($prevChar && isset($this->arabTransparentJoin[$prevChar]) && isset($chars[$i - 3])) {
2860 $prevChar = hexdec($chars[$i - 3]);
2861 if ($prevChar && isset($this->arabTransparentJoin[$prevChar]) && isset($chars[$i - 4])) {
2862 $prevChar = hexdec($chars[$i - 4]);
2868 if (isset($chars[$i + 1]) && $chars[$i + 1] && isset($this->arabRightJoining[hexdec($chars[$i + 1])]) && $prevChar && isset($this->arabLeftJoining[$prevChar])) {
2869 $output[] = $this->get_arab_glyphs($crntChar, 1, $chars, $i, $scriptTag, $usetags); // <final> form
2871 $output[] = $this->get_arab_glyphs($crntChar, 0, $chars, $i, $scriptTag, $usetags); // <isolated> form
2888 $output[] = $this->get_arab_glyphs($crntChar, $form, $chars, $i, $scriptTag, $usetags);
2892 for ($i = 0; $i < count($this->OTLdata); $i++) {
2893 $this->OTLdata[$i]['uni'] = hexdec($ra[$i][0]);
2894 $this->OTLdata[$i]['hex'] = $ra[$i][0];
2895 $this->OTLdata[$i]['form'] = $ra[$i][1]; // Actaul form substituted 0=ISOLATED FORM :: 1=FINAL :: 2=INITIAL :: 3=MEDIAL
2899 private function get_arab_glyphs($char, $type, &$chars, $i, $scriptTag, $usetags)
2912 $n = $i - 1;
2914 // not in $this->arabLeftJoining i.e. not a char which can join to the next one
2917 if (isset($chars[$i + 1]) && preg_match('/[\x{0700}-\x{0745}]/u', UtfString::code2utf(hexdec($chars[$n]))) && preg_match('/[\x{0700}-\x{0745}]/u', UtfString::code2utf(hexdec($chars[$i + 1]))) && isset($this->arabGlyphs[$char][4])) {
2920 elseif (!isset($chars[$i + 1]) || !preg_match('/[\x{0700}-\x{0745}]/u', UtfString::code2utf(hexdec($chars[$i + 1])))) {
2950 if (!isset($chars[$i - $ig - $k])) {
2952 } elseif (strpos($v, $chars[$i - $ig - $k]) === false) {
2953 while (strpos($this->arabGlyphs[$char]['ignore'][$retk], $chars[$i - $ig - $k]) !== false) { // ignore
2956 if (!isset($chars[$i - $ig - $k])) {
2958 } elseif (strpos($v, $chars[$i - $ig - $k]) === false) {
2967 if (!isset($chars[$i + $ig + $k])) {
2969 } elseif (strpos($v, $chars[$i + $ig + $k]) === false) {
2970 while (strpos($this->arabGlyphs[$char]['ignore'][$retk], $chars[$i + $ig + $k]) !== false) { // ignore
2973 if (!isset($chars[$i + $ig + $k])) {
2975 } elseif (strpos($v, $chars[$i + $ig + $k]) === false) {
2996 // Sets $this->OTLdata[$i]['wordend']=true at possible end of word boundaries
3014 * Sets $this->OTLdata[$i]['wordend']=true at possible end of word boundaries
3025 // Find all word boundaries and mark end of word $this->OTLdata[$i]['wordend']=true on last character
3399 // i.e. Class1Count = 5; Class1 will contain array(indices 1-4);
3415 for ($i = 0; $i < $Class1Count; $i++) {
3416 if (isset($Class1[$i]) && count($Class1[$i])) {
3417 $FirstClassPos = array_search($FirstGlyph, $Class1[$i]);
3428 // Get ValueRecord[$i][$j]
3429 $offs = ($i * $Class2Count * $sizeOfPair) + ($j * $sizeOfPair);
3561 for ($i = $matchedpos + 1; $i < $ptr; $i++) {
3562 $BaseWidthExtra = $this->mpdf->_getCharWidth($this->mpdf->CurrentFont['cw'], $this->OTLdata[$i]['uni']) * $this->mpdf->CurrentFont['unitsPerEm'] / 1000; // convert back to font design units
3650 for ($i = $matchedpos + 1; $i < $ptr; $i++) {
3651 $LigatureWidthExtra = $this->mpdf->_getCharWidth($this->mpdf->CurrentFont['cw'], $this->OTLdata[$i]['uni']) * $this->mpdf->CurrentFont['unitsPerEm'] / 1000; // convert back to font design units
3738 // However IF Mark2 (first in logical order, i.e. being attached to) is not associated with a base, carry on
4175 for ($i = 0; $i < count($Backtrack); $i++) {
4183 } elseif (!isset($this->OTLdata[$checkpos]) || $this->OTLdata[$checkpos]['uni'] != $Backtrack[$i]) {
4191 for ($i = 1; $i < count($Input); $i++) {
4199 } elseif (isset($this->OTLdata[$checkpos]) && $this->OTLdata[$checkpos]['uni'] == $Input[$i]) {
4207 for ($i = 0; $i < count($Lookahead); $i++) {
4215 } elseif (!isset($this->OTLdata[$checkpos]) || $this->OTLdata[$checkpos]['uni'] != $Lookahead[$i]) {
4235 for ($i = 0; $i < count($Backtrack); $i++) {
4244 elseif (!$Backtrack[$i] && isset($this->OTLdata[$checkpos]) && strpos($bclass0excl, $this->OTLdata[$checkpos]['hex']) !== false) {
4246 } elseif (!isset($this->OTLdata[$checkpos]) || strpos($Backtrack[$i], $this->OTLdata[$checkpos]['hex']) === false) {
4254 for ($i = 1; $i < count($Input); $i++) { // Start at 1 - already matched the first InputGlyph
4263 elseif (!$Input[$i] && isset($this->OTLdata[$checkpos]) && strpos($class0excl, $this->OTLdata[$checkpos]['hex']) === false) {
4265 } elseif (isset($this->OTLdata[$checkpos]) && strpos($Input[$i], $this->OTLdata[$checkpos]['hex']) !== false) {
4273 for ($i = 0; $i < count($Lookahead); $i++) {
4282 elseif (!$Lookahead[$i] && isset($this->OTLdata[$checkpos]) && strpos($lclass0excl, $this->OTLdata[$checkpos]['hex']) !== false) {
4284 } elseif (!isset($this->OTLdata[$checkpos]) || strpos($Lookahead[$i], $this->OTLdata[$checkpos]['hex']) === false) {
4303 for ($i = 0; $i < count($Backtrack); $i++) {
4312 elseif (!$Backtrack[$i] && isset($this->OTLdata[$checkpos]) && isset($bclass0excl[$this->OTLdata[$checkpos]['uni']])) {
4314 } elseif (!isset($this->OTLdata[$checkpos]) || !isset($Backtrack[$i][$this->OTLdata[$checkpos]['uni']])) {
4322 for ($i = 1; $i < count($Input); $i++) { // Start at 1 - already matched the first InputGlyph
4331 elseif (!$Input[$i] && isset($this->OTLdata[$checkpos]) && !isset($class0excl[$this->OTLdata[$checkpos]['uni']])) {
4333 } elseif (isset($this->OTLdata[$checkpos]) && isset($Input[$i][$this->OTLdata[$checkpos]['uni']])) {
4341 for ($i = 0; $i < count($Lookahead); $i++) {
4350 elseif (!$Lookahead[$i] && isset($this->OTLdata[$checkpos]) && isset($lclass0excl[$this->OTLdata[$checkpos]['uni']])) {
4352 } elseif (!isset($this->OTLdata[$checkpos]) || !isset($Lookahead[$i][$this->OTLdata[$checkpos]['uni']])) {
4371 for ($i = 0; $i < $GlyphCount; $i++) {
4372 $GlyphClass[$i]['startGlyphID'] = $StartGlyph + $i;
4373 $GlyphClass[$i]['endGlyphID'] = $StartGlyph + $i;
4374 $GlyphClass[$i]['class'] = $this->read_ushort();
4375 for ($g = $GlyphClass[$i]['startGlyphID']; $g <= $GlyphClass[$i]['endGlyphID']; $g++) {
4376 $GlyphByClass[$GlyphClass[$i]['class']][] = $this->glyphToChar($g);
4381 for ($i = 0; $i < $tableCount; $i++) {
4382 $GlyphClass[$i]['startGlyphID'] = $this->read_ushort();
4383 $GlyphClass[$i]['endGlyphID'] = $this->read_ushort();
4384 $GlyphClass[$i]['class'] = $this->read_ushort();
4385 for ($g = $GlyphClass[$i]['startGlyphID']; $g <= $GlyphClass[$i]['endGlyphID']; $g++) {
4386 $GlyphByClass[$GlyphClass[$i]['class']][] = $this->glyphToChar($g);
4479 // $this->MarkAttachmentType is already adjusted for this i.e. contains all Marks except those in the MarkAttachmentClassDef table
4541 // $this->MarkAttachmentType is already adjusted for this i.e. contains all Marks except those in the MarkAttachmentClassDef table
4611 for ($i = 0; $i < $numchars; ++$i) {
4612 if ($chunkOTLdata['char_data'][$i]['uni'] == 8235) { // RLE
4622 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8234) { // LRE
4632 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8238) { // RLO
4642 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8237) { // LRO
4652 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8236) { // PDF
4663 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 10) { // NEW LINE
4675 $chardir = $chunkOTLdata['char_data'][$i]['bidi_class'];
4678 if (isset($chunkOTLdata['GPOSinfo'][$i])) {
4679 $gpos = $chunkOTLdata['GPOSinfo'][$i];
4683 $chardata[] = ['char' => $chunkOTLdata['char_data'][$i]['uni'], 'level' => $cel, 'type' => $chardir, 'group' => $chunkOTLdata['group'][$i], 'GPOSinfo' => $gpos];
4701 for ($i = 0; $i < $numchars; ++$i) {
4702 $level = $chardata[$i]['level'];
4703 if ($i == 0) {
4706 $left = $chardata[$i - 1]['level'];
4708 if ($i == ($numchars - 1)) {
4711 $right = $chardata[$i + 1]['level'];
4713 $chardata[$i]['sor'] = max($left, $level) % 2 ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
4714 $chardata[$i]['eor'] = max($right, $level) % 2 ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
4723 for ($i = 0; $i < $numchars; ++$i) {
4724 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_NSM) {
4725 if ($i == 0 || $chardata[$i]['level'] != $chardata[$i - 1]['level']) {
4726 $chardata[$i]['type'] = $chardata[$i]['sor'];
4728 $chardata[$i]['type'] = $chardata[($i - 1)]['type'];
4736 for ($i = 0; $i < $numchars; ++$i) {
4737 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN) {
4741 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_AN;
4750 if ($chardata[$i]['level'] != $prevlevel) {
4755 $prevlevel = $chardata[$i]['level'];
4759 for ($i = 0; $i < $numchars; ++$i) {
4760 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_AL) {
4761 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_R;
4766 for ($i = 1; $i < $numchars; ++$i) {
4767 if (($i + 1) < $numchars && $chardata[($i)]['level'] == $chardata[($i + 1)]['level'] && $chardata[($i)]['level'] == $chardata[($i - 1)]['level']) {
4768 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ES && $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_EN && $chardata[($i + 1)]['type'] == Ucdn::BIDI_CLASS_EN) {
4769 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
4770 } elseif ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS && $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_EN && $chardata[($i + 1)]['type'] == Ucdn::BIDI_CLASS_EN) {
4771 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
4772 } elseif ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS && $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_AN && $chardata[($i + 1)]['type'] == Ucdn::BIDI_CLASS_AN) {
4773 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_AN;
4779 for ($i = 0; $i < $numchars; ++$i) {
4780 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ET) {
4781 if ($i > 0 && $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_EN && $chardata[($i)]['level'] == $chardata[($i - 1)]['level']) {
4782 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
4784 $j = $i + 1;
4785 while ($j < $numchars && $chardata[$j]['level'] == $chardata[$i]['level']) {
4787 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
4799 for ($i = 0; $i < $numchars; ++$i) {
4800 if (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ET) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ES) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS)) {
4801 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_ON;
4806 for ($i = 0; $i < $numchars; ++$i) {
4807 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN) {
4808 if ($i == 0) { // Start of Level run
4809 if ($chardata[$i]['sor'] == Ucdn::BIDI_CLASS_L) {
4810 $chardata[$i]['type'] = $chardata[$i]['sor'];
4813 for ($j = $i - 1; $j >= 0; $j--) {
4814 if ($chardata[$j]['level'] != $chardata[$i]['level']) { // Level run boundary
4816 $chardata[$i]['type'] = $chardata[$j + 1]['sor'];
4820 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_L;
4831 for ($i = 0; $i < $numchars; ++$i) {
4832 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ON || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_WS) {
4835 if ($i == 0) { // first char
4836 $left = $chardata[($i)]['sor'];
4837 } elseif ($chardata[($i - 1)]['level'] != $chardata[($i)]['level']) { // run boundary
4838 $left = $chardata[($i)]['sor'];
4839 } elseif ($chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_L) {
4841 } elseif ($chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_R || $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_EN || $chardata[($i - 1)]['type'] == Ucdn::BIDI_CLASS_AN) {
4846 $j = $i;
4865 $chardata[$i]['orig_type'] = $chardata[$i]['type']; // Need to store the original 'WS' for reference in L1 below
4866 $chardata[$i]['type'] = $left;
4872 for ($i = 0; $i < $numchars; ++$i) {
4873 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ON || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_WS) {
4874 $chardata[$i]['type'] = ($chardata[$i]['level'] % 2) ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
4875 $chardata[$i]['orig_type'] = $chardata[$i]['type']; // Need to store the original 'WS' for reference in L1 below
4881 for ($i = 0; $i < $numchars; ++$i) {
4882 $odd = $chardata[$i]['level'] % 2;
4884 if (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_L) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_AN) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN)) {
4885 $chardata[$i]['level'] += 1;
4888 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_R) {
4889 $chardata[$i]['level'] += 1;
4890 } elseif (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_AN) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN)) {
4891 $chardata[$i]['level'] += 2;
4894 $maxlevel = max($chardata[$i]['level'], $maxlevel);
4908 for ($i = ($numchars - 1); $i > 0; $i--) {
4909 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_WS || (isset($chardata[$i]['orig_type']) && $chardata[$i]['orig_type'] == Ucdn::BIDI_CLASS_WS)) {
4910 $chardata[$i]['level'] = $pel;
4922 for ($i = 0; $i < $numchars; ++$i) {
4923 if ($chardata[$i]['level'] >= $j) {
4927 if (isset(Ucdn::$mirror_pairs[$chardata[$i]['char']]) && $chardata[$i]['type'] == Ucdn::BIDI_CLASS_R) {
4928 $chardata[$i]['char'] = Ucdn::$mirror_pairs[$chardata[$i]['char']];
4931 $revarr[] = $chardata[$i];
4939 $ordarray[] = $chardata[$i];
5010 for ($i = 0; $i < $numchars; ++$i) {
5011 if ($chunkOTLdata['char_data'][$i]['uni'] == 8235) { // RLE
5022 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8234) { // LRE
5033 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8238) { // RLO
5044 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8237) { // LRO
5055 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8236) { // PDF
5066 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8294 || $chunkOTLdata['char_data'][$i]['uni'] == 8295 ||
5067 $chunkOTLdata['char_data'][$i]['uni'] == 8296) { // LRI // RLI // FSI
5075 $chardir = $chunkOTLdata['char_data'][$i]['bidi_class'];
5077 $chunkOTLdata['char_data'][$i]['level'] = $cel;
5078 $chunkOTLdata['char_data'][$i]['type'] = $chardir;
5079 $chunkOTLdata['char_data'][$i]['diid'] = $diid;
5083 if ($chunkOTLdata['char_data'][$i]['uni'] == 8296) { // FSI
5086 $i2 = $i;
5121 if ($chunkOTLdata['char_data'][$i]['uni'] == 8294 || $fsi === Ucdn::BIDI_CLASS_L) { // LRI or FSI-L
5124 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8295 || $fsi == Ucdn::BIDI_CLASS_R || $fsi == Ucdn::BIDI_CLASS_AL) { // RLI or FSI-R
5132 $remember[] = ['num' => $chunkOTLdata['char_data'][$i]['uni'], 'cel' => $cel, 'dos' => $dos, 'diid' => $diid];
5138 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 8297) { // PDI
5160 $chardir = $chunkOTLdata['char_data'][$i]['bidi_class'];
5162 $chunkOTLdata['char_data'][$i]['level'] = $cel;
5163 $chunkOTLdata['char_data'][$i]['type'] = $chardir;
5164 $chunkOTLdata['char_data'][$i]['diid'] = $diid;
5166 } elseif ($chunkOTLdata['char_data'][$i]['uni'] == 10) { // NEW LINE
5178 $chardir = $chunkOTLdata['char_data'][$i]['bidi_class'];
5183 $chunkOTLdata['char_data'][$i]['level'] = $cel;
5184 $chunkOTLdata['char_data'][$i]['type'] = $chardir;
5185 $chunkOTLdata['char_data'][$i]['diid'] = $diid;
5226 for ($i = 0; $i < $numchars; ++$i) {
5227 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5232 $i2 = $i;
5246 $level = $chardata[$i]['level'];
5248 $chardata[$i]['sor'] = max($prelevel, $level) % 2 ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
5250 if (($nc == ($numchunks - 1) && $i == ($numchars - 1)) || $level != $right) {
5251 $chardata[$i]['eor'] = max($right, $level) % 2 ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
5269 for ($i = 0; $i < $numchars; ++$i) {
5270 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5273 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_NSM) {
5274 if (isset($chardata[$i]['sor'])) {
5275 $chardata[$i]['type'] = $chardata[$i]['sor'];
5277 $chardata[$i]['type'] = $prevtype;
5280 $prevtype = $chardata[$i]['type'];
5291 for ($i = 0; $i < $numchars; ++$i) {
5292 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5295 if (isset($chardata[$i]['sor'])) {
5296 $laststrongtype = $chardata[$i]['sor'];
5298 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN && $laststrongtype == Ucdn::BIDI_CLASS_AL) {
5299 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_AN;
5301 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_L || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_R || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_AL) {
5302 $laststrongtype = $chardata[$i]['type'];
5313 for ($i = 0; $i < $numchars; ++$i) {
5314 if (isset($chardata[$i]['type']) && $chardata[$i]['type'] == Ucdn::BIDI_CLASS_AL) {
5315 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_R;
5328 for ($i = 0; $i < $numchars; ++$i) {
5329 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5335 $i2 = $i;
5349 if (!isset($chardata[$i]['sor']) && !isset($chardata[$i]['eor'])) {
5350 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ES && $prevtype == Ucdn::BIDI_CLASS_EN && $nexttype == Ucdn::BIDI_CLASS_EN) {
5351 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
5352 } elseif ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS && $prevtype == Ucdn::BIDI_CLASS_EN && $nexttype == Ucdn::BIDI_CLASS_EN) {
5353 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
5354 } elseif ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS && $prevtype == Ucdn::BIDI_CLASS_AN && $nexttype == Ucdn::BIDI_CLASS_AN) {
5355 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_AN;
5358 $prevtype = $chardata[$i]['type'];
5370 for ($i = 0; $i < $numchars; ++$i) {
5371 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5374 if (isset($chardata[$i]['sor'])) {
5375 $prevtype = $chardata[$i]['sor'];
5378 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ET) {
5380 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
5381 } elseif (!isset($chardata[$i]['eor'])) {
5384 $i2 = $i;
5399 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_EN;
5407 $prevtype = $chardata[$i]['type'];
5416 for ($i = 0; $i < $numchars; ++$i) {
5417 if (isset($chardata[$i]['type']) && (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ET) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ES) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_CS))) {
5418 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_ON;
5429 for ($i = 0; $i < $numchars; ++$i) {
5430 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5433 if (isset($chardata[$i]['sor'])) {
5434 $laststrongtype = $chardata[$i]['sor'];
5436 if (isset($chardata[$i]['type']) && $chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN && $laststrongtype == Ucdn::BIDI_CLASS_L) {
5437 $chardata[$i]['type'] = Ucdn::BIDI_CLASS_L;
5439 if (isset($chardata[$i]['type']) && ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_L || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_R || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_AL)) {
5440 $laststrongtype = $chardata[$i]['type'];
5452 for ($i = 0; $i < $numchars; ++$i) {
5453 if (!isset($chardata[$i]['diid']) || $chardata[$i]['diid'] != $ir) {
5456 if (isset($chardata[$i]['sor'])) {
5457 $laststrongtype = $chardata[$i]['sor'];
5459 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ON || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_WS) {
5471 if (isset($chardata[$i]['eor'])) {
5472 $right = $chardata[$i]['eor'];
5476 $i2 = $i;
5501 $chardata[$i]['orig_type'] = $chardata[$i]['type']; // Need to store the original 'WS' for reference in L1 below
5502 $chardata[$i]['type'] = $left;
5504 } elseif ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_L || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_R || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_AN) {
5505 $laststrongtype = $chardata[$i]['type'];
5515 for ($i = 0; $i < $numchars; ++$i) {
5516 if (isset($chardata[$i]['type']) && ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_ON || $chardata[$i]['type'] == Ucdn::BIDI_CLASS_WS)) {
5517 $chardata[$i]['orig_type'] = $chardata[$i]['type']; // Need to store the original 'WS' for reference in L1 below
5518 $chardata[$i]['type'] = ($chardata[$i]['level'] % 2) ? Ucdn::BIDI_CLASS_R : Ucdn::BIDI_CLASS_L;
5528 for ($i = 0; $i < $numchars; ++$i) {
5529 if (isset($chardata[$i]['level'])) {
5530 $odd = $chardata[$i]['level'] % 2;
5532 if (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_L) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_AN) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN)) {
5533 $chardata[$i]['level'] += 1;
5536 if ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_R) {
5537 $chardata[$i]['level'] += 1;
5538 } elseif (($chardata[$i]['type'] == Ucdn::BIDI_CLASS_AN) || ($chardata[$i]['type'] == Ucdn::BIDI_CLASS_EN)) {
5539 $chardata[$i]['level'] += 2;
5578 for ($i = 0; $i < $numchars; ++$i) {
5580 if (isset($cOTLdata[$nc]['GPOSinfo'][$i])) {
5581 $carac['GPOSinfo'] = $cOTLdata[$nc]['GPOSinfo'][$i];
5583 $carac['uni'] = $cOTLdata[$nc]['char_data'][$i]['uni'];
5584 if (isset($cOTLdata[$nc]['char_data'][$i]['type'])) {
5585 $carac['type'] = $cOTLdata[$nc]['char_data'][$i]['type'];
5587 if (isset($cOTLdata[$nc]['char_data'][$i]['level'])) {
5588 $carac['level'] = $cOTLdata[$nc]['char_data'][$i]['level'];
5590 if (isset($cOTLdata[$nc]['char_data'][$i]['orig_type'])) {
5591 $carac['orig_type'] = $cOTLdata[$nc]['char_data'][$i]['orig_type'];
5593 $carac['group'] = $cOTLdata[$nc]['group'][$i];
5620 for ($i = ($numchars - 1); $i > 0; $i--) {
5621 if ($bidiData[$i]['type'] == Ucdn::BIDI_CLASS_WS || (isset($bidiData[$i]['orig_type']) && $bidiData[$i]['orig_type'] == Ucdn::BIDI_CLASS_WS)) {
5622 $bidiData[$i]['level'] = $pel;
5633 for ($i = 0; $i < $numchars; ++$i) {
5634 if ($bidiData[$i]['level'] >= $j) {
5637 if (isset(Ucdn::$mirror_pairs[$bidiData[$i]['uni']]) && $bidiData[$i]['type'] == Ucdn::BIDI_CLASS_R) {
5638 $bidiData[$i]['uni'] = Ucdn::$mirror_pairs[$bidiData[$i]['uni']];
5641 $revarr[] = $bidiData[$i];
5649 $ordarray[] = $bidiData[$i];
5797 for ($i = 0; $i < $len; $i++) {
5798 if ($cOTLdata['char_data'][$i]['uni'] == 32 || $cOTLdata['char_data'][$i]['uni'] == 12288) {
5805 for ($i = ($len - 1); $i >= 0; $i--) {
5806 if ($cOTLdata['char_data'][$i]['uni'] == 32 || $cOTLdata['char_data'][$i]['uni'] == 12288) {
5825 for ($i = 0; $i < $nRight; $i++) {
5843 for ($i = 0; $i < $nLeft; $i++) {
5967 for ($i = 0; $i < $GlyphCount; $i++) {
5968 $startGlyphID = $StartGlyph + $i;
5969 $endGlyphID = $StartGlyph + $i;
5984 for ($i = 0; $i < $tableCount; $i++) {
6187 for ($i = 0; $i < count($this->OTLdata); $i++) {
6188 if ($i == $ptr) {
6191 echo $this->OTLdata[$i]['hex'] . ' ';
6192 if ($i == $ptr) {
6198 for ($i = 0; $i < count($this->OTLdata); $i++) {
6199 if ($i == $ptr) {
6202 echo str_pad($this->OTLdata[$i]['uni'], 5) . ' ';
6203 if ($i == $ptr) {
6210 for ($i = 0; $i < count($this->OTLdata); $i++) {
6211 if (!empty($this->OTLdata[$i]['GPOSinfo'])) {
6212 echo $this->OTLdata[$i]['hex'] . ' &#x' . $this->OTLdata[$i]['hex'] . '; ';
6213 print_r($this->OTLdata[$i]['GPOSinfo']);