Formatting, comment fixes.

This commit is contained in:
Werner Lemberg 2012-07-29 13:15:53 +02:00
parent 6274bd370f
commit 5987445073
11 changed files with 1024 additions and 655 deletions

View File

@ -4,7 +4,7 @@
/* */ /* */
/* High-level `autohint' module-specific interface (specification). */ /* High-level `autohint' module-specific interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2007 by */ /* Copyright 1996-2002, 2007, 2009, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -196,29 +196,42 @@ FT_BEGIN_HEADER
} FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service; } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ #define FT_DEFINE_AUTOHINTER_SERVICE( \
done_global_hints_, load_glyph_) \ class_, \
FT_CALLBACK_TABLE_DEF \ reset_face_, \
const FT_AutoHinter_ServiceRec class_ = \ get_global_hints_, \
{ \ done_global_hints_, \
reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \ load_glyph_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_AutoHinter_ServiceRec class_ = \
{ \
reset_face_, \
get_global_hints_, \
done_global_hints_, \
load_glyph_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ #define FT_DEFINE_AUTOHINTER_SERVICE( \
done_global_hints_, load_glyph_) \ class_, \
void \ reset_face_, \
FT_Init_Class_##class_( FT_Library library, \ get_global_hints_, \
FT_AutoHinter_ServiceRec* clazz) \ done_global_hints_, \
{ \ load_glyph_ ) \
FT_UNUSED(library); \ void \
clazz->reset_face = reset_face_; \ FT_Init_Class_ ## class_( FT_Library library, \
clazz->get_global_hints = get_global_hints_; \ FT_AutoHinter_ServiceRec* clazz ) \
clazz->done_global_hints = done_global_hints_; \ { \
clazz->load_glyph = load_glyph_; \ FT_UNUSED( library ); \
\
clazz->reset_face = reset_face_; \
clazz->get_global_hints = get_global_hints_; \
clazz->done_global_hints = done_global_hints_; \
clazz->load_glyph = load_glyph_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType font driver interface (specification). */ /* FreeType font driver interface (specification). */
/* */ /* */
/* Copyright 1996-2003, 2006, 2008, 2011 by */ /* Copyright 1996-2003, 2006, 2008, 2011-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -181,37 +181,37 @@ FT_BEGIN_HEADER
/* */ /* */
typedef struct FT_Driver_ClassRec_ typedef struct FT_Driver_ClassRec_
{ {
FT_Module_Class root; FT_Module_Class root;
FT_Long face_object_size; FT_Long face_object_size;
FT_Long size_object_size; FT_Long size_object_size;
FT_Long slot_object_size; FT_Long slot_object_size;
FT_Face_InitFunc init_face; FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face; FT_Face_DoneFunc done_face;
FT_Size_InitFunc init_size; FT_Size_InitFunc init_size;
FT_Size_DoneFunc done_size; FT_Size_DoneFunc done_size;
FT_Slot_InitFunc init_slot; FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot; FT_Slot_DoneFunc done_slot;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_Size_ResetPointsFunc set_char_sizes; FT_Size_ResetPointsFunc set_char_sizes;
FT_Size_ResetPixelsFunc set_pixel_sizes; FT_Size_ResetPixelsFunc set_pixel_sizes;
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
FT_Slot_LoadFunc load_glyph; FT_Slot_LoadFunc load_glyph;
FT_Face_GetKerningFunc get_kerning; FT_Face_GetKerningFunc get_kerning;
FT_Face_AttachFunc attach_file; FT_Face_AttachFunc attach_file;
FT_Face_GetAdvancesFunc get_advances; FT_Face_GetAdvancesFunc get_advances;
/* since version 2.2 */ /* since version 2.2 */
FT_Size_RequestFunc request_size; FT_Size_RequestFunc request_size;
FT_Size_SelectFunc select_size; FT_Size_SelectFunc select_size;
} FT_Driver_ClassRec, *FT_Driver_Class; } FT_Driver_ClassRec, *FT_Driver_Class;
@ -239,14 +239,15 @@ FT_BEGIN_HEADER
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DECLARE_DRIVER */ /* FT_DECLARE_DRIVER */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to create a forward declaration of a */ /* Used to create a forward declaration of an FT_Driver_ClassRec */
/* FT_Driver_ClassRec stract instance. */ /* struct instance. */
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DEFINE_DRIVER */ /* FT_DEFINE_DRIVER */
@ -254,160 +255,219 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */ /* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ /* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
/* to called with a pointer where the allocated stracture is returned.*/ /* called with a pointer where the allocated structure is returned. */
/* And when it is no longer needed a Destroy function needs */ /* And when it is no longer needed a `destroy' function needs to be */
/* to be called to release that allocation. */ /* called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */
/* */ /* */
/* Notice that the created Create and Destroy functions call */ /* `fcinit.c' (ft_create_default_module_classes) already contains a */
/* pic_init and pic_free function to allow you to manually allocate */ /* mechanism to call these functions for the default modules */
/* and initialize any additional global data, like module specific */ /* described in `ftmodule.h'. */
/* */
/* Notice that the created `create' and `destroy' functions call */
/* `pic_init' and `pic_free' to allow you to manually allocate and */
/* initialize any additional global data, like a module specific */
/* interface, and put them in the global pic container defined in */ /* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */ /* `ftpic.h'. If you don't need them just implement the functions as */
/* empty to resolve the link error. Also the pic_init and pic_free */ /* empty to resolve the link error. Also the `pic_init' and */
/* functions should be declared in pic.h, to be referred by driver */ /* `pic_free' functions should be declared in `pic.h', to be referred */
/* definition calling FT_DEFINE_DRIVER() in following. */ /* by driver definition calling `FT_DEFINE_DRIVER' in following. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro is */
/* is used). */ /* used). */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ #define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
a_, b_, a_, b_,
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) #define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
#endif #endif
#define FT_DECLARE_DRIVER(class_) \ #define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \ FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_; const FT_Driver_ClassRec class_;
#define FT_DEFINE_DRIVER(class_, \ #define FT_DEFINE_DRIVER( \
flags_, size_, name_, version_, requires_, \ class_, \
interface_, init_, done_, get_interface_, \ flags_, \
face_object_size_, size_object_size_, \ size_, \
slot_object_size_, init_face_, done_face_, \ name_, \
init_size_, done_size_, init_slot_, done_slot_, \ version_, \
old_set_char_sizes_, old_set_pixel_sizes_, \ requires_, \
load_glyph_, get_kerning_, attach_file_, \ interface_, \
get_advances_, request_size_, select_size_ ) \ init_, \
FT_CALLBACK_TABLE_DEF \ done_, \
const FT_Driver_ClassRec class_ = \ get_interface_, \
{ \ face_object_size_, \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ size_object_size_, \
init_,done_,get_interface_) \ slot_object_size_, \
\ init_face_, \
face_object_size_, \ done_face_, \
size_object_size_, \ init_size_, \
slot_object_size_, \ done_size_, \
\ init_slot_, \
init_face_, \ done_slot_, \
done_face_, \ old_set_char_sizes_, \
\ old_set_pixel_sizes_, \
init_size_, \ load_glyph_, \
done_size_, \ get_kerning_, \
\ attach_file_, \
init_slot_, \ get_advances_, \
done_slot_, \ request_size_, \
\ select_size_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ FT_CALLBACK_TABLE_DEF \
\ const FT_Driver_ClassRec class_ = \
load_glyph_, \ { \
\ FT_DEFINE_ROOT_MODULE( flags_, \
get_kerning_, \ size_, \
attach_file_, \ name_, \
get_advances_, \ version_, \
\ requires_, \
request_size_, \ interface_, \
select_size_ \ init_, \
done_, \
get_interface_ ) \
\
face_object_size_, \
size_object_size_, \
slot_object_size_, \
\
init_face_, \
done_face_, \
\
init_size_, \
done_size_, \
\
init_slot_, \
done_slot_, \
\
FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
old_set_pixel_sizes_ ) \
\
load_glyph_, \
\
get_kerning_, \
attach_file_, \
get_advances_, \
\
request_size_, \
select_size_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ #define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
clazz->set_char_sizes = a_; \ clazz->set_char_sizes = a_; \
clazz->set_pixel_sizes = b_; clazz->set_pixel_sizes = b_;
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) #define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
#endif #endif
#define FT_DECLARE_DRIVER(class_) FT_DECLARE_MODULE(class_) #define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER(class_, \ #define FT_DEFINE_DRIVER( \
flags_, size_, name_, version_, requires_, \ class_, \
interface_, init_, done_, get_interface_, \ flags_, \
face_object_size_, size_object_size_, \ size_, \
slot_object_size_, init_face_, done_face_, \ name_, \
init_size_, done_size_, init_slot_, done_slot_, \ version_, \
old_set_char_sizes_, old_set_pixel_sizes_, \ requires_, \
load_glyph_, get_kerning_, attach_file_, \ interface_, \
get_advances_, request_size_, select_size_ ) \ init_, \
\ done_, \
void \ get_interface_, \
FT_Destroy_Class_##class_( FT_Library library, \ face_object_size_, \
FT_Module_Class* clazz ) \ size_object_size_, \
{ \ slot_object_size_, \
FT_Memory memory = library->memory; \ init_face_, \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \ done_face_, \
class_##_pic_free( library ); \ init_size_, \
if ( dclazz ) \ done_size_, \
FT_FREE( dclazz ); \ init_slot_, \
} \ done_slot_, \
\ old_set_char_sizes_, \
FT_Error \ old_set_pixel_sizes_, \
FT_Create_Class_##class_( FT_Library library, \ load_glyph_, \
FT_Module_Class** output_class ) \ get_kerning_, \
{ \ attach_file_, \
FT_Driver_Class clazz; \ get_advances_, \
FT_Error error; \ request_size_, \
FT_Memory memory = library->memory; \ select_size_ ) \
\ void \
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ FT_Destroy_Class_ ## class_( FT_Library library, \
return error; \ FT_Module_Class* clazz ) \
\ { \
error = class_##_pic_init( library ); \ FT_Memory memory = library->memory; \
if(error) \ FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
{ \ \
FT_FREE( clazz ); \ \
return error; \ class_ ## _pic_free( library ); \
} \ if ( dclazz ) \
\ FT_FREE( dclazz ); \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ } \
init_,done_,get_interface_) \ \
\ \
clazz->face_object_size = face_object_size_; \ FT_Error \
clazz->size_object_size = size_object_size_; \ FT_Create_Class_ ## class_( FT_Library library, \
clazz->slot_object_size = slot_object_size_; \ FT_Module_Class** output_class ) \
\ { \
clazz->init_face = init_face_; \ FT_Driver_Class clazz; \
clazz->done_face = done_face_; \ FT_Error error; \
\ FT_Memory memory = library->memory; \
clazz->init_size = init_size_; \ \
clazz->done_size = done_size_; \ \
\ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
clazz->init_slot = init_slot_; \ return error; \
clazz->done_slot = done_slot_; \ \
\ error = class_ ## _pic_init( library ); \
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ if ( error ) \
\ { \
clazz->load_glyph = load_glyph_; \ FT_FREE( clazz ); \
\ return error; \
clazz->get_kerning = get_kerning_; \ } \
clazz->attach_file = attach_file_; \ \
clazz->get_advances = get_advances_; \ FT_DEFINE_ROOT_MODULE( flags_, \
\ size_, \
clazz->request_size = request_size_; \ name_, \
clazz->select_size = select_size_; \ version_, \
\ requires_, \
*output_class = (FT_Module_Class*)clazz; \ interface_, \
return FT_Err_Ok; \ init_, \
done_, \
get_interface_) \
\
clazz->face_object_size = face_object_size_; \
clazz->size_object_size = size_object_size_; \
clazz->slot_object_size = slot_object_size_; \
\
clazz->init_face = init_face_; \
clazz->done_face = done_face_; \
\
clazz->init_size = init_size_; \
clazz->done_size = done_size_; \
\
clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \
\
FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
old_set_pixel_sizes_ ) \
\
clazz->load_glyph = load_glyph_; \
\
clazz->get_kerning = get_kerning_; \
clazz->attach_file = attach_file_; \
clazz->get_advances = get_advances_; \
\
clazz->request_size = request_size_; \
clazz->select_size = select_size_; \
\
*output_class = (FT_Module_Class*)clazz; \
\
return FT_Err_Ok; \
} }

