Lines Matching defs:info

108 	public static function set_indic_properties(&$info, $scriptblock)
110 $u = $info['uni'];
167 if ($info['general_category'] == Ucdn::UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) {
197 $info['indic_category'] = $cat;
198 $info['indic_position'] = $pos;
336 public static function initial_reordering(&$info, $GSUBdata, $broken_syllables, $indic_config, $scriptblock, $is_old_spec, $dottedcircle)
339 self::update_consonant_positions($info, $GSUBdata);
342 self::insert_dotted_circles($info, $dottedcircle);
345 $count = count($info);
350 $last_syllable = $info[0]['syllable'];
352 if ($last_syllable != $info[$i]['syllable']) {
353 self::initial_reordering_syllable($info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $last, $i);
355 $last_syllable = $info[$last]['syllable'];
358 self::initial_reordering_syllable($info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $last, $count);
361 public static function update_consonant_positions(&$info, $GSUBdata)
363 $count = count($info);
365 if ($info[$i]['indic_position'] == self::POS_BASE_C) {
366 $c = $info[$i]['uni'];
369 $info[$i]['indic_position'] = self::POS_POST_C;
371 $info[$i]['indic_position'] = self::POS_BELOW_C;
373 $info[$i]['indic_position'] = self::POS_POST_C;
379 public static function insert_dotted_circles(&$info, $dottedcircle)
383 while ($idx < count($info)) {
384 $syllable = $info[$idx]['syllable'];
389 $dottedcircle[0]['syllable'] = $info[$idx]['syllable'];
392 while ($idx < count($info) && $last_syllable == $info[$idx]['syllable'] && $info[$idx]['indic_category'] == self::OT_REPHA) {
395 array_splice($info, $idx, 0, $dottedcircle);
401 // I am not sue how this code below got in here, since $idx should now be > count($info) and thus invalid.
403 if (isset($info[$idx])) {
407 //$syllable = $info[$idx]['syllable'];
410 // $dottedcircle[0]['syllable'] = $info[$idx]['syllable'];
411 // array_splice($info, $idx, 0, $dottedcircle);
418 public static function initial_reordering_syllable(&$info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $start, $end)
424 $syllable_type = ($info[$start]['syllable'] & 0x0F);
433 if ($info[$end - 1]['indic_category'] == self::OT_DOTTEDCIRCLE) {
462 ($indic_config[4] == self::REPH_MODE_IMPLICIT && !self::is_joiner($info[$start + 2])) ||
463 ($indic_config[4] == self::REPH_MODE_EXPLICIT && $info[$start + 2]['indic_category'] == self::OT_ZWJ)
466 //$glyphs = array($info[$start]['uni'], $info[$start + 1]['uni']);
468 if (isset($GSUBdata['rphf'][$info[$start]['uni']]) && self::is_halant_or_coeng($info[$start + 1])) {
470 while ($limit < $end && self::is_joiner($info[$limit])) {
476 } elseif ($indic_config[4] == self::REPH_MODE_LOG_REPHA && $info[$start]['indic_category'] == self::OT_REPHA) {
478 while ($limit < $end && self::is_joiner($info[$limit])) {
494 if (self::is_consonant($info[$i])) {
497 if ($info[$i]['indic_position'] != self::POS_BELOW_C && ($info[$i]['indic_position'] != self::POS_POST_C || $seen_below)) {
501 if ($info[$i]['indic_position'] == self::POS_BELOW_C) {
522 if ($start < $i && $info[$i]['indic_category'] == self::OT_ZWJ && $info[$i - 1]['indic_category'] == self::OT_H) {
529 if ($start < $i && $info[$i]['indic_category'] == self::OT_ZWNJ) {
546 if (self::is_consonant($info[$i]) && $info[$i]['indic_position'] == self::POS_BASE_C) {
547 if ($limit < $i && $info[$i - 1]['indic_category'] == self::OT_ZWJ) {
557 if (self::is_consonant($info[$i]) && $info[$i]['indic_position'] == self::POS_BASE_C) {
558 $info[$i]['indic_position'] = self::POS_BELOW_C;
613 $info[$i]['indic_position'] = min(self::POS_PRE_C, $info[$i]['indic_position']);
617 $info[$base]['indic_position'] = self::POS_BASE_C;
623 if ($info[$i]['indic_category'] == self::OT_M) {
625 if (self::is_consonant($info[$j])) {
626 $info[$j]['indic_position'] = self::POS_FINAL_C;
637 $info[$start]['indic_position'] = self::POS_RA_TO_BECOME_REPH;
647 if ($info[$i]['indic_category'] == self::OT_H) {
649 if (self::is_consonant($info[$j]) || $info[$j]['indic_category'] == self::OT_H) {
653 if ($info[$j]['indic_category'] != self::OT_H && $j > $i) {
655 self::_move_info_pos($info, $i, $j + 1);
665 if ((self::FLAG($info[$i]['indic_category']) & (self::FLAG(self::OT_ZWJ) | self::FLAG(self::OT_ZWNJ) | self::FLAG(self::OT_N) | self::FLAG(self::OT_RS) | self::FLAG(self::OT_H) | self::FLAG(self::OT_COENG) ))) {
666 $info[$i]['indic_position'] = $last_pos;
667 if ($info[$i]['indic_category'] == self::OT_H && $info[$i]['indic_position'] == self::POS_PRE_M) {
678 if ($info[$j - 1]['indic_position'] != self::POS_PRE_M) {
679 $info[$i]['indic_position'] = $info[$j - 1]['indic_position'];
684 } elseif ($info[$i]['indic_position'] != self::POS_SMVD) {
685 $last_pos = $info[$i]['indic_position'];
692 if (self::is_halant_or_coeng($info[$i])) {
694 } elseif (self::is_consonant($info[$i])) {
696 if ($info[$j]['indic_position'] != self::POS_SMVD) {
697 $info[$j]['indic_position'] = $info[$i]['indic_position'];
708 if (self::is_halant_or_coeng($info[$i]) && self::is_ra($info[$i + 1]['uni'])) {
709 $info[$i]['indic_position'] = self::POS_PRE_C;
710 $info[$i + 1]['indic_position'] = self::POS_PRE_C;
723 if ($info[$i]['indic_category'] == self::OT_ZWNJ) { $ZWNJ_found = true; }
724 else if ($ZWNJ_found && $info[$i]['indic_category'] == self::OT_C) { $POST_ZWNJ_c_found = true; }
725 else if ($POST_ZWNJ_c_found && $info[$i]['indic_position'] == self::POS_BEFORE_SUB) { $info[$i]['indic_position'] = self::POS_AFTER_SUB; }
732 $info[$i]['mask'] = 0;
740 if (self::is_halant_or_coeng($info[$i]) && self::is_ra($info[$i + 1]['uni'])) {
741 $info[$i]['mask'] |= self::FLAG(self::PREF);
742 $info[$i + 1]['mask'] |= self::FLAG(self::PREF);
751 $info[$j]['mask'] |= self::FLAG(self::CFAR);
762 self::bubble_sort($info, $start, $end - $start);
767 if ($info[$i]['indic_position'] == self::POS_BASE_C) {
776 if ($info[$i]['indic_position'] == self::POS_RA_TO_BECOME_REPH) {
777 $info[$i]['mask'] |= self::FLAG(self::RPHF);
784 $info[$i]['mask'] |= $mask;
791 $info[$i]['mask'] |= $mask;
802 if (self::is_consonant($info[$i])) {
803 if (self::is_halant_or_coeng($info[$i + 1]) && self::is_ra($info[$i + 2]['uni'])) {
805 if (isset($GSUBdata['blwf'][$info[$i + 2]['uni']])) {
806 $info[$i + 1]['mask'] |= self::FLAG(self::BLWF);
807 $info[$i + 2]['mask'] |= self::FLAG(self::BLWF);
808 } /* If would not substitute as blwf, mark Ra+Halant for RPHF using following Halant (if present) */ elseif (self::is_halant_or_coeng($info[$i + 3])) {
809 $info[$i + 2]['mask'] |= self::FLAG(self::RPHF);
810 $info[$i + 3]['mask'] |= self::FLAG(self::RPHF);
840 if ($info[$i]['indic_category'] == self::OT_RA && $info[$i + 1]['indic_category'] == self::OT_H &&
841 ($i + 2 == $base || $info[$i + 2]['indic_category'] != self::OT_ZWJ)) {
842 $info[$i]['mask'] |= self::FLAG(self::BLWF);
843 $info[$i + 1]['mask'] |= self::FLAG(self::BLWF);
853 if ((isset($GSUBdata['pref'][$info[$i + 1]['uni']]) && self::is_halant_or_coeng($info[$i]) && self::is_ra($info[$i + 1]['uni']) ) ||
854 ($is_old_spec && isset($GSUBdata['pref'][$info[$i]['uni']]) && self::is_halant_or_coeng($info[$i + 1]) && self::is_ra($info[$i]['uni']) )
856 $info[$i++]['mask'] |= self::FLAG(self::PREF);
857 $info[$i++]['mask'] |= self::FLAG(self::PREF);
867 if (self::is_joiner($info[$i])) {
868 $non_joiner = ($info[$i]['indic_category'] == self::OT_ZWNJ);
874 if (!self::is_consonant($info[$j])) {
886 $info[$j]['mask'] &= ~(self::FLAG(self::HALF) | self::FLAG(self::BLWF));
893 public static function final_reordering(&$info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec)
895 $count = count($info);
900 $last_syllable = $info[0]['syllable'];
902 if ($last_syllable != $info[$i]['syllable']) {
903 self::final_reordering_syllable($info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $last, $i);
905 $last_syllable = $info[$last]['syllable'];
908 self::final_reordering_syllable($info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $last, $count);
911 public static function final_reordering_syllable(&$info, $GSUBdata, $indic_config, $scriptblock, $is_old_spec, $start, $end)
924 if ($info[$base]['indic_position'] >= self::POS_BASE_C) {
925 if ($start < $base && $info[$base]['indic_position'] > self::POS_BASE_C) {
931 if ($base == $end && $start < $base && $info[$base - 1]['indic_category'] != self::OT_ZWJ) {
934 while ($start < $base && isset($info[$base]) && ($info[$base]['indic_category'] == self::OT_H || $info[$base]['indic_category'] == self::OT_N)) {
959 while ($new_pos > $start && !(self::is_one_of($info[$new_pos], (self::FLAG(self::OT_M) | self::FLAG(self::OT_H) | self::FLAG(self::OT_COENG))))) {
966 if (self::is_halant_or_coeng($info[$new_pos]) && $info[$new_pos]['indic_position'] != self::POS_PRE_M) {
968 if ($new_pos + 1 < $end && self::is_joiner($info[$new_pos + 1])) {
976 if ($start < $new_pos && $info[$new_pos]['indic_position'] != self::POS_PRE_M) {
979 if ($info[$i - 1]['indic_position'] == self::POS_PRE_M) {
981 //memmove (&info[$old_pos], &info[$old_pos + 1], ($new_pos - $old_pos) * sizeof ($info[0]));
982 self::_move_info_pos($info, $old_pos, $new_pos + 1);
1007 $info[$start]['indic_position'] == self::POS_RA_TO_BECOME_REPH && $info[$start + 1]['indic_position'] != self::POS_RA_TO_BECOME_REPH) {
1034 while ($new_reph_pos < $base && !self::is_halant_or_coeng($info[$new_reph_pos])) {
1038 if ($new_reph_pos < $base && self::is_halant_or_coeng($info[$new_reph_pos])) {
1040 if ($new_reph_pos + 1 < $base && self::is_joiner($info[$new_reph_pos + 1])) {
1054 while ($new_reph_pos + 1 < $end && $info[$new_reph_pos + 1]['indic_position'] <= self::POS_AFTER_MAIN) {
1070 while ($new_reph_pos < $end && isset($info[$new_reph_pos + 1]['indic_position']) &&
1071 !( self::FLAG($info[$new_reph_pos + 1]['indic_position']) & (self::FLAG(self::POS_POST_C) | self::FLAG(self::POS_AFTER_POST) | self::FLAG(self::POS_SMVD)))) {
1089 while ($new_reph_pos < $base && !self::is_halant_or_coeng($info[$new_reph_pos])) {
1093 if ($new_reph_pos < $base && self::is_halant_or_coeng($info[$new_reph_pos])) {
1095 if ($new_reph_pos + 1 < $base && self::is_joiner($info[$new_reph_pos + 1])) {
1107 while ($new_reph_pos > $start && $info[$new_reph_pos]['indic_position'] == self::POS_SMVD) {
1118 //if (!$hb_options.uniscribe_bug_compatible && self::is_halant_or_coeng($info[$new_reph_pos])) {
1119 if (self::is_halant_or_coeng($info[$new_reph_pos])) {
1121 if ($info[$i]['indic_category'] == self::OT_M) {
1131 self::_move_info_pos($info, $start, $new_reph_pos + 1);
1148 if ($info[$i]['mask'] & self::FLAG(self::PREF)) {
1154 if ($i + 1 == $end || ($info[$i + 1]['mask'] & self::FLAG(self::PREF)) == 0) {
1169 !(self::is_one_of($info[$new_pos - 1], self::FLAG(self::OT_M) | self::FLAG(self::OT_H) | self::FLAG(self::OT_COENG)))) {
1175 if ($new_pos > $start && $info[$new_pos - 1]['indic_category'] == self::OT_M) {
1178 if ($info[$i]['indic_category'] == self::OT_M) {
1186 if ($new_pos > $start && self::is_halant_or_coeng($info[$new_pos - 1])) {
1188 if ($new_pos < $end && self::is_joiner($info[$new_pos])) {
1194 self::_move_info_pos($info, $old_pos, $new_pos);
1208 if ($info[$start]['indic_position'] == self::POS_PRE_M &&
1210 ($info[$start - 1]['general_category'] < Ucdn::UNICODE_GENERAL_CATEGORY_FORMAT || $info[$start - 1]['general_category'] > Ucdn::UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
1212 $info[$start]['mask'] |= self::FLAG(self::INIT);
1221 public static function _move_info_pos(&$info, $from, $to)
1224 $t[0] = $info[$from];
1226 array_splice($info, $from, 1);
1227 array_splice($info, $to, 0, $t);
1229 array_splice($info, $to, 0, $t);
1230 array_splice($info, $from, 1);
1254 public static function is_one_of($info, $flags)
1256 if (isset($info['is_ligature']) && $info['is_ligature']) {
1259 return !!(self::FLAG($info['indic_category']) & $flags);
1262 public static function is_joiner($info)
1264 return self::is_one_of($info, (self::FLAG(self::OT_ZWJ) | self::FLAG(self::OT_ZWNJ)));
1269 public static function is_consonant($info)
1271 return self::is_one_of($info, (self::FLAG(self::OT_C) | self::FLAG(self::OT_CM) | self::FLAG(self::OT_RA) | self::FLAG(self::OT_V) | self::FLAG(self::OT_NBSP) | self::FLAG(self::OT_DOTTEDCIRCLE)));
1274 public static function is_halant_or_coeng($info)
1276 return self::is_one_of($info, (self::FLAG(self::OT_H) | self::FLAG(self::OT_COENG)));