shithub: freetype+ttf2subf

Download patch

ref: 6cdab92b59aea379f7a8a6dc57271266d6434ed6
parent: 30bd28444784ddb7d579f0e175ff2de93f5ae534
author: Werner Lemberg <[email protected]>
date: Sun Jan 8 17:34:01 EST 2006

* docs/CHANGES: Updated.

* include/freetype/ftmodapi.h (FT_Module_Get_Flags): New
declaration.

* src/base/ftobjs.c (FT_Module_Get_Flags): New function.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-01-08  Werner Lemberg  <[email protected]>
 
+	* docs/CHANGES: Updated.
+
+2006-01-08  Huw D M Davies  <[email protected]>
+
+	* include/freetype/ftmodapi.h (FT_Module_Get_Flags): New
+	declaration.
+
+	* src/base/ftobjs.c (FT_Module_Get_Flags): New function.
+
+2006-01-07  Werner Lemberg  <[email protected]>
+
 	* src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable
 	`bitmaps'.  Reported by Yu Lei <[email protected]>.
 
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -66,6 +66,9 @@
       enable  the interpretation of  the `gasp'  table only  if native
       TrueType hinting is available.
 
+    - A new function `FT_Module_Get_Flags' (declared in `FT_MODULE_H')
+      can be used to get the module flags for a given module.
+
     - The demo programs  `ftview' and  `ftstring' have been  rewritten
       for better readability.
 
@@ -2689,7 +2692,7 @@
 
 ------------------------------------------------------------------------
 
-Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file  is  part  of the  FreeType  project, and may  only be  used,
--- a/include/freetype/ftmodapi.h
+++ b/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType modules public interface (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2006 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -98,27 +98,27 @@
   /*    The module class descriptor.                                       */
   /*                                                                       */
   /* <Fields>                                                              */
-  /*    module_flags      :: Bit flags describing the module.              */
+  /*    module_flags    :: Bit flags describing the module.                */
   /*                                                                       */
-  /*    module_size       :: The size of one module object/instance in     */
-  /*                         bytes.                                        */
+  /*    module_size     :: The size of one module object/instance in       */
+  /*                       bytes.                                          */
   /*                                                                       */
-  /*    module_name       :: The name of the module.                       */
+  /*    module_name     :: The name of the module.                         */
   /*                                                                       */
-  /*    module_version    :: The version, as a 16.16 fixed number          */
-  /*                         (major.minor).                                */
+  /*    module_version  :: The version, as a 16.16 fixed number            */
+  /*                       (major.minor).                                  */
   /*                                                                       */
-  /*    module_requires   :: The version of FreeType this module requires  */
-  /*                         (starts at version 2.0, i.e 0x20000)          */
+  /*    module_requires :: The version of FreeType this module requires    */
+  /*                       (starts at version 2.0, i.e., 0x20000)          */
   /*                                                                       */
-  /*    module_init       :: A function used to initialize (not create) a  */
-  /*                         new module object.                            */
+  /*    module_init     :: A function used to initialize (not create) a    */
+  /*                       new module object.                              */
   /*                                                                       */
-  /*    module_done       :: A function used to finalize (not destroy) a   */
-  /*                         given module object                           */
+  /*    module_done     :: A function used to finalize (not destroy) a     */
+  /*                       given module object                             */
   /*                                                                       */
-  /*    get_interface     :: Queries a given module for a specific         */
-  /*                         interface by name.                            */
+  /*    get_interface   :: Queries a given module for a specific           */
+  /*                       interface by name.                              */
   /*                                                                       */
   typedef struct  FT_Module_Class_
   {
@@ -216,6 +216,28 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
+  /*    FT_Module_Get_Flags                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Gets the module flags for a given module.                          */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    module :: A handle to a module object.                             */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    flags  :: The module's flags.                                      */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Module_Get_Flags( FT_Module  module,
+                       FT_ULong*  flags );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
   /*    FT_New_Library                                                     */
   /*                                                                       */
   /* <Description>                                                         */
@@ -288,7 +310,6 @@
   FT_Set_Debug_Hook( FT_Library         library,
                      FT_UInt            hook_index,
                      FT_DebugHook_Func  debug_hook );
-
 
 
   /*************************************************************************/
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -3163,6 +3163,23 @@
       }
 
     return result;
+  }
+
+
+  /* documentation is in ftmodapi.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Module_Get_Flags( FT_Module  module,
+                       FT_ULong*  flags )
+  {
+    if ( !module )
+      return FT_Err_Invalid_Driver_Handle;
+
+    if ( !flags )
+      return FT_Err_Invalid_Argument;
+
+    *flags = module->clazz->module_flags;
+    return FT_Err_Ok;
   }