Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 May 2004 19:38:20 +0200 (CEST)
From:      Wolfgang Zenker <wolfgang@lyxys.ka.sub.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        wolfgang@lyxys.ka.sub.org
Subject:   ports/66669: lang/php4 with builtin gd does not render characters above 0x7f
Message-ID:  <m1BP376-003pTGC@lyxys.ka.sub.org>
Resent-Message-ID: <200405151740.i4FHeEhf027306@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         66669
>Category:       ports
>Synopsis:       lang/php4 with builtin gd does not render characters above 0x7f
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 15 10:40:13 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Zenker
>Release:        FreeBSD 4.10-BETA i386
>Organization:
>Environment:
System: FreeBSD desk.lyx 4.10-BETA FreeBSD 4.10-BETA #24: Wed Apr 14 09:07:40 CEST 2004     wolfgang@desk.lyx:/var/obj/usr/local/src/sys/DESK  i386

Port version: php4-4.3.6_1
Port parameters: BATCH=YES WITH_WDDX=YES WITH_GD=YES

>Description:
	When you try to render text containing characters above 0x7f,
	e.g. a german "umlaut", into a graphic, all characters > 0x7f
	are rendered as an empty block. I haven't tried this on non-FreeBSD
	systems yet, but there is some evidence this is a FreeBSD- and not
	a PHP problem: This bug creates a problem for users of the typo3
	CMS system in creating graphical menues. All users reporting
	this problem on the typo3 mailing lists where using FreeBSD,
	while most(?) of the typo3 users apparently use Linux.

>How-To-Repeat:
	The php-script imgtest.php below here demonstrates the problem.
	It should generate a jpg containing the text "Bäh!" (note the
	second letter is a german a-umlaut). The second character is
	displayed as an empty white block with black borders instead.
	I used an arial-font from the x11-fonts/webfonts port, but
	any other ttf-font containing that character should do. Just
	change /usr/X11R6/lib/X11/fonts/webfonts/arial.ttf to the font
	you want to use.

--- imgtest.php begins here ---
<?php
  header("Content-type: image/jpeg");
  $im = imagecreate(400, 30);
  $white = imagecolorallocate($im, 255, 255, 255);
  $black = imagecolorallocate($im, 0, 0, 0);
 
  imagettftext($im, 20, 0, 10, 20, $black,
    // Replace path with your own font path:
    "/usr/X11R6/lib/X11/fonts/webfonts/arial.ttf", 
    utf8_encode("Bäh!"));
  imagejpeg($im);
  imagedestroy($im);
?>
--- imgtest.php ends here ---


>Fix:

	You can work around the problem by compiling lang/php4 in a way
	that it uses graphics/gd instead of the builtin gd bundled with
	php4. To do this change the Line in lang/php4/Makefile saying
	CONFIGURE_ARGS+=--with-gd \ 
	into
	CONFIGURE_ARGS+=--with-gd=${LOCALBASE} \ 
	and build lang/php4 after installing graphics/gd first.
	Be aware that this minimal Makefile patch doesn't register the
	dependency from ang/php4 to graphics/gd, to do this you would
	probably have to add a LIB_DEPENDS line as well.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m1BP376-003pTGC>