ID: 26764 Updated by: [EMAIL PROTECTED] Reported By: choinet at rocketmail dot com -Status: Closed +Status: Bogus Bug Type: GD related Operating System: Windows/Linux PHP Version: 4.3.4 New Comment:
It's still bogus, as it's not a bug in PHP Previous Comments: ------------------------------------------------------------------------ [2004-01-03 13:06:53] choinet at rocketmail dot com Au contraire, Rasmus says: --- Since libgd supports multiple alternate font paths separated by spaces, it is not possible to use individual font paths with spaces in them. Example: $path = 'c:\test folder\arial.ttf'; imagettftext($image, 12, 0, 50, 50, $color, $path, "Hello"); ... It is obvious from looking at the code that it is just doing a simple strtok on the separator without any further logic. The relevant code is: [code segment in ext/gd/libgd/gdft.c] --- He also said to either get Boutell to fix it or go create a patch on my own. I understand that there was some deep confusion surrounding the problem, but nevertheless I'm currently in the process of resolving this issue. ------------------------------------------------------------------------ [2004-01-02 10:59:23] [EMAIL PROTECTED] There is no bug here, can't you accept that? (and no, you can NOT pass multiple font files to these functions) ------------------------------------------------------------------------ [2004-01-01 23:43:31] choinet at rocketmail dot com Description: ------------ This report stems from bug report #26635, where spaces are not allowed in the pathname. There are more details towards the end of that report (http://bugs.php.net/26635) as to how I am sure that pathnames with spaces do not work. In fact, I have found out that spaces in the fontfile argument gd functions, such as imagettftext() are used to denote multiple fonts, which explains why trying to open pathnames with spaces in them did not work. I have found this by inserting two working paths into the fontfile argument of the above function and alternating their order to verify that they are both being opened correctly. What I am wondering is if there can be a different font list separator character than a space, such as &, that is not used in the directory naming convention to delimit the fonts specified in the fontfile argument, so that users may link to a font file with a space-containing pathname. Reproduce code: --------------- <?php $image = imagecreate(100, 100); // Example 1: no spaces in pathname $path = 'c:\arial.ttf'; imagettftext($image, 12, 0, 50, 50, $color, $path, "Hello"); // Example 2: space in pathname $path = 'c:\test folder\arial.ttf'; imagettftext($image, 12, 0, 50, 50, $color, $path, "Hello"); // Example 3: no spaces in multiple font pathnames $path = 'c:\arial.ttf'; $path2 = 'c:\cour.ttf'; imagettftext($image, 12, 0, 50, 50, $color, "$path $path2", "Hello"); //note the space between the two pathnames // Example 4: spaces in multiple font pathnames $path = 'c:\test folder\arial.ttf'; $path2 = 'c:\test folder\cour.ttf'; imagettftext($image, 12, 0, 50, 50, $color, "$path $path2", "Hello"); //note the space between the two pathnames ?> Expected result: ---------------- I expect no errors in each case. Actual result: -------------- (Taking each example one at a time by commenting out the others) Example 1: (no error) Example 2: Warning: imagettftext(): Could not find/open font in C:\Program Files\Apache Group\Apache2\htdocs\index.php on line 10 Example 3: (no error) Example 4: Warning: imagettftext(): Could not find/open font in C:\Program Files\Apache Group\Apache2\htdocs\index.php on line 20 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26764&edit=1