protected function textFitCell($w, $h, $txt, $border, $ln, $align, $dec = 0.1) { $fsize = $this->FontSizePt; $size = $fsize; while ($this->GetStringWidth($txt) > $w - 2) { $this->SetFontSize($size -= $dec); } $this->Cell($w, $h, $txt, $border, $ln, $align); $this->SetFontSize($fsize); }