function WriteText($text)
 {
     $text = utf82uni($text);
     $intPosIni = 0;
     $intPosFim = 0;
     if (strpos($text, '<') !== false and strpos($text, '[') !== false) {
         if (strpos($text, '<') < strpos($text, '[')) {
             $this->Write(5, substr($text, 0, strpos($text, '<')));
             $intPosIni = strpos($text, '<');
             $intPosFim = strpos($text, '>');
             $this->SetFont('', 'B');
             $this->Write(5, substr($text, $intPosIni + 1, $intPosFim - $intPosIni - 1));
             $this->SetFont('', '');
             $this->WriteText(substr($text, $intPosFim + 1, strlen($text)));
         } else {
             $this->Write(5, substr($text, 0, strpos($text, '[')));
             $intPosIni = strpos($text, '[');
             $intPosFim = strpos($text, ']');
             $w = $this->GetStringWidth('a') * ($intPosFim - $intPosIni - 1);
             $this->Cell($w, $this->FontSize + 0.75, substr($text, $intPosIni + 1, $intPosFim - $intPosIni - 1), 1, 0, '');
             $this->WriteText(substr($text, $intPosFim + 1, strlen($text)));
         }
     } else {
         if (strpos($text, '<') !== false) {
             $this->Write(5, substr($text, 0, strpos($text, '<')));
             $intPosIni = strpos($text, '<');
             $intPosFim = strpos($text, '>');
             $this->SetFont('', 'B');
             $this->WriteText(substr($text, $intPosIni + 1, $intPosFim - $intPosIni - 1));
             $this->SetFont('', '');
             $this->WriteText(substr($text, $intPosFim + 1, strlen($text)));
         } elseif (strpos($text, '[') !== false) {
             $this->Write(5, substr($text, 0, strpos($text, '[')));
             $intPosIni = strpos($text, '[');
             $intPosFim = strpos($text, ']');
             $w = $this->GetStringWidth('a') * ($intPosFim - $intPosIni - 1);
             $this->Cell($w, $this->FontSize + 0.75, substr($text, $intPosIni + 1, $intPosFim - $intPosIni - 1), 1, 0, '');
             $this->WriteText(substr($text, $intPosFim + 1, strlen($text)));
         } else {
             $this->Write(5, $text);
         }
     }
 }
Exemple #2
0
function burmese($char)
{
    return utf82uni($char) >= 0x1000 and utf82uni($char) <= 0x109f;
}
 function OrderText($text1, $text2, $text3 = "", $text4 = "", $lf = TRUE)
 {
     // $pdf->SetFont('Arial','',12);
     $text1 = utf82uni($text1);
     $text2 = utf82uni($text2);
     $text3 = utf82uni($text3);
     $text4 = utf82uni($text4);
     $len = $text3 == "" ? '145' : '50';
     $this->Cell(45, 5, $text1 . ':', 0, 0, 'L');
     $this->SetX(46);
     $this->Cell($len, 5, $text2, 1, 0, 'L');
     if ($text3 != "") {
         $this->SetX(100);
         $this->Cell(40, 5, $text3 . ':', 0, 0, 'L');
         $this->SetX(141);
         $this->Cell(50, 5, $text4, 1, 1, 'L');
     } else {
         $this->WriteText("\n");
     }
     if ($lf == TRUE) {
         $this->WriteText("\n");
     }
 }