PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » File_PDF » Bug #5230

setFontStyle() and line() with negative coordinates

Details

Request #5230setFontStyle() and line() with negative coordinates
Submitted2005-08-29 10:28 UTC
Fromd dot baechtold at unico dot ch
Assignedyunosh
StatusClosed
PackageFile_PDF
PHP Version5.0.4
OSLinux
Roadmaps(Not assigned)

Comments

[2005-08-29 10:28 UTC] d dot baechtold at unico dot ch

Description:
------------
I used the function setFontStyle($style). Maybe you can add this in the next release if you want. Simpliest way for me to do this was:
public function setFontStyle($style)
{
$this->setFont($this->_font_family, $style);
}

And it would be helpful when all functions with ordinates as parameters could handle negative ordinates like setXY().
I overwrote line() like this:

public function line($x1, $y1, $x2, $y2)
{
if($x1 < 0) $x1 = $this->w + $x1;
if($y1 < 0) $y1 = $this->h + $y1;
if($x2 < 0) $x2 = $this->w + $x2;
if($y2 < 0) $y2 = $this->h + $y2;

parent::line($x1, $y1, $x2, $y2);
}

I found it easier with this to add a line in footer().