Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenafpic.c
Go to the documentation of this file.
00001 /***************************************************************************/ 00002 /* */ 00003 /* afpic.c */ 00004 /* */ 00005 /* The FreeType position independent code services for autofit 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 "afpic.h" 00023 00024 #ifdef FT_CONFIG_OPTION_PIC 00025 00026 /* forward declaration of PIC init functions from afmodule.c */ 00027 void FT_Init_Class_af_autofitter_service( FT_Library, FT_AutoHinter_ServiceRec*); 00028 00029 /* forward declaration of PIC init functions from script classes */ 00030 #include "aflatin.h" 00031 #include "aflatin2.h" 00032 #include "afcjk.h" 00033 #include "afdummy.h" 00034 #include "afindic.h" 00035 00036 void 00037 autofit_module_class_pic_free( FT_Library library ) 00038 { 00039 FT_PIC_Container* pic_container = &library->pic_container; 00040 FT_Memory memory = library->memory; 00041 if ( pic_container->autofit ) 00042 { 00043 FT_FREE( pic_container->autofit ); 00044 pic_container->autofit = NULL; 00045 } 00046 } 00047 00048 00049 FT_Error 00050 autofit_module_class_pic_init( FT_Library library ) 00051 { 00052 FT_PIC_Container* pic_container = &library->pic_container; 00053 FT_UInt ss; 00054 FT_Error error = AF_Err_Ok; 00055 AFModulePIC* container; 00056 FT_Memory memory = library->memory; 00057 00058 00059 /* allocate pointer, clear and set global container pointer */ 00060 if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 00061 return error; 00062 FT_MEM_SET( container, 0, sizeof ( *container ) ); 00063 pic_container->autofit = container; 00064 00065 /* initialize pointer table - this is how the module usually expects this data */ 00066 for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ ) 00067 { 00068 container->af_script_classes[ss] = &container->af_script_classes_rec[ss]; 00069 } 00070 container->af_script_classes[AF_SCRIPT_CLASSES_COUNT-1] = NULL; 00071 00072 /* add call to initialization function when you add new scripts */ 00073 ss = 0; 00074 FT_Init_Class_af_dummy_script_class(&container->af_script_classes_rec[ss++]); 00075 #ifdef FT_OPTION_AUTOFIT2 00076 FT_Init_Class_af_latin2_script_class(&container->af_script_classes_rec[ss++]); 00077 #endif 00078 FT_Init_Class_af_latin_script_class(&container->af_script_classes_rec[ss++]); 00079 FT_Init_Class_af_cjk_script_class(&container->af_script_classes_rec[ss++]); 00080 FT_Init_Class_af_indic_script_class(&container->af_script_classes_rec[ss++]); 00081 00082 FT_Init_Class_af_autofitter_service(library, &container->af_autofitter_service); 00083 00084 /*Exit:*/ 00085 if(error) 00086 autofit_module_class_pic_free(library); 00087 return error; 00088 } 00089 00090 00091 #endif /* FT_CONFIG_OPTION_PIC */ 00092 00093 00094 /* END */ Generated on Sun May 27 2012 04:33:34 for ReactOS by
1.7.6.1
|