Edit report at http://bugs.php.net/bug.php?id=51135&edit=1
ID: 51135 Comment by: sharon_correll at sil dot org Reported by: sharon_correll at sil dot org Summary: imagettftext does not work for characters > 99999 Status: Assigned Type: Bug Package: GD related Operating System: Windows Vista PHP Version: 5.2.12 Assigned To: tabe Block user comment: N New Comment: The responses to this report seem to imply that ImageTtfText WIIL work correctly for characters in the range U+10000 - U+1869F (65536 - 99999). However, this does not seem to be the case. When I call it with "𐀁" (U+10001), it produces an "missing" glyph, even using a font that contains the character (CODE2001.ttf). This is a slightly different bug than what I originally reported, but I would guess it is related. Is it a known problem? Previous Comments: ------------------------------------------------------------------------ [2010-03-05 17:24:42] [email protected] The following patch has been added/updated: Patch Name: bundled-libgd-non-bmp-entities Revision: 1267806282 URL: http://bugs.php.net/patch-display.php?bug=51135&patch=bundled-libgd-non-bmp-entities&revision=1267806282&display=1 ------------------------------------------------------------------------ [2010-03-05 17:23:44] [email protected] This is still happening with an up-to-date PHP_5_3 SVN checkout using the bundled libgd. I've only tested it on Linux, but the relevant code in libgd/gdft.c doesn't appear to be platform specific. It's exactly what the libgd bug indicates: gdTcl_UtfToUniChar() simply stops looking for the end of a numeric or hexadecimal entity reference two characters earlier than it should to cover all possible Unicode characters out to Plane 16. The patch for libgd is trivial, and I'll attach it after I post this comment. I've created a tarball containing a test script, a font containing Plane 1 characters (which is valid, and does work to render characters in Plane 1 blocks in desktop applications), PNG images showing PHP and libgd's behaviour before and after the patch, and a mockup rendering showing roughly what this is actually meant to look like, which you can get from: http://www.adamharvey.name/stuff/bug51135.tar.bz2 Note that the attached patch isn't actually the whole solution, as is clear if you compare with-patch.png to the mockup. It does make gdTcl_UtfToUniChar() decode the entities, but there are evidently other issues that prevent non-BMP characters from actually being rendered properly, as libgd bug 42 notes. ------------------------------------------------------------------------ [2010-03-05 15:55:25] [email protected] [email protected]: Not if the bundled is used. Which is the case on windows. Tabe, can you verify this issue please? ------------------------------------------------------------------------ [2010-03-05 15:45:14] sharon_correll at sil dot org Thank you for the information; it's helpful to know the status. ------------------------------------------------------------------------ [2010-03-05 06:38:59] [email protected] This is still happening in PHP_5_3, but it's not a PHP bug as such: it's a bug in libgd itself. There's already an open bug in the libgd issue tracker covering this issue, which still exists in the current HEAD of libgd: http://bugs.libgd.org/?do=details&task_id=42 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=51135 -- Edit this bug report at http://bugs.php.net/bug.php?id=51135&edit=1
