o'; $CMap='GBKp-EUC-H'; $registry=array('ordering'=>'GB1','supplement'=>2); $this->AddCIDFont($family,'',$name,$cw,$CMap,$registry); $this->AddCIDFont($family,'B',$name.',Bold',$cw,$CMap,$registry); $this->AddCIDFont($family,'I',$name.',Italic',$cw,$CMap,$registry); $this->AddCIDFont($family,'BI',$name.',BoldItalic',$cw,$CMap,$registry); }
function GetStringWidth($s) { if($this->CurrentFont['type']=='Type0') return $this->GetMBStringWidth($s); else return parent::GetStringWidth($s); }
function GetMBStringWidth($s) { //Multi-byte version of GetStringWidth() $l=0; $cw=&$this->CurrentFont['cw']; $nb=strlen($s); $i=0; while($i<$nb) { $c=$s[$i]; if(ord($c)<128) { $l+=$cw[$c]; $i++; } else { $l+=1000; $i+=2; } } return $l*$this->FontSize/1000; }
function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0) { if($this->CurrentFont['type']=='Type0') $this->MBMultiCell($w,$h,$txt,$border,$align,$fill); else parent::MultiCell($w,$h,$txt,$border,$align,$fill); }
function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0) { //Multi-byte version of MultiCell() $cw=&$this->CurrentFont['cw']; if($w==0) $w=$this->w-$this->rMargin-$this->x; $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; $s=str_replace("\r",'',$txt); $nb=strlen($s); if($nb>0 and $s[$nb-1]=="\n" $nb--; $b=0; if($border) { if($border==1) { $border='LTRB'; $b='LRT'; $b2='LR'; } else { $b2=''; if(is_int(strpos($border,'L'))) $b2.='L'; if(is_int(strpos($border,'R'))) $b2.='R'; $b=is_int(strpos($border,'T')) ? $b2. 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 |