View File

@ -206,46 +206,79 @@ FT_BEGIN_HEADER
} FT_CMap_ClassRec; } FT_CMap_ClassRec;
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_CMAP_CLASS(class_) \ #define FT_DECLARE_CMAP_CLASS( class_ ) \
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_; FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \ #define FT_DEFINE_CMAP_CLASS( \
char_next_, char_var_index_, char_var_default_, variant_list_, \ class_, \
charvariant_list_, variantchar_list_) \ size_, \
FT_CALLBACK_TABLE_DEF \ init_, \
const FT_CMap_ClassRec class_ = \ done_, \
{ \ char_index_, \
size_, init_, done_, char_index_, char_next_, char_var_index_, \ char_next_, \
char_var_default_, variant_list_, charvariant_list_, variantchar_list_ \ char_var_index_, \
char_var_default_, \
variant_list_, \
charvariant_list_, \
variantchar_list_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_CMap_ClassRec class_ = \
{ \
size_, \
init_, \
done_, \
char_index_, \
char_next_, \
char_var_index_, \
char_var_default_, \
variant_list_, \
charvariant_list_, \
variantchar_list_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_CMAP_CLASS(class_) \ #define FT_DECLARE_CMAP_CLASS( class_ ) \
void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec* clazz); void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_CMap_ClassRec* clazz );
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \ #define FT_DEFINE_CMAP_CLASS( \
char_next_, char_var_index_, char_var_default_, variant_list_, \ class_, \
charvariant_list_, variantchar_list_) \ size_, \
void \ init_, \
FT_Init_Class_##class_( FT_Library library, \ done_, \
FT_CMap_ClassRec* clazz) \ char_index_, \
{ \ char_next_, \
FT_UNUSED(library); \ char_var_index_, \
clazz->size = size_; \ char_var_default_, \
clazz->init = init_; \ variant_list_, \
clazz->done = done_; \ charvariant_list_, \
clazz->char_index = char_index_; \ variantchar_list_ ) \
clazz->char_next = char_next_; \ void \
clazz->char_var_index = char_var_index_; \ FT_Init_Class_ ## class_( FT_Library library, \
clazz->char_var_default = char_var_default_; \ FT_CMap_ClassRec* clazz ) \
clazz->variant_list = variant_list_; \ { \
clazz->charvariant_list = charvariant_list_; \ FT_UNUSED( library ); \
clazz->variantchar_list = variantchar_list_; \ \
clazz->size = size_; \
clazz->init = init_; \
clazz->done = done_; \
clazz->char_index = char_index_; \
clazz->char_next = char_next_; \
clazz->char_var_index = char_var_index_; \
clazz->char_var_default = char_var_default_; \
clazz->variant_list = variant_list_; \
clazz->charvariant_list = charvariant_list_; \
clazz->variantchar_list = variantchar_list_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* create a new charmap and add it to charmap->face */ /* create a new charmap and add it to charmap->face */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_CMap_New( FT_CMap_Class clazz, FT_CMap_New( FT_CMap_Class clazz,
@ -926,6 +959,7 @@ FT_BEGIN_HEADER
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster; FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
#endif #endif
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -947,38 +981,57 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Outline_Funcs struct. */ /* Used to initialize an instance of FT_Outline_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */ /* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
/* is used). */ /* is used). */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ #define FT_DEFINE_OUTLINE_FUNCS( \
cubic_to_, shift_, delta_) \ class_, \
static const FT_Outline_Funcs class_ = \ move_to_, \
{ \ line_to_, \
move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \ conic_to_, \
cubic_to_, \
shift_, \
delta_ ) \
static const FT_Outline_Funcs class_ = \
{ \
move_to_, \
line_to_, \
conic_to_, \
cubic_to_, \
shift_, \
delta_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ #define FT_DEFINE_OUTLINE_FUNCS( \
cubic_to_, shift_, delta_) \ class_, \
static FT_Error \ move_to_, \
Init_Class_##class_( FT_Outline_Funcs* clazz ) \ line_to_, \
{ \ conic_to_, \
clazz->move_to = move_to_; \ cubic_to_, \
clazz->line_to = line_to_; \ shift_, \
clazz->conic_to = conic_to_; \ delta_ ) \
clazz->cubic_to = cubic_to_; \ static FT_Error \
clazz->shift = shift_; \ Init_Class_ ## class_( FT_Outline_Funcs* clazz ) \
clazz->delta = delta_; \ { \
return FT_Err_Ok; \ clazz->move_to = move_to_; \
clazz->line_to = line_to_; \
clazz->conic_to = conic_to_; \
clazz->cubic_to = cubic_to_; \
clazz->shift = shift_; \
clazz->delta = delta_; \
\
return FT_Err_Ok; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
@ -987,39 +1040,55 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Raster_Funcs struct. */ /* Used to initialize an instance of FT_Raster_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */ /* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
/* is used). */ /* is used). */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ #define FT_DEFINE_RASTER_FUNCS( \
raster_reset_, raster_set_mode_, \ class_, \
raster_render_, raster_done_) \ glyph_format_, \
const FT_Raster_Funcs class_ = \ raster_new_, \
{ \ raster_reset_, \
glyph_format_, raster_new_, raster_reset_, \ raster_set_mode_, \
raster_set_mode_, raster_render_, raster_done_ \ raster_render_, \
raster_done_ ) \
const FT_Raster_Funcs class_ = \
{ \
glyph_format_, \
raster_new_, \
raster_reset_, \
raster_set_mode_, \
raster_render_, \
raster_done_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ #define FT_DEFINE_RASTER_FUNCS( \
raster_reset_, raster_set_mode_, raster_render_, raster_done_) \ class_, \
void \ glyph_format_, \
FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \ raster_new_, \
{ \ raster_reset_, \
clazz->glyph_format = glyph_format_; \ raster_set_mode_, \
clazz->raster_new = raster_new_; \ raster_render_, \
clazz->raster_reset = raster_reset_; \ raster_done_ ) \
clazz->raster_set_mode = raster_set_mode_; \ void \
clazz->raster_render = raster_render_; \ FT_Init_Class_ ## class_( FT_Raster_Funcs* clazz ) \
clazz->raster_done = raster_done_; \ { \
clazz->glyph_format = glyph_format_; \
clazz->raster_new = raster_new_; \
clazz->raster_reset = raster_reset_; \
clazz->raster_set_mode = raster_set_mode_; \
clazz->raster_render = raster_render_; \
clazz->raster_done = raster_done_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -1033,7 +1102,6 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
@ -1042,40 +1110,64 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Glyph_Class struct. */ /* Used to initialize an instance of FT_Glyph_Class struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */ /* be called with a pre-allocated stcture to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
/* is used). */ /* is used). */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ #define FT_DEFINE_GLYPH( \
transform_, bbox_, prepare_) \ class_, \
FT_CALLBACK_TABLE_DEF \ size_, \
const FT_Glyph_Class class_ = \ format_, \
{ \ init_, \
size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \ done_, \
copy_, \
transform_, \
bbox_, \
prepare_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_Glyph_Class class_ = \
{ \
size_, \
format_, \
init_, \
done_, \
copy_, \
transform_, \
bbox_, \
prepare_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ #define FT_DEFINE_GLYPH( \
transform_, bbox_, prepare_) \ class_, \
void \ size_, \
FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \ format_, \
{ \ init_, \
clazz->glyph_size = size_; \ done_, \
clazz->glyph_format = format_; \ copy_, \
clazz->glyph_init = init_; \ transform_, \
clazz->glyph_done = done_; \ bbox_, \
clazz->glyph_copy = copy_; \ prepare_ ) \
clazz->glyph_transform = transform_; \ void \
clazz->glyph_bbox = bbox_; \ FT_Init_Class_ ## class_( FT_Glyph_Class* clazz ) \
clazz->glyph_prepare = prepare_; \ { \
clazz->glyph_size = size_; \
clazz->glyph_format = format_; \
clazz->glyph_init = init_; \
clazz->glyph_done = done_; \
clazz->glyph_copy = copy_; \
clazz->glyph_transform = transform_; \
clazz->glyph_bbox = bbox_; \
clazz->glyph_prepare = prepare_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
@ -1083,7 +1175,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to create a forward declaration of a */ /* Used to create a forward declaration of a */
/* FT_Renderer_Class stract instance. */ /* FT_Renderer_Class struct instance. */
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DEFINE_RENDERER */ /* FT_DEFINE_RENDERER */
@ -1091,22 +1183,23 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Renderer_Class struct. */ /* Used to initialize an instance of FT_Renderer_Class struct. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
/* to called with a pointer where the allocated stracture is returned.*/ /* to be called with a pointer where the allocated structure is */
/* And when it is no longer needed a Destroy function needs */ /* returned. And when it is no longer needed a `destroy' function */
/* to be called to release that allocation. */ /* needs to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */ /* `fcinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */ /* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */ /* described in `ftmodule.h'. */
/* */ /* */
/* Notice that the created Create and Destroy functions call */ /* Notice that the created `create' and `destroy' functions call */
/* pic_init and pic_free function to allow you to manually allocate */ /* `pic_init' and `pic_free' to allow you to manually allocate and */
/* and initialize any additional global data, like module specific */ /* initialize any additional global data, like a module specific */
/* interface, and put them in the global pic container defined in */ /* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */ /* `ftpic.h'. If you don't need them just implement the functions as */
/* empty to resolve the link error. Also the pic_init and pic_free */ /* empty to resolve the link error. Also the `pic_init' and */
/* functions should be declared in pic.h, to be referred by renderer */ /* `pic_free' functions should be declared in `pic.h', to be referred */
/* definition calling FT_DEFINE_RENDERER() in following. */ /* by the renderer definition calling `FT_DEFINE_RENDERER' in the */
/* following. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
@ -1114,88 +1207,129 @@ FT_BEGIN_HEADER
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_RENDERER(class_) \ #define FT_DECLARE_RENDERER( class_ ) \
FT_EXPORT_VAR( const FT_Renderer_Class ) class_; FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
#define FT_DEFINE_RENDERER(class_, \ #define FT_DEFINE_RENDERER( \
flags_, size_, name_, version_, requires_, \ class_, \
interface_, init_, done_, get_interface_, \ flags_, \
glyph_format_, render_glyph_, transform_glyph_, \ size_, \
get_glyph_cbox_, set_mode_, raster_class_ ) \ name_, \
FT_CALLBACK_TABLE_DEF \ version_, \
const FT_Renderer_Class class_ = \ requires_, \
{ \ interface_, \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \ init_, \
interface_,init_,done_,get_interface_) \ done_, \
glyph_format_, \ get_interface_, \
\ glyph_format_, \
render_glyph_, \ render_glyph_, \
transform_glyph_, \ transform_glyph_, \
get_glyph_cbox_, \ get_glyph_cbox_, \
set_mode_, \ set_mode_, \
\ raster_class_ ) \
raster_class_ \ FT_CALLBACK_TABLE_DEF \
const FT_Renderer_Class class_ = \
{ \
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
glyph_format_, \
\
render_glyph_, \
transform_glyph_, \
get_glyph_cbox_, \
set_mode_, \
\
raster_class_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_) #define FT_DECLARE_RENDERER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_RENDERER(class_, \ #define FT_DEFINE_RENDERER( \
flags_, size_, name_, version_, requires_, \ class_, \
interface_, init_, done_, get_interface_, \ flags_, \
glyph_format_, render_glyph_, transform_glyph_, \ size_, \
get_glyph_cbox_, set_mode_, raster_class_ ) \ name_, \
\ version_, \
void \ requires_, \
FT_Destroy_Class_##class_( FT_Library library, \ interface_, \
FT_Module_Class* clazz ) \ init_, \
{ \ done_, \
FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \ get_interface_, \
FT_Memory memory = library->memory; \ glyph_format_, \
class_##_pic_free( library ); \ render_glyph_, \
if ( rclazz ) \ transform_glyph_, \
FT_FREE( rclazz ); \ get_glyph_cbox_, \
} \ set_mode_, \
\ raster_class_ ) \
FT_Error \ void \
FT_Create_Class_##class_( FT_Library library, \ FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \ FT_Module_Class* clazz ) \
{ \ { \
FT_Renderer_Class* clazz; \ FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
FT_Error error; \ FT_Memory memory = library->memory; \
FT_Memory memory = library->memory; \ \
\ \
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ class_ ## _pic_free( library ); \
return error; \ if ( rclazz ) \
\ FT_FREE( rclazz ); \
error = class_##_pic_init( library ); \ } \
if(error) \ \
{ \ \
FT_FREE( clazz ); \ FT_Error \
return error; \ FT_Create_Class_ ## class_( FT_Library library, \
} \ FT_Module_Class** output_class ) \
\ { \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \ FT_Renderer_Class* clazz; \
interface_,init_,done_,get_interface_) \ FT_Error error; \
\ FT_Memory memory = library->memory; \
clazz->glyph_format = glyph_format_; \ \
\ \
clazz->render_glyph = render_glyph_; \ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
clazz->transform_glyph = transform_glyph_; \ return error; \
clazz->get_glyph_cbox = get_glyph_cbox_; \ \
clazz->set_mode = set_mode_; \ error = class_ ## _pic_init( library ); \
\ if ( error ) \
clazz->raster_class = raster_class_; \ { \
\ FT_FREE( clazz ); \
*output_class = (FT_Module_Class*)clazz; \ return error; \
return FT_Err_Ok; \ } \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
\
clazz->glyph_format = glyph_format_; \
\
clazz->render_glyph = render_glyph_; \
clazz->transform_glyph = transform_glyph_; \
clazz->get_glyph_cbox = get_glyph_cbox_; \
clazz->set_mode = set_mode_; \
\
clazz->raster_class = raster_class_; \
\
*output_class = (FT_Module_Class*)clazz; \
\
return FT_Err_Ok; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -1247,6 +1381,7 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
@ -1254,30 +1389,31 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to create a forward declaration of a */ /* Used to create a forward declaration of a */
/* FT_Module_Class stract instance. */ /* FT_Module_Class struct instance. */
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DEFINE_MODULE */ /* FT_DEFINE_MODULE */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Module_Class struct. */ /* Used to initialize an instance of an FT_Module_Class struct. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
/* to called with a pointer where the allocated stracture is returned.*/ /* be called with a pointer where the allocated structure is */
/* And when it is no longer needed a Destroy function needs */ /* returned. And when it is no longer needed a `destroy' function */
/* to be called to release that allocation. */ /* needs to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */ /* `fcinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */ /* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */ /* described in `ftmodule.h'. */
/* */ /* */
/* Notice that the created Create and Destroy functions call */ /* Notice that the created `create' and `destroy' functions call */
/* pic_init and pic_free function to allow you to manually allocate */ /* `pic_init' and `pic_free' to allow you to manually allocate and */
/* and initialize any additional global data, like module specific */ /* initialize any additional global data, like a module specific */
/* interface, and put them in the global pic container defined in */ /* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */ /* `ftpic.h'. If you don't need them just implement the functions as */
/* empty to resolve the link error. Also the pic_init and pic_free */ /* empty to resolve the link error. Also the `pic_init' and */
/* functions should be declared in pic.h, to be referred by module */ /* `pic_free' functions should be declared in `pic.h', to be referred */
/* definition calling FT_DEFINE_MODULE() in following. */ /* by the module definition calling `FT_DEFINE_MODULE' in the */
/* following. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
@ -1287,119 +1423,159 @@ FT_BEGIN_HEADER
/* FT_DEFINE_ROOT_MODULE */ /* FT_DEFINE_ROOT_MODULE */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Module_Class struct inside */ /* Used to initialize an instance of an FT_Module_Class struct inside */
/* another stract that contains it or in a function that initializes */ /* another struct that contains it or in a function that initializes */
/* that containing stract */ /* that containing struct. */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_MODULE(class_) \ #define FT_DECLARE_MODULE( class_ ) \
FT_CALLBACK_TABLE \ FT_CALLBACK_TABLE \
const FT_Module_Class class_; \ const FT_Module_Class class_;
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \ #define FT_DEFINE_ROOT_MODULE( \
interface_, init_, done_, get_interface_) \ flags_, \
{ \ size_, \
flags_, \ name_, \
size_, \ version_, \
\ requires_, \
name_, \ interface_, \
version_, \ init_, \
requires_, \ done_, \
\ get_interface_ ) \
interface_, \ { \
\ flags_, \
init_, \ size_, \
done_, \ \
get_interface_, \ name_, \
version_, \
requires_, \
\
interface_, \
\
init_, \
done_, \
get_interface_, \
}, },
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \ #define FT_DEFINE_MODULE( \
interface_, init_, done_, get_interface_) \ class_, \
FT_CALLBACK_TABLE_DEF \ flags_, \
const FT_Module_Class class_ = \ size_, \
{ \ name_, \
flags_, \ version_, \
size_, \ requires_, \
\ interface_, \
name_, \ init_, \
version_, \ done_, \
requires_, \ get_interface_ ) \
\ FT_CALLBACK_TABLE_DEF \
interface_, \ const FT_Module_Class class_ = \
\ { \
init_, \ flags_, \
done_, \ size_, \
get_interface_, \ \
name_, \
version_, \
requires_, \
\
interface_, \
\
init_, \
done_, \
get_interface_, \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_MODULE(class_) \ #define FT_DECLARE_MODULE( class_ ) \
FT_Error FT_Create_Class_##class_( FT_Library library, \ FT_Error \
FT_Module_Class** output_class ); \ FT_Create_Class_ ## class_( FT_Library library, \
void FT_Destroy_Class_##class_( FT_Library library, \ FT_Module_Class** output_class ); \
FT_Module_Class* clazz ); void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz );
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \ #define FT_DEFINE_ROOT_MODULE( \
interface_, init_, done_, get_interface_) \ flags_, \
clazz->root.module_flags = flags_; \ size_, \
clazz->root.module_size = size_; \ name_, \
clazz->root.module_name = name_; \ version_, \
clazz->root.module_version = version_; \ requires_, \
clazz->root.module_requires = requires_; \ interface_, \
\ init_, \
clazz->root.module_interface = interface_; \ done_, \
\ get_interface_ ) \
clazz->root.module_init = init_; \ clazz->root.module_flags = flags_; \
clazz->root.module_done = done_; \ clazz->root.module_size = size_; \
clazz->root.get_interface = get_interface_; clazz->root.module_name = name_; \
clazz->root.module_version = version_; \
clazz->root.module_requires = requires_; \
\
clazz->root.module_interface = interface_; \
\
clazz->root.module_init = init_; \
clazz->root.module_done = done_; \
clazz->root.get_interface = get_interface_;
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \ #define FT_DEFINE_MODULE( \
interface_, init_, done_, get_interface_) \ class_, \
\ flags_, \
void \ size_, \
FT_Destroy_Class_##class_( FT_Library library, \ name_, \
FT_Module_Class* clazz ) \ version_, \
{ \ requires_, \
FT_Memory memory = library->memory; \ interface_, \
class_##_pic_free( library ); \ init_, \
if ( clazz ) \ done_, \
FT_FREE( clazz ); \ get_interface_ ) \
} \ void \
\ FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Error \ FT_Module_Class* clazz ) \
FT_Create_Class_##class_( FT_Library library, \ { \
FT_Module_Class** output_class ) \ FT_Memory memory = library->memory; \
{ \ \
FT_Memory memory = library->memory; \ \
FT_Module_Class* clazz; \ class_ ## _pic_free( library ); \
FT_Error error; \ if ( clazz ) \
\ FT_FREE( clazz ); \
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ } \
return error; \ \
error = class_##_pic_init( library ); \ \
if(error) \ FT_Error \
{ \ FT_Create_Class_ ## class_( FT_Library library, \
FT_FREE( clazz ); \ FT_Module_Class** output_class ) \
return error; \ { \
} \ FT_Memory memory = library->memory; \
\ FT_Module_Class* clazz; \
clazz->module_flags = flags_; \ FT_Error error; \
clazz->module_size = size_; \ \
clazz->module_name = name_; \ \
clazz->module_version = version_; \ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
clazz->module_requires = requires_; \ return error; \
\ error = class_ ## _pic_init( library ); \
clazz->module_interface = interface_; \ if ( error ) \
\ { \
clazz->module_init = init_; \ FT_FREE( clazz ); \
clazz->module_done = done_; \ return error; \
clazz->get_interface = get_interface_; \ } \
\ \
*output_class = clazz; \ clazz->module_flags = flags_; \
return FT_Err_Ok; \ clazz->module_size = size_; \
clazz->module_name = name_; \
clazz->module_version = version_; \
clazz->module_requires = requires_; \
\
clazz->module_interface = interface_; \
\
clazz->module_init = init_; \
clazz->module_done = done_; \
clazz->get_interface = get_interface_; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services (declaration). */ /* The FreeType position independent code services (declaration). */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2012 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -31,29 +31,33 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC #ifdef FT_CONFIG_OPTION_PIC
typedef struct FT_PIC_Container_ typedef struct FT_PIC_Container_
{ {
/* pic containers for base */ /* pic containers for base */
void* base; void* base;
/* pic containers for modules */ /* pic containers for modules */
void* autofit; void* autofit;
void* cff; void* cff;
void* pshinter; void* pshinter;
void* psnames; void* psnames;
void* raster; void* raster;
void* sfnt; void* sfnt;
void* smooth; void* smooth;
void* truetype; void* truetype;
} FT_PIC_Container; } FT_PIC_Container;
/* Initialize the various function tables, structs, etc. stored in the container. */
/* Initialize the various function tables, structs, etc. */
/* stored in the container. */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
ft_pic_container_init( FT_Library library ); ft_pic_container_init( FT_Library library );
/* Destroy the contents of the container. */ /* Destroy the contents of the container. */
FT_BASE( void ) FT_BASE( void )
ft_pic_container_destroy( FT_Library library ); ft_pic_container_destroy( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Embedded resource forks accessor (specification). */ /* Embedded resource forks accessor (specification). */
/* */ /* */
/* Copyright 2004, 2006, 2007 by */ /* Copyright 2004, 2006, 2007, 2012 by */
/* Masatake YAMATO and Redhat K.K. */ /* Masatake YAMATO and Redhat K.K. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -80,26 +80,37 @@ FT_BEGIN_HEADER
} ft_raccess_guess_rec; } ft_raccess_guess_rec;
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
/* this array is a storage in non-PIC mode, so ; is needed in END */ /* this array is a storage in non-PIC mode, so ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
const type name[] = { const type name[] = {
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
{ raccess_guess_##func_suffix, FT_RFork_Rule_##type_suffix }, { raccess_guess_ ## func_suffix, \
#define CONST_FT_RFORK_RULE_ARRAY_END }; FT_RFork_Rule_ ## type_suffix },
#define CONST_FT_RFORK_RULE_ARRAY_END };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
/* this array is a function in PIC mode, so no ; is needed in END */ /* this array is a function in PIC mode, so no ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
void FT_Init_##name ( type* storage ) { \ void \
type *local = storage; \ FT_Init_ ## name( type* storage ) \
int i = 0; { \
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ type* local = storage; \
local[i].func = raccess_guess_##func_suffix; \ \
local[i].type = FT_RFork_Rule_##type_suffix; \ \
i++; int i = 0;
#define CONST_FT_RFORK_RULE_ARRAY_END } #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
local[i].func = raccess_guess_ ## func_suffix; \
local[i].type = FT_RFork_Rule_ ## type_suffix; \
i++;
#define CONST_FT_RFORK_RULE_ARRAY_END }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */

View File

@ -167,7 +167,12 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6 */ /* FT_DEFINE_SERVICEDESCREC1 */
/* FT_DEFINE_SERVICEDESCREC2 */
/* FT_DEFINE_SERVICEDESCREC3 */
/* FT_DEFINE_SERVICEDESCREC4 */
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */ /* Used to initialize an array of FT_ServiceDescRec structures. */

View File

@ -6,7 +6,7 @@
/* recorders (specification only). These are used to support native */ /* recorders (specification only). These are used to support native */
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */ /* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
/* */ /* */
/* Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by */ /* Copyright 2001-2003, 2005-2007, 2009, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -679,27 +679,37 @@ FT_BEGIN_HEADER
typedef PSHinter_Interface* PSHinter_Service; typedef PSHinter_Interface* PSHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \ #define FT_DEFINE_PSHINTER_INTERFACE( \
get_t1_funcs_, get_t2_funcs_) \ class_, \
static const PSHinter_Interface class_ = \ get_globals_funcs_, \
{ \ get_t1_funcs_, \
get_globals_funcs_, get_t1_funcs_, get_t2_funcs_ \ get_t2_funcs_ ) \
static const PSHinter_Interface class_ = \
{ \
get_globals_funcs_, \
get_t1_funcs_, \
get_t2_funcs_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \ #define FT_DEFINE_PSHINTER_INTERFACE( \
get_t1_funcs_, get_t2_funcs_) \ class_, \
void \ get_globals_funcs_, \
FT_Init_Class_##class_( FT_Library library, \ get_t1_funcs_, \
PSHinter_Interface* clazz) \ get_t2_funcs_ ) \
{ \ void \
FT_UNUSED(library); \ FT_Init_Class_ ## class_( FT_Library library, \
clazz->get_globals_funcs = get_globals_funcs_; \ PSHinter_Interface* clazz ) \
clazz->get_t1_funcs = get_t1_funcs_; \ { \
clazz->get_t2_funcs = get_t2_funcs_; \ FT_UNUSED( library ); \
\
clazz->get_globals_funcs = get_globals_funcs_; \
clazz->get_t1_funcs = get_t1_funcs_; \
clazz->get_t2_funcs = get_t2_funcs_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* High-level `sfnt' driver interface (specification). */ /* High-level `sfnt' driver interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* Copyright 1996-2006, 2009, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -756,135 +756,212 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) \ #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) \
a, a,
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) /* empty */
#endif #endif
#define FT_INTERNAL(a) \
a,
#define FT_DEFINE_SFNT_INTERFACE(class_, \ #define FT_INTERNAL( a ) \
goto_table_, init_face_, load_face_, done_face_, get_interface_, \ a,
load_any_, load_sfnt_header_, load_directory_, load_head_, \
load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \ #define FT_DEFINE_SFNT_INTERFACE( \
load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \ class_, \
load_kern_, load_gasp_, load_pclt_, load_bhed_, \ goto_table_, \
set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \ init_face_, \
load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \ load_face_, \
get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \ done_face_, \
get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \ get_interface_, \
set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \ load_any_, \
static const SFNT_Interface class_ = \ load_sfnt_header_, \
{ \ load_directory_, \
FT_INTERNAL(goto_table_) \ load_head_, \
FT_INTERNAL(init_face_) \ load_hhea_, \
FT_INTERNAL(load_face_) \ load_cmap_, \
FT_INTERNAL(done_face_) \ load_maxp_, \
FT_INTERNAL(get_interface_) \ load_os2_, \
FT_INTERNAL(load_any_) \ load_post_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header_) \ load_name_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory_) \ free_name_, \
FT_INTERNAL(load_head_) \ load_hdmx_stub_, \
FT_INTERNAL(load_hhea_) \ free_hdmx_stub_, \
FT_INTERNAL(load_cmap_) \ load_kern_, \
FT_INTERNAL(load_maxp_) \ load_gasp_, \
FT_INTERNAL(load_os2_) \ load_pclt_, \
FT_INTERNAL(load_post_) \ load_bhed_, \
FT_INTERNAL(load_name_) \ set_sbit_strike_stub_, \
FT_INTERNAL(free_name_) \ load_sbits_stub_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub_) \ find_sbit_image_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub_) \ load_sbit_metrics_, \
FT_INTERNAL(load_kern_) \ load_sbit_image_, \
FT_INTERNAL(load_gasp_) \ free_sbits_stub_, \
FT_INTERNAL(load_pclt_) \ get_psname_, \
FT_INTERNAL(load_bhed_) \ free_psnames_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub_) \ load_charmap_stub_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub_) \ free_charmap_stub_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image_) \ get_kerning_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics_) \ load_font_dir_, \
FT_INTERNAL(load_sbit_image_) \ load_hmtx_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub_) \ load_eblc_, \
FT_INTERNAL(get_psname_) \ free_eblc_, \
FT_INTERNAL(free_psnames_) \ set_sbit_strike_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub_) \ load_strike_metrics_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub_) \ get_metrics_ ) \
FT_INTERNAL(get_kerning_) \ static const SFNT_Interface class_ = \
FT_INTERNAL(load_font_dir_) \ { \
FT_INTERNAL(load_hmtx_) \ FT_INTERNAL( goto_table_ ) \
FT_INTERNAL(load_eblc_) \ FT_INTERNAL( init_face_ ) \
FT_INTERNAL(free_eblc_) \ FT_INTERNAL( load_face_ ) \
FT_INTERNAL(set_sbit_strike_) \ FT_INTERNAL( done_face_ ) \
FT_INTERNAL(load_strike_metrics_) \ FT_INTERNAL( get_interface_ ) \
FT_INTERNAL(get_metrics_) \ FT_INTERNAL( load_any_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory_ ) \
FT_INTERNAL( load_head_ ) \
FT_INTERNAL( load_hhea_ ) \
FT_INTERNAL( load_cmap_ ) \
FT_INTERNAL( load_maxp_ ) \
FT_INTERNAL( load_os2_ ) \
FT_INTERNAL( load_post_ ) \
FT_INTERNAL( load_name_ ) \
FT_INTERNAL( free_name_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub_ ) \
FT_INTERNAL( load_kern_ ) \
FT_INTERNAL( load_gasp_ ) \
FT_INTERNAL( load_pclt_ ) \
FT_INTERNAL( load_bhed_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics_ ) \
FT_INTERNAL( load_sbit_image_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub_ ) \
FT_INTERNAL( get_psname_ ) \
FT_INTERNAL( free_psnames_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub_ ) \
FT_INTERNAL( get_kerning_ ) \
FT_INTERNAL( load_font_dir_ ) \
FT_INTERNAL( load_hmtx_ ) \
FT_INTERNAL( load_eblc_ ) \
FT_INTERNAL( free_eblc_ ) \
FT_INTERNAL( set_sbit_strike_ ) \
FT_INTERNAL( load_strike_metrics_ ) \
FT_INTERNAL( get_metrics_ ) \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) \ #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) \
clazz->a = a_; clazz->a = a_;
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) /* empty */
#endif #endif
#define FT_INTERNAL(a, a_) \
clazz->a = a_;
#define FT_DEFINE_SFNT_INTERFACE(class_, \ #define FT_INTERNAL( a, a_ ) \
goto_table_, init_face_, load_face_, done_face_, get_interface_, \ clazz->a = a_;
load_any_, load_sfnt_header_, load_directory_, load_head_, \
load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \ #define FT_DEFINE_SFNT_INTERFACE( \
load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \ class_, \
load_kern_, load_gasp_, load_pclt_, load_bhed_, \ goto_table_, \
set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \ init_face_, \
load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \ load_face_, \
get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \ done_face_, \
get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \ get_interface_, \
set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \ load_any_, \
void \ load_sfnt_header_, \
FT_Init_Class_##class_( FT_Library library, SFNT_Interface* clazz ) \ load_directory_, \
{ \ load_head_, \
FT_UNUSED(library); \ load_hhea_, \
FT_INTERNAL(goto_table,goto_table_) \ load_cmap_, \
FT_INTERNAL(init_face,init_face_) \ load_maxp_, \
FT_INTERNAL(load_face,load_face_) \ load_os2_, \
FT_INTERNAL(done_face,done_face_) \ load_post_, \
FT_INTERNAL(get_interface,get_interface_) \ load_name_, \
FT_INTERNAL(load_any,load_any_) \ free_name_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header,load_sfnt_header_) \ load_hdmx_stub_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory,load_directory_) \ free_hdmx_stub_, \
FT_INTERNAL(load_head,load_head_) \ load_kern_, \
FT_INTERNAL(load_hhea,load_hhea_) \ load_gasp_, \
FT_INTERNAL(load_cmap,load_cmap_) \ load_pclt_, \
FT_INTERNAL(load_maxp,load_maxp_) \ load_bhed_, \
FT_INTERNAL(load_os2,load_os2_) \ set_sbit_strike_stub_, \
FT_INTERNAL(load_post,load_post_) \ load_sbits_stub_, \
FT_INTERNAL(load_name,load_name_) \ find_sbit_image_, \
FT_INTERNAL(free_name,free_name_) \ load_sbit_metrics_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub,load_hdmx_stub_) \ load_sbit_image_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub,free_hdmx_stub_) \ free_sbits_stub_, \
FT_INTERNAL(load_kern,load_kern_) \ get_psname_, \
FT_INTERNAL(load_gasp,load_gasp_) \ free_psnames_, \
FT_INTERNAL(load_pclt,load_pclt_) \ load_charmap_stub_, \
FT_INTERNAL(load_bhed,load_bhed_) \ free_charmap_stub_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub,set_sbit_strike_stub_) \ get_kerning_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub,load_sbits_stub_) \ load_font_dir_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image,find_sbit_image_) \ load_hmtx_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics,load_sbit_metrics_) \ load_eblc_, \
FT_INTERNAL(load_sbit_image,load_sbit_image_) \ free_eblc_, \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub,free_sbits_stub_) \ set_sbit_strike_, \
FT_INTERNAL(get_psname,get_psname_) \ load_strike_metrics_, \
FT_INTERNAL(free_psnames,free_psnames_) \ get_metrics_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub,load_charmap_stub_) \ void \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub,free_charmap_stub_) \ FT_Init_Class_ ## class_( FT_Library library, \
FT_INTERNAL(get_kerning,get_kerning_) \ SFNT_Interface* clazz ) \
FT_INTERNAL(load_font_dir,load_font_dir_) \ { \
FT_INTERNAL(load_hmtx,load_hmtx_) \ FT_UNUSED( library ); \
FT_INTERNAL(load_eblc,load_eblc_) \ \
FT_INTERNAL(free_eblc,free_eblc_) \ FT_INTERNAL( goto_table, goto_table_ ) \
FT_INTERNAL(set_sbit_strike,set_sbit_strike_) \ FT_INTERNAL( init_face, init_face_ ) \
FT_INTERNAL(load_strike_metrics,load_strike_metrics_) \ FT_INTERNAL( load_face, load_face_ ) \
FT_INTERNAL(get_metrics,get_metrics_) \ FT_INTERNAL( done_face, done_face_ ) \
FT_INTERNAL( get_interface, get_interface_ ) \
FT_INTERNAL( load_any, load_any_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header, \
load_sfnt_header_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory, \
load_directory_ ) \
FT_INTERNAL( load_head, load_head_ ) \
FT_INTERNAL( load_hhea, load_hhea_ ) \
FT_INTERNAL( load_cmap, load_cmap_ ) \
FT_INTERNAL( load_maxp, load_maxp_ ) \
FT_INTERNAL( load_os2, load_os2_ ) \
FT_INTERNAL( load_post, load_post_ ) \
FT_INTERNAL( load_name, load_name_ ) \
FT_INTERNAL( free_name, free_name_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub, \
load_hdmx_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub, \
free_hdmx_stub_ ) \
FT_INTERNAL( load_kern, load_kern_ ) \
FT_INTERNAL( load_gasp, load_gasp_ ) \
FT_INTERNAL( load_pclt, load_pclt_ ) \
FT_INTERNAL( load_bhed, load_bhed_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub, \
set_sbit_strike_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub, \
load_sbits_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image, \
find_sbit_image_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics, \
load_sbit_metrics_ ) \
FT_INTERNAL( load_sbit_image, load_sbit_image_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub, \
free_sbits_stub_ ) \
FT_INTERNAL( get_psname, get_psname_ ) \
FT_INTERNAL( free_psnames, free_psnames_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub, \
load_charmap_stub_ ) \
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub, \
free_charmap_stub_ ) \
FT_INTERNAL( get_kerning, get_kerning_ ) \
FT_INTERNAL( load_font_dir, load_font_dir_ ) \
FT_INTERNAL( load_hmtx, load_hmtx_ ) \
FT_INTERNAL( load_eblc, load_eblc_ ) \
FT_INTERNAL( free_eblc, free_eblc_ ) \
FT_INTERNAL( set_sbit_strike, set_sbit_strike_ ) \
FT_INTERNAL( load_strike_metrics, load_strike_metrics_ ) \
FT_INTERNAL( get_metrics, get_metrics_ ) \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */

