'T' : $b2; } } $sep=-1; $i=0; $j=0; $l=0; $ns=0; $nl=1; while($i<$nb) { //Get next character $c=$s[$i]; //Check if ASCII or MB $ascii=(ord($c)<128); if($c=="\n" { //Explicit line break if($this->ws>0) { $this->ws=0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $i++; $sep=-1; $j=$i; $l=0; $ns=0; $nl++; if($border and $nl==2) $b=$b2; continue; } if(!$ascii) { $sep=$i; $ls=$l; } elseif($c==' ') { $sep=$i; $ls=$l; $ns++; } $l+=$ascii ? $cw[$c] : 1000; if($l>$wmax) { //Automatic line break if($sep==-1 or $i==$j) { if($i==$j) $i+=$ascii ? 1 : 2; if($this->ws>0) { $this->ws=0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); } else { if($align=='J') { if($s[$sep]==' ') $ns--; if($s[$i-1]==' ') { $ns--; $ls-=$cw[' ']; } $this->ws=($ns>0) ? ($wmax-$ls)/1000*$this->FontSize/$ns : 0; $this->_out(sprintf('%.3f Tw',$this->ws*$this->k)); } $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); $i=($s[$sep]==' ') ? $sep+1 : $sep; } $sep=-1; $j=$i; $l=0; $ns=0; $nl++; if($border and $nl==2) $b=$b2; } else $i+=$ascii ? 1 : 2; } //Last chunk if($this->ws>0) { $this->ws=0; $this->_out('0 Tw'); } if($border and is_int(strpos($border,'B'))) $b.='B'; $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $this->x=$this->lMargin; }
function Write($h,$txt,$link='') { if($this->CurrentFont['type']=='Type0') $this->MBWrite($h,$t 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 |