- Add a convenience stringwidth funciton

This commit is contained in:
dave 2008-03-24 18:45:51 +00:00
parent c0026c75e5
commit 52e7a6500a

View File

@ -512,6 +512,13 @@ class lpdf
pdf_show_xy($this->pdf,$text,$this->loc($xpos),$this->loc($this->yloc)); pdf_show_xy($this->pdf,$text,$this->loc($xpos),$this->loc($this->yloc));
} }
function stringWidth($text, $font=null, $size=null)
{
if($size == null) $size = pdf_get_value($this->pdf,"fontsize",0);
if($font == null) $font = $this->normalfont;
return pdf_stringwidth($this->pdf, $text, $font, $size);
}
function nextLine() function nextLine()
{ {
$fontsize=pdf_get_value($this->pdf,"fontsize",0); $fontsize=pdf_get_value($this->pdf,"fontsize",0);