ftgxval.c

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftgxval.c                                                              */
00004 /*                                                                         */
00005 /*    FreeType API for validating TrueTyepGX/AAT tables (body).            */
00006 /*                                                                         */
00007 /*  Copyright 2004, 2005, 2006 by                                          */
00008 /*  Masatake YAMATO, Redhat K.K,                                           */
00009 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00010 /*                                                                         */
00011 /*  This file is part of the FreeType project, and may only be used,       */
00012 /*  modified, and distributed under the terms of the FreeType project      */
00013 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00014 /*  this file you indicate that you have read the license and              */
00015 /*  understand and accept it fully.                                        */
00016 /*                                                                         */
00017 /***************************************************************************/
00018 
00019 /***************************************************************************/
00020 /*                                                                         */
00021 /* gxvalid is derived from both gxlayout module and otvalid module.        */
00022 /* Development of gxlayout is supported by the Information-technology      */
00023 /* Promotion Agency(IPA), Japan.                                           */
00024 /*                                                                         */
00025 /***************************************************************************/
00026 
00027 
00028 #include <ft2build.h>
00029 #include FT_INTERNAL_OBJECTS_H
00030 #include FT_SERVICE_GX_VALIDATE_H
00031 
00032 
00033   /* documentation is in ftgxval.h */
00034 
00035   FT_EXPORT_DEF( FT_Error )
00036   FT_TrueTypeGX_Validate( FT_Face   face,
00037                           FT_UInt   validation_flags,
00038                           FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],
00039                           FT_UInt   table_length )
00040   {
00041     FT_Service_GXvalidate  service;
00042     FT_Error               error;
00043 
00044 
00045     if ( !face )
00046     {
00047       error = FT_Err_Invalid_Face_Handle;
00048       goto Exit;
00049     }
00050 
00051     if ( tables == NULL )
00052     {
00053       error = FT_Err_Invalid_Argument;
00054       goto Exit;
00055     }
00056 
00057     FT_FACE_FIND_GLOBAL_SERVICE( face, service, GX_VALIDATE );
00058 
00059     if ( service )
00060       error = service->validate( face,
00061                                  validation_flags,
00062                                  tables,
00063                                  table_length );
00064     else
00065       error = FT_Err_Unimplemented_Feature;
00066 
00067   Exit:
00068     return error;
00069   }
00070 
00071 
00072   FT_EXPORT_DEF( void )
00073   FT_TrueTypeGX_Free( FT_Face   face,
00074                       FT_Bytes  table )
00075   {
00076     FT_Memory  memory = FT_FACE_MEMORY( face );
00077 
00078 
00079     FT_FREE( table );
00080   }
00081 
00082 
00083   FT_EXPORT_DEF( FT_Error )
00084   FT_ClassicKern_Validate( FT_Face    face,
00085                            FT_UInt    validation_flags,
00086                            FT_Bytes  *ckern_table )
00087   {
00088     FT_Service_CKERNvalidate  service;
00089     FT_Error                  error;
00090 
00091 
00092     if ( !face )
00093     {
00094       error = FT_Err_Invalid_Face_Handle;
00095       goto Exit;
00096     }
00097 
00098     if ( ckern_table == NULL )
00099     {
00100       error = FT_Err_Invalid_Argument;
00101       goto Exit;
00102     }
00103 
00104     FT_FACE_FIND_GLOBAL_SERVICE( face, service, CLASSICKERN_VALIDATE );
00105 
00106     if ( service )
00107       error = service->validate( face,
00108                                  validation_flags,
00109                                  ckern_table );
00110     else
00111       error = FT_Err_Unimplemented_Feature;
00112 
00113   Exit:
00114     return error;
00115   }
00116 
00117 
00118   FT_EXPORT_DEF( void )
00119   FT_ClassicKern_Free( FT_Face   face,
00120                        FT_Bytes  table )
00121   {
00122     FT_Memory  memory = FT_FACE_MEMORY( face );
00123 
00124 
00125     FT_FREE( table );
00126   }
00127 
00128 
00129 /* END */

Generated on Tue Jul 5 14:13:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1