Ejemplo n.º 1
0
 /**
  * Process the PDF type character
  *
  * @param int    $pos  Original character position in the input string
  * @param array  $edss Last entry in the Directional Status Stack
  */
 protected function processFsiCase($pos, $edss)
 {
     // X5c. With each FSI, apply rules P2 and P3 to the sequence of characters between the FSI and its
     //      matching PDI, or if there is no matching PDI, the end of the paragraph, as if this sequence
     //      of characters were a paragraph. If these rules decide on paragraph embedding level 1, treat
     //      the FSI as an RLI in rule X5a. Otherwise, treat it as an LRI in rule X5b.
     $stepp = new StepP(array_slice($this->ordarr, $pos));
     if ($stepp->getPel() == 0) {
         $this->setDss($this->getLEven($edss['cel']), UniConstant::LRI, 'NI', true, true, 1);
     } else {
         $this->setDss($this->getLOdd($edss['cel']), UniConstant::RLI, 'NI', true, true, 1);
     }
 }
Ejemplo n.º 2
0
 /**
  * Get the paragraph embedding level
  *
  * @param array $par Paragraph
  *
  * @return int
  */
 protected function getPel($par)
 {
     if ($this->forcertl === 'R') {
         return 1;
     }
     if ($this->forcertl === 'L') {
         return 0;
     }
     $stepp = new StepP($par);
     return $stepp->getPel();
 }