00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <ft2build.h>
00020 #include FT_FREETYPE_H
00021 #include FT_INTERNAL_OBJECTS_H
00022 #include "ttpic.h"
00023
00024 #ifdef FT_CONFIG_OPTION_PIC
00025
00026
00027 FT_Error FT_Create_Class_tt_services( FT_Library, FT_ServiceDescRec**);
00028 void FT_Destroy_Class_tt_services( FT_Library, FT_ServiceDescRec*);
00029 void FT_Init_Class_tt_service_gx_multi_masters(FT_Service_MultiMastersRec*);
00030 void FT_Init_Class_tt_service_truetype_glyf(FT_Service_TTGlyfRec*);
00031
00032 void
00033 tt_driver_class_pic_free( FT_Library library )
00034 {
00035 FT_PIC_Container* pic_container = &library->pic_container;
00036 FT_Memory memory = library->memory;
00037 if ( pic_container->truetype )
00038 {
00039 TTModulePIC* container = (TTModulePIC*)pic_container->truetype;
00040 if(container->tt_services)
00041 FT_Destroy_Class_tt_services(library, container->tt_services);
00042 container->tt_services = NULL;
00043 FT_FREE( container );
00044 pic_container->truetype = NULL;
00045 }
00046 }
00047
00048 FT_Error
00049 tt_driver_class_pic_init( FT_Library library )
00050 {
00051 FT_PIC_Container* pic_container = &library->pic_container;
00052 FT_Error error = FT_Err_Ok;
00053 TTModulePIC* container;
00054 FT_Memory memory = library->memory;
00055
00056
00057 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00058 return error;
00059 FT_MEM_SET( container, 0, sizeof(*container) );
00060 pic_container->truetype = container;
00061
00062
00063 error = FT_Create_Class_tt_services(library, &container->tt_services);
00064 if(error)
00065 goto Exit;
00066 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
00067 FT_Init_Class_tt_service_gx_multi_masters(&container->tt_service_gx_multi_masters);
00068 #endif
00069 FT_Init_Class_tt_service_truetype_glyf(&container->tt_service_truetype_glyf);
00070 Exit:
00071 if(error)
00072 tt_driver_class_pic_free(library);
00073 return error;
00074 }
00075
00076 #endif
00077
00078
00079