|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-04-20 22:04 UTC] lphuberdeau at phpquebec dot org
Description: ------------ I keep getting an error when using ps_findfont() to load a font. The error indicates 'Helvetica.afm' cannot be found. I manage to get it to generate by moving the file in the script current directory, but it's not an acceptable solution in the context. I tryed to use ps_set_parameter() with FontOutline and fileressource as used in pdflib and SearchPath as mentioned in pslib documentation. None seemed to have an effect. Either I have no idea on how to load a font or the parameters are not checked. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 13:00:01 2025 UTC |
I suppose this was due to an old version of pslib. The following script works like expected. <?php $ps = ps_new(); ps_set_parameter($ps, "FontAFM", "MyFont=/home/cvs/php/pecl/ps/examples/Dustismo.afm"); ps_set_parameter($ps, "FontOutline", "MyFont=/home/cvs/php/pecl/ps/examples/Dustismo.pfb"); if (!ps_open_file($ps, "bug-4194.ps")) { print "Cannot open PostScript file\n"; exit; } $psfont = ps_findfont($ps, "MyFont", "", 1); ps_begin_page($ps, 596, 842); ps_setfont($ps, $psfont, 12.0); ps_show_xy($ps, "test", 100, 100); ps_end_page($ps); ps_close($ps); ps_delete($ps); ?>