#29091 [NEW]: PDFlib functions abort scripts even if I test return code

From: Date: Sun, 11 Jul 2004 07:57:07 +0000
Subject: #29091 [NEW]: PDFlib functions abort scripts even if I test return code
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-62012@lists.php.net to get a copy of this message
From:             ingconti at ingconti dot com
Operating system: OSX 10.3.4
PHP version:      4.3.6
PHP Bug Type:     PDF related
Bug description:  PDFlib functions abort scripts even if I test return code

Description:
------------
I am evaluating PDFLib tobe used on OSX via PHP.
( i am currently using apache (standard for Apple on 
Panther 1.0.3.4) PHP 4.0.2 from entropy)

I spent some time investigating about fonts.
SUPPORT for OSX font is VERY POOR:

a) I tried using embedded font: helvetica and times work 
fine
b) If You use other fonts ALL the php scripts ABORT! 
without any error!

If You do:

$f="Symbol";
$font = pdf_findfont($pdf, $f, "builtin", 0); 
if($font)
{
	print "Font OK <br>";
}
else
	{
	// handle it!!
	}

with "Symbol" it works, but if font is not present $font is 
NOT set to NULL: ALL the script aborts!!
I expected i got $font == NULL so I can intercept error. NO 
WAY! script aborts!.

c) I tried to use 

$fontPath = "/Library/Fonts/Bkant.ttf";
//pdf_set_parameter($pdf,"FontOutline","MYFONT==/Library/
Fonts/Chalkboard.ttf");
pdf_set_parameter($pdf,"FontOutline","MYFONT==".$fontPath);
$font = pdf_findfont($pdf,"MYFONT","host",1);


it works ONLY on some type of TT fonts.

I works on:

Chalkboard.ttf

but NOT on other TTF regularly seen on osx.

d) I Tried to use windows TT fonts:

I see them in osx apps, but using in pdf_set_parameter, the 
cause script to abort...

THANKS.

Reproduce code:
---------------
If You do:

$f="Symbol";
$font = pdf_findfont($pdf, $f, "builtin", 0); 
if($font)
{
	print "Font OK <br>";
	pdf_setfont($pdf, $font,30); 
	pdf_set_text_pos($pdf, 30, $y);
	$y+=20; 
	pdf_show($pdf, $f);
}
else
	{
	// handle it!!
	}

if font is not present $font is NOT set to NULL: ALL the script aborts!!

try with "Charcoal" for example.

c) I tried to use 

$fontPath = "/Library/Fonts/Bkant.ttf";
//pdf_set_parameter($pdf,"FontOutline","MYFONT==/Library/Fonts/Chalkboard.ttf");
pdf_set_parameter($pdf,"FontOutline","MYFONT==".$fontPath);
$font = pdf_findfont($pdf,"MYFONT","host",1);


it works ONLY on some type of TT fonts.

I works on:

Chalkboard.ttf

but NOT on other TTF regularly seen on osx.

d) I Tried to use windows TT fonts:

I see them in osx apps, but using in pdf_set_parameter, the cause scritp
to abort...


for Your conveninece.

THANKS.



Expected result:
----------------
if font is not found, i Wuold like to get:


$f="Charcoal";
$font = pdf_findfont($pdf, $f, "builtin", 0); 
if(!$font)
{
   print "not present";
}


instead of aborting php script.

Actual result:
--------------
I do NOT have a core dump, pache is currntly working.



-- 
Edit bug report at http://bugs.php.net/?id=29091&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29091&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29091&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29091&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29091&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29091&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29091&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29091&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29091&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29091&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29091&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29091&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29091&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29091&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29091&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29091&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29091&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29091&r=float


Thread (4 messages)

« previous php.bugs (#62012) next »