Commit 2a0903a54b637bc320e9fcad5161ddce3c26f484

Werner Lemberg 2005-12-03T08:13:43

* src/type42/t42objs.x (T42_Face_Init): Replace call to FT_New_Memory_Face with call to FT_Open_Face to pass `params'.

diff --git a/ChangeLog b/ChangeLog
index bc7686d..b71331b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-02  Taek Kwan(TK) Lee  <taeklee@gmail.com>
+
+	* src/type42/t42objs.x (T42_Face_Init): Replace call to
+	FT_New_Memory_Face with call to FT_Open_Face to pass `params'.
+
 2005-11-30  Werner Lemberg  <wl@gnu.org>
 
 	* docs/CHANGES: Document ftdump's `-v' option.
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 814ad90..f3f8406 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -263,11 +263,25 @@
     root->available_sizes = 0;
 
     /* Load the TTF font embedded in the T42 font */
-    error = FT_New_Memory_Face( FT_FACE_LIBRARY( face ),
-                                face->ttf_data,
-                                face->ttf_size,
-                                0,
-                                &face->ttf_face );
+    {
+      FT_Open_Args  args;
+
+
+      args.flags       = FT_OPEN_MEMORY;
+      args.memory_base = face->ttf_data;
+      args.memory_size = face->ttf_size;
+
+      if ( num_params )
+      {
+        args.flags     |= FT_OPEN_PARAMS;
+        args.num_params = num_params;
+        args.params     = params;
+      }
+
+      error = FT_Open_Face( FT_FACE_LIBRARY( face ),
+                            &args, 0, &face->ttf_face );
+    }
+
     if ( error )
       goto Exit;