freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: [Freetype] webdings and php


From: Detlef Würkner
Subject: Re: AW: [Freetype] webdings and php
Date: Mon, 24 Jun 2002 16:38:41 +0200

address@hidden (Daniel Khan) wrote:

> Hi Detlef,
> 
> > address@hidden (Daniel Khan) wrote:
> >
> > > when I try to output a webdings font via php using freetype 2 I only
> > > get rectangular shapes as output instead of the letters.
> > >
> > > Can anyone tell me what could be wrong?
> >
> > FreeType2 selects a Unicode charmap as default charmap for a font if
> > available. Webdings.ttf does not have a Unicode charmap. Try to use
> > something like that:
> 
> [..Code example..]
> 
> As I use freetype withing php I don't really know, where I should use the
> code
> you provided. How can I use this in php?
> Sorry - maybe I'm too dumb..
> Thanks in advance

Didnt know what php is (unknown on Amiga ;). Ok, its not a php problem.
And not a FreeType2 problem. Must be a GD problem since php uses gd to
call FreeType2. Looked into the GD source code and found that:

----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... Send the following patch to the GD developers and
wait for a new GD version:

----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<----


Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

[Prev in Thread] Current Thread [Next in Thread]