|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-11 19:31 UTC] sniper@php.net
[2004-07-12 08:14 UTC] ingconti at ingconti dot com
[2004-07-18 18:54 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
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.