Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygensfntpic.c
Go to the documentation of this file.
00001 /***************************************************************************/ 00002 /* */ 00003 /* sfntpic.c */ 00004 /* */ 00005 /* The FreeType position independent code services for sfnt module. */ 00006 /* */ 00007 /* Copyright 2009, 2010 by */ 00008 /* Oran Agra and Mickey Gabel. */ 00009 /* */ 00010 /* This file is part of the FreeType project, and may only be used, */ 00011 /* modified, and distributed under the terms of the FreeType project */ 00012 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 00013 /* this file you indicate that you have read the license and */ 00014 /* understand and accept it fully. */ 00015 /* */ 00016 /***************************************************************************/ 00017 00018 00019 #include <ft2build.h> 00020 #include FT_FREETYPE_H 00021 #include FT_INTERNAL_OBJECTS_H 00022 #include "sfntpic.h" 00023 00024 #ifdef FT_CONFIG_OPTION_PIC 00025 00026 /* forward declaration of PIC init functions from sfdriver.c */ 00027 FT_Error FT_Create_Class_sfnt_services( FT_Library, FT_ServiceDescRec**); 00028 void FT_Destroy_Class_sfnt_services( FT_Library, FT_ServiceDescRec*); 00029 void FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec*); 00030 void FT_Init_Class_sfnt_interface( FT_Library, SFNT_Interface*); 00031 void FT_Init_Class_sfnt_service_glyph_dict( FT_Library, FT_Service_GlyphDictRec*); 00032 void FT_Init_Class_sfnt_service_ps_name( FT_Library, FT_Service_PsFontNameRec*); 00033 void FT_Init_Class_tt_service_get_cmap_info( FT_Library, FT_Service_TTCMapsRec*); 00034 void FT_Init_Class_sfnt_service_sfnt_table( FT_Service_SFNT_TableRec*); 00035 00036 /* forward declaration of PIC init functions from ttcmap.c */ 00037 FT_Error FT_Create_Class_tt_cmap_classes( FT_Library, TT_CMap_Class**); 00038 void FT_Destroy_Class_tt_cmap_classes( FT_Library, TT_CMap_Class*); 00039 00040 void 00041 sfnt_module_class_pic_free( FT_Library library ) 00042 { 00043 FT_PIC_Container* pic_container = &library->pic_container; 00044 FT_Memory memory = library->memory; 00045 if ( pic_container->sfnt ) 00046 { 00047 sfntModulePIC* container = (sfntModulePIC*)pic_container->sfnt; 00048 if(container->sfnt_services) 00049 FT_Destroy_Class_sfnt_services(library, container->sfnt_services); 00050 container->sfnt_services = NULL; 00051 if(container->tt_cmap_classes) 00052 FT_Destroy_Class_tt_cmap_classes(library, container->tt_cmap_classes); 00053 container->tt_cmap_classes = NULL; 00054 FT_FREE( container ); 00055 pic_container->sfnt = NULL; 00056 } 00057 } 00058 00059 00060 FT_Error 00061 sfnt_module_class_pic_init( FT_Library library ) 00062 { 00063 FT_PIC_Container* pic_container = &library->pic_container; 00064 FT_Error error = SFNT_Err_Ok; 00065 sfntModulePIC* container; 00066 FT_Memory memory = library->memory; 00067 00068 00069 /* allocate pointer, clear and set global container pointer */ 00070 if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 00071 return error; 00072 FT_MEM_SET( container, 0, sizeof ( *container ) ); 00073 pic_container->sfnt = container; 00074 00075 /* initialize pointer table - this is how the module usually expects this data */ 00076 error = FT_Create_Class_sfnt_services(library, &container->sfnt_services); 00077 if(error) 00078 goto Exit; 00079 error = FT_Create_Class_tt_cmap_classes(library, &container->tt_cmap_classes); 00080 if(error) 00081 goto Exit; 00082 FT_Init_Class_sfnt_service_glyph_dict(library, &container->sfnt_service_glyph_dict); 00083 FT_Init_Class_sfnt_service_ps_name(library, &container->sfnt_service_ps_name); 00084 FT_Init_Class_tt_service_get_cmap_info(library, &container->tt_service_get_cmap_info); 00085 FT_Init_Class_sfnt_service_sfnt_table(&container->sfnt_service_sfnt_table); 00086 #ifdef TT_CONFIG_OPTION_BDF 00087 FT_Init_Class_sfnt_service_bdf(&container->sfnt_service_bdf); 00088 #endif 00089 FT_Init_Class_sfnt_interface(library, &container->sfnt_interface); 00090 00091 Exit: 00092 if(error) 00093 sfnt_module_class_pic_free(library); 00094 return error; 00095 } 00096 00097 00098 00099 #endif /* FT_CONFIG_OPTION_PIC */ 00100 00101 00102 /* END */ Generated on Sat May 26 2012 04:32:55 for ReactOS by
1.7.6.1
|