View File

@ -353,13 +353,13 @@
/*************************************************************************/ /*************************************************************************/
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICE_MULTIMASTERSREC(tt_service_gx_multi_masters, FT_DEFINE_SERVICE_MULTIMASTERSREC(
tt_service_gx_multi_masters,
(FT_Get_MM_Func) NULL, (FT_Get_MM_Func) NULL,
(FT_Set_MM_Design_Func) NULL, (FT_Set_MM_Design_Func) NULL,
(FT_Set_MM_Blend_Func) TT_Set_MM_Blend, (FT_Set_MM_Blend_Func) TT_Set_MM_Blend,
(FT_Get_MM_Var_Func) TT_Get_MM_Var, (FT_Get_MM_Var_Func) TT_Get_MM_Var,
(FT_Set_Var_Design_Func)TT_Set_Var_Design (FT_Set_Var_Design_Func)TT_Set_Var_Design )
)
#endif #endif
static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine = static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine =
@ -379,25 +379,26 @@
#endif /* TT_USE_BYTECODE_INTERPRETER */ #endif /* TT_USE_BYTECODE_INTERPRETER */
}; };
FT_DEFINE_SERVICE_TTGLYFREC(tt_service_truetype_glyf, FT_DEFINE_SERVICE_TTGLYFREC(
(TT_Glyf_GetLocationFunc)tt_face_get_location tt_service_truetype_glyf,
) (TT_Glyf_GetLocationFunc)tt_face_get_location )
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICEDESCREC4(tt_services, FT_DEFINE_SERVICEDESCREC4(
tt_services,
FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
FT_SERVICE_ID_MULTI_MASTERS, &FT_TT_SERVICE_GX_MULTI_MASTERS_GET, FT_SERVICE_ID_MULTI_MASTERS, &FT_TT_SERVICE_GX_MULTI_MASTERS_GET,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine, FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &FT_TT_SERVICE_TRUETYPE_GLYF_GET FT_SERVICE_ID_TT_GLYF, &FT_TT_SERVICE_TRUETYPE_GLYF_GET )
)
#else #else
FT_DEFINE_SERVICEDESCREC3(tt_services, FT_DEFINE_SERVICEDESCREC3(
tt_services,
FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine, FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &FT_TT_SERVICE_TRUETYPE_GLYF_GET FT_SERVICE_ID_TT_GLYF, &FT_TT_SERVICE_TRUETYPE_GLYF_GET )
)
#endif #endif
FT_CALLBACK_DEF( FT_Module_Interface ) FT_CALLBACK_DEF( FT_Module_Interface )
tt_get_interface( FT_Module driver, /* TT_Driver */ tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface ) const char* tt_interface )
@ -445,15 +446,15 @@
/* The FT_DriverInterface structure is defined in ftdriver.h. */ /* The FT_DriverInterface structure is defined in ftdriver.h. */
#ifdef TT_USE_BYTECODE_INTERPRETER #ifdef TT_USE_BYTECODE_INTERPRETER
#define TT_HINTER_FLAG FT_MODULE_DRIVER_HAS_HINTER #define TT_HINTER_FLAG FT_MODULE_DRIVER_HAS_HINTER
#else #else
#define TT_HINTER_FLAG 0 #define TT_HINTER_FLAG 0
#endif #endif
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
#define TT_SIZE_SELECT tt_size_select #define TT_SIZE_SELECT tt_size_select
#else #else
#define TT_SIZE_SELECT 0 #define TT_SIZE_SELECT 0
#endif #endif
FT_DEFINE_DRIVER( tt_driver_class, FT_DEFINE_DRIVER( tt_driver_class,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for truetype module. */ /* The FreeType position independent code services for truetype module. */
/* */ /* */
/* Copyright 2009, 2010 by */ /* Copyright 2009, 2010, 2012 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -41,11 +41,12 @@
FT_Init_Class_tt_service_truetype_glyf( FT_Init_Class_tt_service_truetype_glyf(
FT_Service_TTGlyfRec* sv_ttglyf ); FT_Service_TTGlyfRec* sv_ttglyf );
void void
tt_driver_class_pic_free( FT_Library library ) tt_driver_class_pic_free( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
if ( pic_container->truetype ) if ( pic_container->truetype )
@ -77,7 +78,8 @@
FT_MEM_SET( container, 0, sizeof ( *container ) ); FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->truetype = container; pic_container->truetype = container;
/* initialize pointer table - this is how the module usually expects this data */ /* initialize pointer table - this is how the module usually */
/* expects this data */
error = FT_Create_Class_tt_services( library, error = FT_Create_Class_tt_services( library,
&container->tt_services ); &container->tt_services );
if ( error ) if ( error )
@ -88,6 +90,7 @@
#endif #endif
FT_Init_Class_tt_service_truetype_glyf( FT_Init_Class_tt_service_truetype_glyf(
&container->tt_service_truetype_glyf ); &container->tt_service_truetype_glyf );
Exit: Exit:
if ( error ) if ( error )
tt_driver_class_pic_free( library ); tt_driver_class_pic_free( library );

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for truetype module. */ /* The FreeType position independent code services for truetype module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2012 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -23,9 +23,10 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_TT_SERVICES_GET tt_services
#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters #define FT_TT_SERVICES_GET tt_services
#define FT_TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf #define FT_TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
#define FT_TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
@ -33,19 +34,27 @@ FT_BEGIN_HEADER
#include FT_SERVICE_MULTIPLE_MASTERS_H #include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_TRUETYPE_GLYF_H #include FT_SERVICE_TRUETYPE_GLYF_H
typedef struct TTModulePIC_
typedef struct TTModulePIC_
{ {
FT_ServiceDescRec* tt_services; FT_ServiceDescRec* tt_services;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Service_MultiMastersRec tt_service_gx_multi_masters; FT_Service_MultiMastersRec tt_service_gx_multi_masters;
#endif #endif
FT_Service_TTGlyfRec tt_service_truetype_glyf; FT_Service_TTGlyfRec tt_service_truetype_glyf;
} TTModulePIC; } TTModulePIC;
#define GET_PIC(lib) ((TTModulePIC*)((lib)->pic_container.truetype))
#define FT_TT_SERVICES_GET (GET_PIC(library)->tt_services) #define GET_PIC( lib ) \
#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET (GET_PIC(library)->tt_service_gx_multi_masters) ( (TTModulePIC*)((lib)->pic_container.truetype) )
#define FT_TT_SERVICE_TRUETYPE_GLYF_GET (GET_PIC(library)->tt_service_truetype_glyf) #define FT_TT_SERVICES_GET \
( GET_PIC( library )->tt_services )
#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET \
( GET_PIC( library )->tt_service_gx_multi_masters )
#define FT_TT_SERVICE_TRUETYPE_GLYF_GET \
( GET_PIC( library )->tt_service_truetype_glyf )
/* see ttpic.c for the implementation */ /* see ttpic.c for the implementation */
void void