php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Status: Closed Package: ps (PECL)
PHP Version: 4.3.10 OS:
Private report: No CVE-ID:
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 12:01:59 2014 UTC