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 (profile)
Status: Closed Package: ps (PECL)
PHP Version: 4.3.10 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lphuberdeau at phpquebec dot org
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 05:01:28 2024 UTC