Bugs php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login

go to bug id or search bugs for

Bug #56376 Impossible to load font (might be doc problem)
Submitted: 2005年04月20日 22:04 UTC Modified: 2006年02月21日 08:33 UTC
From: lphuberdeau at phpquebec dot org Assigned: steinm (profile)
Status: Closed Package: ps (PECL)
PHP Version: 4.3.10 OS:
Private report: No CVE-ID: None
[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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
[2006年02月21日 08:33 UTC] uwe at steinmann dot cx
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);
?>
PHP Copyright © 2001-2026 The PHP Group
All rights reserved. Last updated: Fri Jul 03 02:00:01 2026 UTC

AltStyle によって変換されたページ (->オリジナル) /