Bug #17955 Updated: GD and unicode maps/webdings

From: Date: Mon, 24 Jun 2002 22:54:50 +0000
Subject: Bug #17955 Updated: GD and unicode maps/webdings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11984@lists.php.net to get a copy of this message
 ID:               17955
 Updated by:       sniper@php.net
 Reported By:      dk@webcluster.at
-Status:           Open
+Status:           Feedback
 Bug Type:         GD related
 Operating System: RedHat 7.3
 PHP Version:      4.2.1
 New Comment:

Being the lazy asses we are, could you add some
short example script which shows what doesn't work?

--Jani



Previous Comments:
------------------------------------------------------------------------

[2002-06-24 16:03:49] dk@webcluster.at

Hello,

I want to output the webdings.ttf font using freetype and gd.
Unfortunately I only get rectangular symbols back.

I discusse the issue inside the freetype mailing list and they told me
that 
"FreeType2 selects a Unicode charmap as default charmap for a font if
available. Webdings.ttf does not have a Unicode charmap."

They thought that it could be a bug in gd and supplied a patch for
gdlib.

_-_-_quote_-_-_


----8<----
  for (n = 0; n < a->face->num_charmaps; n++)
    {
      charmap = a->face->charmaps[n];
      platform = charmap->platform_id;
      encoding = charmap->encoding_id;
      if ((platform == 3 && encoding == 1)	/* Windows Unicode */
	  || (platform == 3 && encoding == 0)	/* Windows Symbol */
	  || (platform == 2 && encoding == 1)	/* ISO Unicode */
	  || (platform == 0))
	{			/* Apple Unicode */
	  a->have_char_map_unicode = 1;
	  found = charmap;
----8<----

So it would work if GD would not forget to tell FreeType2 to use the
charmap it found... :

----8<----
--- gd-2.0.1/gdft.c.ori	Tue Apr  3 20:44:42 2001
+++ gd-2.0.1/gdft.c	Mon Jun 24 16:25:35 2002
@@ -445,6 +445,12 @@
       *error = "Unable to find a CharMap that I can handle";
       return NULL;
     }
+  err = FT_Set_Charmap (a->face, found);
+  if (err)
+    {
+      *error = "Could not set CharMap";
+      return NULL;
+    }
 
   return (void *) a;
 }
----8<----
_-_-_quote_-_-_


I applied it, but it still doesn't seem to work.
I'm sure that the right gd is linked (ldd).

I've seen examples with Zapf Dingbats and Webdings work with other
languages, so I think it may be also a php issue.

Maybe you could point me on a solution.

Thanks in advance

Daniel Khan


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=17955&edit=1



Thread (14 messages)

« previous php.bugs (#11984) next »