forked from science-ation/science-ation
- Add a convenience stringwidth funciton
This commit is contained in:
parent
c0026c75e5
commit
52e7a6500a
7
lpdf.php
7
lpdf.php
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user