f neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. European and Arabic numbers act as if they were R in terms of their influence on neutrals. Start-of-level-run (sor) and end-of-level-run (eor) are used at level run boundaries. $prevlevel = -1; $levcount = 0; for ($i=0; $i < $numchars; $i++) { if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { $chardata[$i]['type'] = 'L'; } elseif (($chardata[$i]['type'] == 'N') AND (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { $chardata[$i]['type'] = 'R'; } elseif ($chardata[$i]['type'] == 'N') { // N2. Any remaining neutrals take the embedding direction $chardata[$i]['type'] = $chardata[$i]['sor']; } } elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { // first char if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { $chardata[$i]['type'] = 'L'; } elseif (($chardata[$i]['type'] == 'N') AND (($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { $chardata[$i]['type'] = 'R'; } elseif ($chardata[$i]['type'] == 'N') { // N2. Any remaining neutrals take the embedding direction $chardata[$i]['type'] = $chardata[$i]['sor']; } } elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) { //last char if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) { $chardata[$i]['type'] = 'L'; } elseif (($chardata[$i]['type'] == 'N') AND (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND (($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) { $chardata[$i]['type'] = 'R'; } elseif ($chardata[$i]['type'] == 'N') { // N2. Any remaining neutrals take the embedding direction $chardata[$i]['type'] = $chardata[$i]['sor']; } } elseif ($chardata[$i]['type'] == 'N') { // N2. Any remaining neutrals take the embedding direction $chardata[$i]['type'] = $chardata[$i]['sor']; } if ($chardata[$i]['level'] != $prevlevel) { $levcount = 0; } else { $levcount++; } $prevlevel = $chardata[$i]['level']; } // I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels. // I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level. for ($i=0; $i < $numchars; $i++) { $odd = $chardata[$i]['level'] % 2; if ($odd) { if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')){ $chardata[$i]['level'] += 1; } } else { if ($chardata[$i]['type'] == 'R') { $chardata[$i]['level'] += 1; } elseif (($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')){ $chardata[$i]['level'] += 2; } } $maxlevel = max($chardata[$i]['level'],$maxlevel); } // L1. On each line, reset the embedding level of the following characters to the paragraph embedding level: // 1. Segment separators, // 2. Paragraph separators, // 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and // 4. Any sequence of white space characters at the end of the line. for ($i=0; $i < $numchars; $i++) { if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) { $chardata[$i]['level'] = $pel; } elseif ($chardata[$i]['type'] == 'WS') { $j = $i+1; while ($j < $numchars) { if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR (($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) { $chardata[$i]['level'] = $pel;; break; } elseif ($chardata[$j]['type'] != 'WS') { break; } $j++; } } } // Arabic Shaping // Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run. if ($arabic) { for ($i=0; $i < $numchars; $i++) { if ($unicode[$chardata[$i]['char']] == 'AL') { if (($i > 0) AND (($i+1) < $numchars) AND ($unicode[$chardata[($i-1)]['char']] == 'AL') AND ($unicode[$chardata[($i+1)]['char']] == 'AL') AND ($chardata[($i-1)]['type'] == $chardata[$i]['type']) AND ($chardata[($i+1)]['type'] == $chardata[$i]['type'])) { // medial if (isset($unicode_arlet[$chardata[$i]['char']][3])) { $chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][3]; } } elseif ((($i+1) < $numchars) AND ($unicode[$chardata[($i+1)]['char']] == 'AL') AND ($chardata[($i+1)]['type'] == $chardata[$i]['type'])) { // initial if (isset($unicode_arlet[$chardata[$i]['char']][2])) { $chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][2]; } } elseif (($i > 0) AND ($unicode[$chardata[($i-1)]['char']] == 'AL') AND ($chardata[($i-1)]['type'] == $chardata[$i]['type'])) { // final if (isset($unicode_arlet[$chardata[$i]['char']][1])) { $chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][1]; } } elseif (isset($unicode_arlet[$chardata[$i]['char']][0])) { // isolated $chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][0]; } } } } // L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher. for ($j=$maxlevel; $j > 0; $j--) { $ordarray = Array(); $revarr = Array(); $onlevel = false; for ($i=0; $i < $numchars; $i++) { if ($chardata[$i]['level'] >= $j) { $onlevel = true; if (isset($unicode_mirror[$chardata[$i]['char']])) { // L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true. $chardata[$i]['char'] = $unicode_mirror[$chardata[$i]['char']]; } $revarr[] = $chardata[$i]; } else { if($onlevel) { $revarr = array_reverse($revarr); $ordarray = array_merge($ordarray, $revarr); $revarr = Array(); $onlevel = false; } $ordarray[] = $chardata[$i]; } } if($onlevel) { $revarr = array_reverse($revarr); $ordarray = array_merge($ordarray, $revarr); } $chardata = $ordarray; } $ordarray = array(); for ($i=0; $i < $numchars; $i++) { $ordarray[] = $chardata[$i]['char']; } return $ordarray; } // END OF BIDIRECTIONAL TEXT SECTION ------------------- /* * Adds a bookmark. * @param string $txt bookmark description. * @param int $level bookmark level. * @param float $y Ordinate of the boorkmark position (default = -1 = current position). * @access public * @author Olivier Plathey, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function Bookmark($txt, $level=0, $y=-1) { if($y == -1) { $y = $this->GetY(); } $this->outlines[]=array('t'=>$txt,'l'=>$level,'y'=>$y,'p'=>$this->PageNo()); } /* * Create a bookmark PDF string. * @access private * @author Olivier Plathey, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function _putbookmarks() { $nb = count($this->outlines); if($nb == 0) { return; } $lru = array(); $level = 0; foreach($this->outlines as $i=>$o) { if($o['l'] > 0) { $parent = $lru[$o['l'] - 1]; //Set parent and last pointers $this->outlines[$i]['parent'] = $parent; $this->outlines[$parent]['last'] = $i; if($o['l'] > $level) { //Level increasing: set first pointer $this->outlines[$parent]['first'] = $i; } } else { $this->outlines[$i]['parent']=$nb; } if($o['l']<=$level and $i>0) { //Set prev and next pointers $prev = $lru[$o['l']]; $this->outlines[$prev]['next'] = $i; $this->outlines[$i]['prev'] = $prev; } $lru[$o['l']] = $i; $level = $o['l']; } //Outline items $n = $this->n+1; foreach($this->outlines as $i=>$o) { $this->_newobj(); $this->_out('<_textstring($o['t'])); $this->_out('/Parent '.($n+$o['parent']).' 0 R'); if(isset($o['prev'])) $this->_out('/Prev '.($n+$o['prev']).' 0 R'); if(isset($o['next'])) $this->_out('/Next '.($n+$o['next']).' 0 R'); if(isset($o['first'])) $this->_out('/First '.($n+$o['first']).' 0 R'); if(isset($o['last'])) $this->_out('/Last '.($n+$o['last']).' 0 R'); $this->_out(sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]',1+2*$o['p'],($this->h-$o['y'])*$this->k)); $this->_out('/Count 0>>'); $this->_out('endobj'); } //Outline root $this->_newobj(); $this->OutlineRoot=$this->n; $this->_out('<_out('/Last '.($n+$lru[0]).' 0 R>>'); $this->_out('endobj'); } // --- JAVASCRIPT - FORMS ------------------------------ /* * Adds a javascript * @access public * @author Johannes G�ntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function IncludeJS($script) { $this->javascript .= $script; } /* * Create a javascript PDF string. * @access private * @author Johannes G�ntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function _putjavascript() { if (empty($this->javascript)) { return; } $this->_newobj(); $this->n_js = $this->n; $this->_out('<<'); $this->_out('/Names [(EmbeddedJS) '.($this->n+1).' 0 R ]'); $this->_out('>>'); $this->_out('endobj'); $this->_newobj(); $this->_out('<<'); $this->_out('/S /JavaScript'); $this->_out('/JS '.$this->_textstring($this->javascript)); $this->_out('>>'); $this->_out('endobj'); } /* * Convert color to javascript color. * @param string $color color name or #RRGGBB * @access private * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function _JScolor($color) { static $aColors = array('transparent','black','white','red','green','blue','cyan','magenta','yellow','dkGray','gray','ltGray'); if(substr($color,0,1) == '#') { return sprintf("['RGB',%.3f,%.3f,%.3f]", hexdec(substr($color,1,2))/255, hexdec(substr($color,3,2))/255, hexdec(substr($color,5,2))/255); } if(!in_array($color,$aColors)) { $this->Error('Invalid color: '.$color); } return 'color.'.$color; } /* * Adds a javascript form field. * @param string $type field type * @param string $name field name * @param int $x horizontal position * @param int $y vertical position * @param int $w width * @param int $h height * @param array $prop array of properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access private * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function _addfield($type, $name, $x, $y, $w, $h, $prop) { $k = $this->k; $this->javascript .= sprintf("f=addField('%s','%s',%d,[%.2f,%.2f,%.2f,%.2f]);",$name,$type,$this->PageNo()-1,$x*$k,($this->h-$y)*$k+1,($x+$w)*$k,($this->h-$y-$h)*$k+1); $this->javascript .= 'f.textSize='.$this->FontSizePt.';'; while(list($key, $val) = each($prop)) { if (strcmp(substr($key,-5),"Color") == 0) { $val = $this->_JScolor($val); } else { $val = "'".$val."'"; } $this->javascript .= "f.".$key."=".$val.";"; } $this->x+=$w; } /* * Creates a text field * @param string $name field name * @param int $w width * @param int $h height * @param string $prop properties. The value property allows to set the initial value. The multiline property allows to define the field as multiline. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function TextField($name, $w, $h, $prop=array()) { $this->_addfield('text',$name,$this->x,$this->y,$w,$h,$prop); } /* * Creates a RadioButton field * @param string $name field name * @param int $w width * @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Nicola Asuni * @since 2.2.003 (2008-03-03) */ function RadioButton($name, $w, $prop=array()) { if(!isset($prop['strokeColor'])) { $prop['strokeColor']='black'; } $this->_addfield('radiobutton',$name,$this->x,$this->y,$w,$w,$prop); } /* * Creates a List-box field * @param string $name field name * @param int $w width * @param int $h height * @param array $values array containing the list of values. * @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Nicola Asuni * @since 2.2.003 (2008-03-03) */ function ListBox($name, $w, $h, $values, $prop=array()) { if(!isset($prop['strokeColor'])) { $prop['strokeColor']='ltGray'; } $this->_addfield('listbox',$name,$this->x,$this->y,$w,$h,$prop); $s = ''; foreach($values as $value) { $s .= "'".addslashes($value)."',"; } $this->javascript .= 'f.setItems(['.substr($s,0,-1).']);'; } /* * Creates a Combo-box field * @param string $name field name * @param int $w width * @param int $h height * @param array $values array containing the list of values. * @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function ComboBox($name, $w, $h, $values, $prop=array()) { $this->_addfield('combobox',$name,$this->x,$this->y,$w,$h,$prop); $s = ''; foreach($values as $value) { $s .= "'".addslashes($value)."',"; } $this->javascript .= 'f.setItems(['.substr($s,0,-1).']);'; } /* * Creates a CheckBox field * @param string $name field name * @param int $w width * @param boolean $checked define the initial state (default = false). * @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function CheckBox($name, $w, $checked=false, $prop=array()) { $prop['value'] = ($checked ? 'Yes' : 'Off'); if(!isset($prop['strokeColor'])) { $prop['strokeColor']='black'; } $this->_addfield('checkbox',$name,$this->x,$this->y,$w,$w,$prop); } /* * Creates a button field * @param string $name field name * @param int $w width * @param int $h height * @param string $caption caption. * @param string $action action triggered by the button (JavaScript code). * @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): * @access public * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) */ function Button($name, $w, $h, $caption, $action, $prop=array()) { if(!isset($prop['strokeColor'])) { $prop['strokeColor']='black'; } if(!isset($prop['borderStyle'])) { $prop['borderStyle']='beveled'; } $this->_addfield('button',$name,$this->x,$this->y,$w,$h,$prop); $this->javascript .= "f.buttonSetCaption('".addslashes($caption)."');"; $this->javascript .= "f.setAction('MouseUp','".addslashes($action)."');"; $this->javascript .= "f.highlight='push';"; $this->javascript .= 'f.print=false;'; } // END JAVASCRIPT - FORMS ------------------------------ } // END OF TCPDF CLASS //Handle special IE contype request if(isset($_SERVER['HTTP_USER_AGENT']) AND ($_SERVER['HTTP_USER_AGENT']=='contype')) { header('Content-Type: application/pdf'); exit; } } //============================================================+ // END OF FILE //============================================================+ ?> TCPDF error: Missing or incorrect image file: images/phocagallery/2019-20/2019-09-19_gegen-Wolfsberg/thumbs/phoca_thumb_l_2019-09-gegen-wac%201131.jpg