freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] bug report.


From: Detlef Würkner
Subject: Re: [Devel] bug report.
Date: Fri, 05 Jul 2002 19:53:17 +0200

address@hidden (Alexey Kolesnikov) wrote:

> Dear developers,
> 
> I have found bug in FreeType2 2.1.2 and 2.1.0 releases.
> I try to use some Japanese fonts with FreeType library and GD
> library 2.0.1 version.
> 
> For example, when I use 'DFHsg9.ttf' font (see C source below) the
> image are not generated.
> Early version (2.0.9) of FreeType are works properly and image are
> generating.

This is a bug in GD, not in FreeType. The FreeType documentation clearly
states:

  /*    Each face object owns zero or more charmaps, but only one of       */
  /*    them can be "active" and used by @FT_Get_Char_Index or             */
  /*    @FT_Load_Char                                                      */
  /*                                                                       */
  /*    The list of available charmaps in a face is available through the  */
  /*    "face->num_charmaps" and "face->charmaps" fields of @FT_FaceRec    */
  /*                                                                       */
  /*    the currently active charmap is available as "face->charmap".      */
  /*    You should call @FT_Set_Charmap to change it                       */
  /*                                                                       */
  /* <Note>                                                                */
  /*    when a new face is created (either through @FT_New_Face or         */
  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */
  /*    the list and automatically activates it                            */

IMHO your font does not have an Unicode charmap so GD is responsible to
select and activate another charmap. Unfortunately GD only selects, but
forgets to activate... Try this GD patch:

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

If it doesnt work with the GD patch, maybe the charmap parsing
routines in FreeType are too restrictive in the meantime. Then
an URL to the font may help to find out more.

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



reply via email to

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