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 "basepic.h"
00023
00024 #ifdef FT_CONFIG_OPTION_PIC
00025
00026
00027 void FT_Init_Class_ft_outline_glyph_class(FT_Glyph_Class*);
00028 void FT_Init_Class_ft_bitmap_glyph_class(FT_Glyph_Class*);
00029
00030
00031 FT_Error ft_create_default_module_classes(FT_Library);
00032 void ft_destroy_default_module_classes(FT_Library);
00033
00034 void
00035 ft_base_pic_free( FT_Library library )
00036 {
00037 FT_PIC_Container* pic_container = &library->pic_container;
00038 FT_Memory memory = library->memory;
00039 if ( pic_container->base )
00040 {
00041
00042 ft_destroy_default_module_classes( library );
00043
00044 FT_FREE( pic_container->base );
00045 pic_container->base = NULL;
00046 }
00047 }
00048
00049
00050 FT_Error
00051 ft_base_pic_init( FT_Library library )
00052 {
00053 FT_PIC_Container* pic_container = &library->pic_container;
00054 FT_Error error = FT_Err_Ok;
00055 BasePIC* container;
00056 FT_Memory memory = library->memory;
00057
00058
00059 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00060 return error;
00061 FT_MEM_SET( container, 0, sizeof(*container) );
00062 pic_container->base = container;
00063
00064
00065 error = ft_create_default_module_classes( library );
00066 if ( error )
00067 goto Exit;
00068
00069
00070 FT_Init_Class_ft_outline_glyph_class(&container->ft_outline_glyph_class);
00071 FT_Init_Class_ft_bitmap_glyph_class(&container->ft_bitmap_glyph_class);
00072
00073 Exit:
00074 if(error)
00075 ft_base_pic_free(library);
00076 return error;
00077 }
00078
00079
00080 #endif
00081
00082
00083