Remove FT_CONFIG_OPTION_PIC and related code.

*/* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this
preprocessor symbol.

*/*: Replace `XXX_GET' macros (which could be either a function in
PIC mode or an array in non-PIC mode) with `xxx' arrays.

* include/freetype/internal/ftpic.h, src/autofit/afpic.c,
src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h,
src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h,
src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c,
src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h,
src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c,
src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h:
Removed.
This commit is contained in:
Werner Lemberg 2018-05-02 20:27:48 +02:00
parent 86bc8a9505
commit 9514959241
106 changed files with 157 additions and 4321 deletions

View File

@ -1,3 +1,22 @@
2018-05-02 Werner Lemberg <wl@gnu.org>
Remove FT_CONFIG_OPTION_PIC and related code.
*/* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this
preprocessor symbol.
*/*: Replace `XXX_GET' macros (which could be either a function in
PIC mode or an array in non-PIC mode) with `xxx' arrays.
* include/freetype/internal/ftpic.h, src/autofit/afpic.c,
src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h,
src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h,
src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c,
src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h,
src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c,
src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h:
Removed.
2018-05-01 Werner Lemberg <wl@gnu.org>
* Version 2.9.1 released.

View File

@ -467,35 +467,6 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/* */
/* Position Independent Code */
/* */
/* If this macro is set (which is _not_ the default), FreeType2 will */
/* avoid creating constants that require address fixups. Instead the */
/* constants will be moved into a struct and additional intialization */
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. [Note that standard compilers like gcc or */
/* clang handle PIC generation automatically; you don't have to set */
/* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
/* compilers.] */
/* */
/* Note that FT_CONFIG_OPTION_PIC support is not available for all */
/* modules (see `modules.cfg' for a complete list). For building with */
/* FT_CONFIG_OPTION_PIC support, do the following. */
/* */
/* 0. Clone the repository. */
/* 1. Define FT_CONFIG_OPTION_PIC. */
/* 2. Remove all subdirectories in `src' that don't have */
/* FT_CONFIG_OPTION_PIC support. */
/* 3. Comment out the corresponding modules in `modules.cfg'. */
/* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
/*************************************************************************/
/*************************************************************************/
/**** ****/

View File

@ -486,35 +486,6 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/* */
/* Position Independent Code */
/* */
/* If this macro is set (which is _not_ the default), FreeType2 will */
/* avoid creating constants that require address fixups. Instead the */
/* constants will be moved into a struct and additional intialization */
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. [Note that standard compilers like gcc or */
/* clang handle PIC generation automatically; you don't have to set */
/* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
/* compilers.] */
/* */
/* Note that FT_CONFIG_OPTION_PIC support is not available for all */
/* modules (see `modules.cfg' for a complete list). For building with */
/* FT_CONFIG_OPTION_PIC support, do the following. */
/* */
/* 0. Clone the repository. */
/* 1. Define FT_CONFIG_OPTION_PIC. */
/* 2. Remove all subdirectories in `src' that don't have */
/* FT_CONFIG_OPTION_PIC support. */
/* 3. Comment out the corresponding modules in `modules.cfg'. */
/* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
/*************************************************************************/
/*************************************************************************/
/**** ****/

View File

@ -197,8 +197,6 @@ FT_BEGIN_HEADER
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
@ -214,27 +212,6 @@ FT_BEGIN_HEADER
load_glyph_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
get_global_hints_, \
done_global_hints_, \
load_glyph_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_AutoHinter_InterfaceRec* clazz ) \
{ \
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 */
FT_END_HEADER

View File

@ -199,30 +199,13 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
/* called with a pointer where the allocated structure is returned. */
/* And when it is no longer needed a `destroy' function needs to be */
/* called to release that allocation. */
/* */
/* `ftinit.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 */
/* `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 */
/* `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' functions should be declared in `pic.h', to be referred */
/* by driver definition calling `FT_DEFINE_DRIVER' in following. */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
@ -289,108 +272,6 @@ FT_BEGIN_HEADER
select_size_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
class_, \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
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_, \
load_glyph_, \
get_kerning_, \
attach_file_, \
get_advances_, \
request_size_, \
select_size_ ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
\
\
class_ ## _pic_free( library ); \
if ( dclazz ) \
FT_FREE( dclazz ); \
} \
\
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Driver_Class clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
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_; \
\
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; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -35,7 +35,6 @@
#include FT_INTERNAL_DRIVER_H
#include FT_INTERNAL_AUTOHINT_H
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_PIC_H
#include FT_INTERNAL_CALC_H
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@ -228,8 +227,6 @@ FT_BEGIN_HEADER
} FT_CMap_ClassRec;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_CMAP_CLASS( class_ ) \
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
@ -260,45 +257,6 @@ FT_BEGIN_HEADER
variantchar_list_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_CMAP_CLASS( class_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_CMap_ClassRec* clazz );
#define FT_DEFINE_CMAP_CLASS( \
class_, \
size_, \
init_, \
done_, \
char_index_, \
char_next_, \
char_var_index_, \
char_var_default_, \
variant_list_, \
charvariant_list_, \
variantchar_list_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_CMap_ClassRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
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 */
/* create a new charmap and add it to charmap->face */
FT_BASE( FT_Error )
@ -935,10 +893,6 @@ FT_BEGIN_HEADER
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
#ifdef FT_CONFIG_OPTION_PIC
FT_PIC_Container pic_container;
#endif
FT_Int refcount;
} FT_LibraryRec;
@ -1013,22 +967,6 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** P I C S U P P O R T ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* PIC support macros for ftimage.h */
/*************************************************************************/
/* */
/* <Macro> */
@ -1036,14 +974,9 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Outline_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_OUTLINE_FUNCS( \
class_, \
move_to_, \
@ -1062,31 +995,6 @@ FT_BEGIN_HEADER
delta_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_OUTLINE_FUNCS( \
class_, \
move_to_, \
line_to_, \
conic_to_, \
cubic_to_, \
shift_, \
delta_ ) \
static FT_Error \
Init_Class_ ## class_( FT_Outline_Funcs* clazz ) \
{ \
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 */
/*************************************************************************/
/* */
@ -1095,14 +1003,9 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Raster_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_RASTER_FUNCS( \
class_, \
glyph_format_, \
@ -1121,31 +1024,6 @@ FT_BEGIN_HEADER
raster_done_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_RASTER_FUNCS( \
class_, \
glyph_format_, \
raster_new_, \
raster_reset_, \
raster_set_mode_, \
raster_render_, \
raster_done_ ) \
void \
FT_Init_Class_ ## class_( FT_Raster_Funcs* clazz ) \
{ \
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 */
/* PIC support macros for ftrender.h */
/*************************************************************************/
@ -1154,15 +1032,9 @@ FT_BEGIN_HEADER
/* FT_DEFINE_GLYPH */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Glyph_Class struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_GLYPH( \
class_, \
size_, \
@ -1186,33 +1058,6 @@ FT_BEGIN_HEADER
prepare_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_GLYPH( \
class_, \
size_, \
format_, \
init_, \
done_, \
copy_, \
transform_, \
bbox_, \
prepare_ ) \
void \
FT_Init_Class_ ## class_( FT_Glyph_Class* clazz ) \
{ \
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 */
/*************************************************************************/
/* */
@ -1229,30 +1074,9 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of FT_Renderer_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function will */
/* need to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `ftinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
/* 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 */
/* `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' functions should be declared in `pic.h', to be referred */
/* by the renderer definition calling `FT_DEFINE_RENDERER' in the */
/* following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_RENDERER( class_ ) \
FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
@ -1295,128 +1119,6 @@ FT_BEGIN_HEADER
raster_class_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_RENDERER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_RENDERER( \
class_, \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_, \
glyph_format_, \
render_glyph_, \
transform_glyph_, \
get_glyph_cbox_, \
set_mode_, \
raster_class_ ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
FT_Memory memory = library->memory; \
\
\
class_ ## _pic_free( library ); \
if ( rclazz ) \
FT_FREE( rclazz ); \
} \
\
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Renderer_Class* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
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 */
/* PIC support macros for ftmodapi.h **/
#ifdef FT_CONFIG_OPTION_PIC
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Creator */
/* */
/* <Description> */
/* A function used to create (allocate) a new module class object. */
/* The object's members are initialized, but the module itself is */
/* not. */
/* */
/* <Input> */
/* memory :: A handle to the memory manager. */
/* output_class :: Initialized with the newly allocated class. */
/* */
typedef FT_Error
(*FT_Module_Creator)( FT_Memory memory,
FT_Module_Class** output_class );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Destroyer */
/* */
/* <Description> */
/* A function used to destroy (deallocate) a module class object. */
/* */
/* <Input> */
/* memory :: A handle to the memory manager. */
/* clazz :: Module class to destroy. */
/* */
typedef void
(*FT_Module_Destroyer)( FT_Memory memory,
FT_Module_Class* clazz );
#endif
/*************************************************************************/
/* */
@ -1433,27 +1135,8 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of an FT_Module_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs */
/* to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `ftinit.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 */
/* `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 */
/* `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' functions should be declared in `pic.h', to be referred */
/* by the module definition calling `FT_DEFINE_MODULE' in the */
/* following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* The struct will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
/* <Macro> */
/* FT_DEFINE_ROOT_MODULE */
@ -1463,8 +1146,6 @@ FT_BEGIN_HEADER
/* another struct that contains it or in a function that initializes */
/* that containing struct. */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_MODULE( class_ ) \
FT_CALLBACK_TABLE \
const FT_Module_Class class_;
@ -1523,100 +1204,6 @@ FT_BEGIN_HEADER
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_MODULE( class_ ) \
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ); \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz );
#define FT_DEFINE_ROOT_MODULE( \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
clazz->root.module_flags = flags_; \
clazz->root.module_size = size_; \
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_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
class_ ## _pic_free( library ); \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Memory memory = library->memory; \
FT_Module_Class* clazz = NULL; \
FT_Error error; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
clazz->module_flags = flags_; \
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 */
FT_END_HEADER
#endif /* FTOBJS_H_ */

View File

@ -1,71 +0,0 @@
/***************************************************************************/
/* */
/* ftpic.h */
/* */
/* The FreeType position independent code services (declaration). */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* Modules that ordinarily have const global data that need address */
/* can instead define pointers here. */
/* */
/*************************************************************************/
#ifndef FTPIC_H_
#define FTPIC_H_
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
typedef struct FT_PIC_Container_
{
/* pic containers for base */
void* base;
/* pic containers for modules */
void* autofit;
void* cff;
void* pshinter;
void* psnames;
void* raster;
void* sfnt;
void* smooth;
void* truetype;
} FT_PIC_Container;
/* Initialize the various function tables, structs, etc. */
/* stored in the container. */
FT_BASE( FT_Error )
ft_pic_container_init( FT_Library library );
/* Destroy the contents of the container. */
FT_BASE( void )
ft_pic_container_destroy( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* FTPIC_H_ */
/* END */

View File

@ -80,35 +80,15 @@ FT_BEGIN_HEADER
FT_RFork_Rule type;
} ft_raccess_guess_rec;
#ifndef FT_CONFIG_OPTION_PIC
/* this array is a storage in non-PIC mode, so ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
static const type name[] = {
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
{ raccess_guess_ ## func_suffix, \
FT_RFork_Rule_ ## type_suffix },
/* this array is a storage, thus a final `;' is needed */
#define CONST_FT_RFORK_RULE_ARRAY_END };
#else /* FT_CONFIG_OPTION_PIC */
/* this array is a function in PIC mode, so no ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
void \
FT_Init_Table_ ## name( type* storage ) \
{ \
type* local = storage; \
\
\
int i = 0;
#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_GUESSING_EMBEDDED_RFORK */

View File

@ -168,24 +168,15 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
/* FT_DEFINE_SERVICEDESCREC8 */
/* FT_DEFINE_SERVICEDESCREC9 */
/* FT_DEFINE_SERVICEDESCREC10 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
/* be called with a pointer to return an allocated array. As soon as */
/* it is no longer needed, a `destroy' function needs to be called to */
/* release that allocation. */
/* The array will be allocated in the global scope (or the scope */
/* where the macro is used). */
/* */
/* These functions should be manually called from the `pic_init' and */
/* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the array will be */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
static const FT_ServiceDescRec class_[] = \
@ -356,495 +347,6 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = NULL; \
clazz[1].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC2( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = NULL; \
clazz[2].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC3( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = NULL; \
clazz[3].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC4( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = NULL; \
clazz[4].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC5( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = NULL; \
clazz[5].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC6( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = NULL; \
clazz[6].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC7( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = NULL; \
clazz[7].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC8( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = NULL; \
clazz[8].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC9( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = serv_id_9; \
clazz[8].serv_data = serv_data_9; \
clazz[9].serv_id = NULL; \
clazz[9].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC10( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9, \
serv_id_10, serv_data_10 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
return error; \
\
clazz[ 0].serv_id = serv_id_1; \
clazz[ 0].serv_data = serv_data_1; \
clazz[ 1].serv_id = serv_id_2; \
clazz[ 1].serv_data = serv_data_2; \
clazz[ 2].serv_id = serv_id_3; \
clazz[ 2].serv_data = serv_data_3; \
clazz[ 3].serv_id = serv_id_4; \
clazz[ 3].serv_data = serv_data_4; \
clazz[ 4].serv_id = serv_id_5; \
clazz[ 4].serv_data = serv_data_5; \
clazz[ 5].serv_id = serv_id_6; \
clazz[ 5].serv_data = serv_data_6; \
clazz[ 6].serv_id = serv_id_7; \
clazz[ 6].serv_data = serv_data_7; \
clazz[ 7].serv_id = serv_id_8; \
clazz[ 7].serv_data = serv_data_8; \
clazz[ 8].serv_id = serv_id_9; \
clazz[ 8].serv_data = serv_data_9; \
clazz[ 9].serv_id = serv_id_10; \
clazz[ 9].serv_data = serv_data_10; \
clazz[10].serv_id = NULL; \
clazz[10].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/*
* Parse a list of FT_ServiceDescRec descriptors and look for

View File

@ -25,7 +25,6 @@
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>

View File

@ -680,8 +680,6 @@ FT_BEGIN_HEADER
typedef PSHinter_Interface* PSHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \
get_globals_funcs_, \
@ -694,25 +692,6 @@ FT_BEGIN_HEADER
get_t2_funcs_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \
get_globals_funcs_, \
get_t1_funcs_, \
get_t2_funcs_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
PSHinter_Interface* clazz ) \
{ \
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 */
FT_END_HEADER

View File

@ -46,8 +46,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_charset_id_, get_property_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
{ \
clazz->get_charset_id = get_charset_id_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -65,8 +65,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
@ -82,26 +80,6 @@ FT_BEGIN_HEADER
blend_build_vector_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_CFFLoadRec* clazz ) \
{ \
clazz->get_standard_encoding = get_standard_encoding_; \
clazz->load_private_dict = load_private_dict_; \
clazz->fd_select_get = fd_select_get_; \
clazz->blend_check_vector = blend_check_vector_; \
clazz->blend_build_vector = blend_build_vector_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -48,8 +48,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
@ -59,25 +57,6 @@ FT_BEGIN_HEADER
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
get_cid_from_glyph_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_CIDRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ros = get_ros_; \
clazz->get_is_cid = get_is_cid_; \
clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -52,8 +52,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
@ -62,23 +60,6 @@ FT_BEGIN_HEADER
get_name_, name_index_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_name = get_name_; \
clazz->name_index = name_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -93,8 +93,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
@ -116,32 +114,6 @@ FT_BEGIN_HEADER
metrics_adjust_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
{ \
clazz->hadvance_adjust = hadvance_adjust_; \
clazz->lsb_adjust = lsb_adjust_; \
clazz->rsb_adjust = rsb_adjust_; \
clazz->vadvance_adjust = vadvance_adjust_; \
clazz->tsb_adjust = tsb_adjust_; \
clazz->bsb_adjust = bsb_adjust_; \
clazz->vorg_adjust = vorg_adjust_; \
clazz->metrics_adjust = metrics_adjust_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -104,8 +104,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
@ -131,36 +129,6 @@ FT_BEGIN_HEADER
done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
{ \
clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_blend = get_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
clazz->get_var_design = get_var_design_; \
clazz->set_instance = set_instance_; \
clazz->get_var_blend = get_var_blend_; \
clazz->done_blend = done_blend_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -47,28 +47,12 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
static const FT_Service_PsFontNameRec class_ = \
{ \
get_ps_font_name_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsFontNameRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ps_font_name = get_ps_font_name_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -45,8 +45,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_property_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
{ \
clazz->set_property = set_property_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -118,8 +118,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \
unicodes_init_, \
@ -136,35 +134,6 @@ FT_BEGIN_HEADER
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \
unicodes_init_, \
unicodes_char_index_, \
unicodes_char_next_, \
macintosh_name_, \
adobe_std_strings_, \
adobe_std_encoding_, \
adobe_expert_encoding_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsCMapsRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->unicode_value = unicode_value_; \
clazz->unicodes_init = unicodes_init_; \
clazz->unicodes_char_index = unicodes_char_index_; \
clazz->unicodes_char_next = unicodes_char_next_; \
clazz->macintosh_name = macintosh_name_; \
clazz->adobe_std_strings = adobe_std_strings_; \
clazz->adobe_std_encoding = adobe_std_encoding_; \
clazz->adobe_expert_encoding = adobe_expert_encoding_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -62,8 +62,6 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
get_font_info_, \
ps_get_font_extra_, \
@ -76,29 +74,6 @@ FT_BEGIN_HEADER
get_font_private_, get_font_value_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
get_font_info_, \
ps_get_font_extra_, \
has_glyph_names_, \
get_font_private_, \
get_font_value_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsInfoRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->ps_get_font_info = get_font_info_; \
clazz->ps_get_font_extra = ps_get_font_extra_; \
clazz->ps_has_glyph_names = has_glyph_names_; \
clazz->ps_get_font_private = get_font_private_; \
clazz->ps_get_font_value = get_font_value_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -70,27 +70,12 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
static const FT_Service_SFNT_TableRec class_ = \
{ \
load_, get_, info_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec* clazz ) \
{ \
clazz->load_table = load_; \
clazz->get_table = get_; \
clazz->table_info = info_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -73,7 +73,6 @@ FT_BEGIN_HEADER
TT_CMap_Info_GetFunc get_cmap_info;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
static const FT_Service_TTCMapsRec class_ = \
@ -81,20 +80,6 @@ FT_BEGIN_HEADER
get_cmap_info_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_TTCMapsRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_cmap_info = get_cmap_info_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -39,25 +39,12 @@ FT_BEGIN_HEADER
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
static const FT_Service_TTGlyfRec class_ = \
{ \
get_location_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \
{ \
clazz->get_location = get_location_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */

View File

@ -627,7 +627,6 @@ FT_BEGIN_HEADER
/* transitional */
typedef SFNT_Interface* SFNT_Service;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SFNT_INTERFACE( \
class_, \
@ -697,84 +696,6 @@ FT_BEGIN_HEADER
get_name_id_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_INTERNAL( a, a_ ) \
clazz->a = a_;
#define FT_DEFINE_SFNT_INTERFACE( \
class_, \
goto_table_, \
init_face_, \
load_face_, \
done_face_, \
get_interface_, \
load_any_, \
load_head_, \
load_hhea_, \
load_cmap_, \
load_maxp_, \
load_os2_, \
load_post_, \
load_name_, \
free_name_, \
load_kern_, \
load_gasp_, \
load_pclt_, \
load_bhed_, \
load_sbit_image_, \
get_psname_, \
free_psnames_, \
get_kerning_, \
load_font_dir_, \
load_hmtx_, \
load_eblc_, \
free_eblc_, \
set_sbit_strike_, \
load_strike_metrics_, \
get_metrics_, \
get_name_, \
get_name_id_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
SFNT_Interface* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->goto_table = goto_table_; \
clazz->init_face = init_face_; \
clazz->load_face = load_face_; \
clazz->done_face = done_face_; \
clazz->get_interface = get_interface_; \
clazz->load_any = load_any_; \
clazz->load_head = load_head_; \
clazz->load_hhea = load_hhea_; \
clazz->load_cmap = load_cmap_; \
clazz->load_maxp = load_maxp_; \
clazz->load_os2 = load_os2_; \
clazz->load_post = load_post_; \
clazz->load_name = load_name_; \
clazz->free_name = free_name_; \
clazz->load_kern = load_kern_; \
clazz->load_gasp = load_gasp_; \
clazz->load_pclt = load_pclt_; \
clazz->load_bhed = load_bhed_; \
clazz->load_sbit_image = load_sbit_image_; \
clazz->get_psname = get_psname_; \
clazz->free_psnames = free_psnames_; \
clazz->get_kerning = get_kerning_; \
clazz->load_font_dir = load_font_dir_; \
clazz->load_hmtx = load_hmtx_; \
clazz->load_eblc = load_eblc_; \
clazz->free_eblc = free_eblc_; \
clazz->set_sbit_strike = set_sbit_strike_; \
clazz->load_strike_metrics = load_strike_metrics_; \
clazz->get_metrics = get_metrics_; \
clazz->get_name = get_name_; \
clazz->get_name_id = get_name_id_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER

View File

@ -37,7 +37,6 @@ FONT_MODULES += truetype
# PostScript Type 1 font driver.
#
# This driver needs the `psaux', `pshinter', and `psnames' modules.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += type1
# CFF/OpenType font driver.
@ -48,30 +47,24 @@ FONT_MODULES += cff
# Type 1 CID-keyed font driver.
#
# This driver needs the `psaux', `pshinter', and `psnames' modules.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += cid
# PFR/TrueDoc font driver. See optional extension ftpfr.c below also.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += pfr
# PostScript Type 42 font driver.
#
# This driver needs the `truetype' and `psaux' modules.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += type42
# Windows FONT/FNT font driver. See optional extension ftwinfnt.c below
# also.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += winfonts
# PCF font driver. If debugging and tracing is enabled, needs `ftbitmap.c'.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += pcf
# BDF font driver. See optional extension ftbdf.c below also.
# No FT_CONFIG_OPTION_PIC support.
FONT_MODULES += bdf
# SFNT files support. If used without `truetype' or `cff', it supports
@ -114,41 +107,34 @@ RASTER_MODULES += smooth
# FreeType's cache sub-system (quite stable but still in beta -- this means
# that its public API is subject to change if necessary). See
# include/freetype/ftcache.h. Needs `ftglyph.c'.
# No FT_CONFIG_OPTION_PIC support.
AUX_MODULES += cache
# TrueType GX/AAT table validation. Needs `ftgxval.c' below.
#
# No FT_CONFIG_OPTION_PIC support.
# AUX_MODULES += gxvalid
# Support for streams compressed with gzip (files with suffix .gz).
#
# See include/freetype/ftgzip.h for the API.
# No FT_CONFIG_OPTION_PIC support.
AUX_MODULES += gzip
# Support for streams compressed with LZW (files with suffix .Z).
#
# See include/freetype/ftlzw.h for the API.
# No FT_CONFIG_OPTION_PIC support.
AUX_MODULES += lzw
# Support for streams compressed with bzip2 (files with suffix .bz2).
#
# See include/freetype/ftbzip2.h for the API.
# No FT_CONFIG_OPTION_PIC support.
AUX_MODULES += bzip2
# OpenType table validation. Needs `ftotval.c' below.
#
# No FT_CONFIG_OPTION_PIC support.
# AUX_MODULES += otvalid
# Auxiliary PostScript driver component to share common code.
#
# This module depends on `psnames'.
# No FT_CONFIG_OPTION_PIC support.
AUX_MODULES += psaux
# Support for PostScript glyph names.

View File

@ -27,7 +27,6 @@
#include FT_INTERNAL_DEBUG_H
#include "afglobal.h"
#include "afpic.h"
#include "aflatin.h"
#include "afcjk.h"
@ -92,13 +91,8 @@
AF_CJKMetricsRec dummy[1];
AF_Scaler scaler = &dummy->root.scaler;
#ifdef FT_CONFIG_OPTION_PIC
AF_FaceGlobals globals = metrics->root.globals;
#endif
AF_StyleClass style_class = metrics->root.style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
AF_ScriptClass script_class = af_script_classes[style_class->script];
void* shaper_buf;
const char* p;

View File

@ -38,7 +38,6 @@
#include "afwrtsys.h"
#include "aferrors.h"
#include "afpic.h"
#undef SCRIPT
@ -67,8 +66,6 @@
#include "afstyles.h"
#ifndef FT_CONFIG_OPTION_PIC
#undef WRITING_SYSTEM
#define WRITING_SYSTEM( ws, WS ) \
&af_ ## ws ## _writing_system_class,
@ -110,8 +107,6 @@
NULL /* do not remove */
};
#endif /* !FT_CONFIG_OPTION_PIC */
#ifdef FT_DEBUG_LEVEL_TRACE
@ -159,12 +154,12 @@
}
/* scan each style in a Unicode charmap */
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
for ( ss = 0; af_style_classes[ss]; ss++ )
{
AF_StyleClass style_class =
AF_STYLE_CLASSES_GET[ss];
af_style_classes[ss];
AF_ScriptClass script_class =
AF_SCRIPT_CLASSES_GET[style_class->script];
af_script_classes[style_class->script];
AF_Script_UniRange range;
@ -246,9 +241,9 @@
}
/* handle the remaining default OpenType features ... */
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
for ( ss = 0; af_style_classes[ss]; ss++ )
{
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
AF_StyleClass style_class = af_style_classes[ss];
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
@ -256,7 +251,7 @@
}
/* ... and finally the default OpenType features of the default script */
af_shaper_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles, 1 );
af_shaper_get_coverage( globals, af_style_classes[dflt], gstyles, 1 );
/* mark ASCII digits */
for ( i = 0x30; i <= 0x39; i++ )
@ -295,9 +290,9 @@
"==============\n"
"\n" ));
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
for ( ss = 0; af_style_classes[ss]; ss++ )
{
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
AF_StyleClass style_class = af_style_classes[ss];
FT_UInt count = 0;
FT_Long idx;
@ -397,9 +392,9 @@
if ( globals->metrics[nn] )
{
AF_StyleClass style_class =
AF_STYLE_CLASSES_GET[nn];
af_style_classes[nn];
AF_WritingSystemClass writing_system_class =
AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
af_writing_system_classes[style_class->writing_system];
if ( writing_system_class->style_metrics_done )
@ -448,8 +443,8 @@
style = (AF_Style)( globals->glyph_styles[gindex] &
AF_STYLE_UNASSIGNED );
style_class = AF_STYLE_CLASSES_GET[style];
writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET
style_class = af_style_classes[style];
writing_system_class = af_writing_system_classes
[style_class->writing_system];
metrics = globals->metrics[style];

View File

@ -21,7 +21,6 @@
#include FT_INTERNAL_DEBUG_H
#include "afglobal.h"
#include "afpic.h"
#include "aflatin.h"
#include "aferrors.h"
@ -83,13 +82,8 @@
AF_LatinMetricsRec dummy[1];
AF_Scaler scaler = &dummy->root.scaler;
#ifdef FT_CONFIG_OPTION_PIC
AF_FaceGlobals globals = metrics->root.globals;
#endif
AF_StyleClass style_class = metrics->root.style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
AF_ScriptClass script_class = af_script_classes[style_class->script];
void* shaper_buf;
const char* p;
@ -2049,13 +2043,8 @@
FT_Memory memory = hints->memory;
AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
#ifdef FT_CONFIG_OPTION_PIC
AF_FaceGlobals globals = hints->metrics->globals;
#endif
AF_StyleClass style_class = hints->metrics->style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
AF_ScriptClass script_class = af_script_classes[style_class->script];
FT_Bool top_to_bottom_hinting = 0;
@ -2936,13 +2925,8 @@
AF_Edge anchor = NULL;
FT_Int has_serifs = 0;
#ifdef FT_CONFIG_OPTION_PIC
AF_FaceGlobals globals = hints->metrics->globals;
#endif
AF_StyleClass style_class = hints->metrics->style_class;
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
[style_class->script];
AF_ScriptClass script_class = af_script_classes[style_class->script];
FT_Bool top_to_bottom_hinting = 0;

View File

@ -21,7 +21,6 @@
#include "afhints.h"
#include "aferrors.h"
#include "afmodule.h"
#include "afpic.h"
#include FT_INTERNAL_CALC_H
@ -124,7 +123,7 @@
* it can't deliver, stem darkening is disabled.
*/
writing_system_class =
AF_WRITING_SYSTEM_CLASSES_GET[style_metrics->style_class->writing_system];
af_writing_system_classes[style_metrics->style_class->writing_system];
if ( writing_system_class->style_metrics_getstdw )
writing_system_class->style_metrics_getstdw( style_metrics,
@ -232,10 +231,6 @@
AF_StyleClass style_class;
AF_WritingSystemClass writing_system_class;
#ifdef FT_CONFIG_OPTION_PIC
AF_FaceGlobals globals = loader->globals;
#endif
if ( !size )
return FT_THROW( Invalid_Size_Handle );
@ -324,7 +319,7 @@
style_class = style_metrics->style_class;
writing_system_class =
AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
af_writing_system_classes[style_class->writing_system];
loader->metrics = style_metrics;

View File

@ -20,7 +20,6 @@
#include "afmodule.h"
#include "afloader.h"
#include "aferrors.h"
#include "afpic.h"
#ifdef FT_DEBUG_AUTOFIT
@ -104,19 +103,6 @@
}
#ifdef FT_CONFIG_OPTION_PIC
#undef AF_SCRIPT_CLASSES_GET
#define AF_SCRIPT_CLASSES_GET \
( GET_PIC( ft_module->library )->af_script_classes )
#undef AF_STYLE_CLASSES_GET
#define AF_STYLE_CLASSES_GET \
( GET_PIC( ft_module->library )->af_style_classes )
#endif
static FT_Error
af_property_set( FT_Module ft_module,
const char* property_name,
@ -147,9 +133,9 @@
/* We translate the fallback script to a fallback style that uses */
/* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */
/* coverage value. */
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
for ( ss = 0; af_style_classes[ss]; ss++ )
{
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
AF_StyleClass style_class = af_style_classes[ss];
if ( (FT_UInt)style_class->script == *fallback_script &&
@ -160,7 +146,7 @@
}
}
if ( !AF_STYLE_CLASSES_GET[ss] )
if ( !af_style_classes[ss] )
{
FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
fallback_script, property_name ));
@ -357,7 +343,7 @@
{
FT_UInt* val = (FT_UInt*)value;
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[fallback_style];
AF_StyleClass style_class = af_style_classes[fallback_style];
*val = style_class->script;
@ -440,28 +426,16 @@
FT_DEFINE_SERVICEDESCREC1(
af_services,
FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )
FT_SERVICE_ID_PROPERTIES, &af_service_properties )
FT_CALLBACK_DEF( FT_Module_Interface )
af_get_interface( FT_Module module,
const char* module_interface )
{
/* AF_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
if ( !module )
return NULL;
library = module->library;
if ( !library )
return NULL;
#else
FT_UNUSED( module );
#endif
return ft_service_list_lookup( AF_SERVICES_GET, module_interface );
return ft_service_list_lookup( af_services, module_interface );
}
@ -589,7 +563,7 @@
0x10000L, /* version 1.0 of the autofitter */
0x20000L, /* requires FreeType 2.0 or above */
(const void*)&AF_INTERFACE_GET,
(const void*)&af_autofitter_interface,
(FT_Module_Constructor)af_autofitter_init, /* module_init */
(FT_Module_Destructor) af_autofitter_done, /* module_done */

View File

@ -1,152 +0,0 @@
/***************************************************************************/
/* */
/* afpic.c */
/* */
/* The FreeType position independent code services for autofit module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "afpic.h"
#include "afglobal.h"
#include "aferrors.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from afmodule.c */
FT_Error
FT_Create_Class_af_services( FT_Library library,
FT_ServiceDescRec** output_class );
void
FT_Destroy_Class_af_services( FT_Library library,
FT_ServiceDescRec* clazz );
void
FT_Init_Class_af_service_properties( FT_Service_PropertiesRec* clazz );
void FT_Init_Class_af_autofitter_interface(
FT_Library library,
FT_AutoHinter_InterfaceRec* clazz );
/* forward declaration of PIC init functions from writing system classes */
#undef WRITING_SYSTEM
#define WRITING_SYSTEM( ws, WS ) /* empty */
#include "afwrtsys.h"
void
autofit_module_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->autofit )
{
AFModulePIC* container = (AFModulePIC*)pic_container->autofit;
if ( container->af_services )
FT_Destroy_Class_af_services( library,
container->af_services );
container->af_services = NULL;
FT_FREE( container );
pic_container->autofit = NULL;
}
}
FT_Error
autofit_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_UInt ss;
FT_Error error = FT_Err_Ok;
AFModulePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->autofit = container;
/* initialize pointer table - */
/* this is how the module usually expects this data */
error = FT_Create_Class_af_services( library,
&container->af_services );
if ( error )
goto Exit;
FT_Init_Class_af_service_properties( &container->af_service_properties );
for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )
container->af_writing_system_classes[ss] =
&container->af_writing_system_classes_rec[ss];
container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;
for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )
container->af_script_classes[ss] =
&container->af_script_classes_rec[ss];
container->af_script_classes[AF_SCRIPT_MAX] = NULL;
for ( ss = 0; ss < AF_STYLE_MAX; ss++ )
container->af_style_classes[ss] =
&container->af_style_classes_rec[ss];
container->af_style_classes[AF_STYLE_MAX] = NULL;
#undef WRITING_SYSTEM
#define WRITING_SYSTEM( ws, WS ) \
FT_Init_Class_af_ ## ws ## _writing_system_class( \
&container->af_writing_system_classes_rec[ss++] );
ss = 0;
#include "afwrtsys.h"
#undef SCRIPT
#define SCRIPT( s, S, d, h, H, sss ) \
FT_Init_Class_af_ ## s ## _script_class( \
&container->af_script_classes_rec[ss++] );
ss = 0;
#include "afscript.h"
#undef STYLE
#define STYLE( s, S, d, ws, sc, bss, c ) \
FT_Init_Class_af_ ## s ## _style_class( \
&container->af_style_classes_rec[ss++] );
ss = 0;
#include "afstyles.h"
FT_Init_Class_af_autofitter_interface(
library, &container->af_autofitter_interface );
Exit:
if ( error )
autofit_module_class_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,105 +0,0 @@
/***************************************************************************/
/* */
/* afpic.h */
/* */
/* The FreeType position independent code services for autofit module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef AFPIC_H_
#define AFPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define AF_SERVICES_GET af_services
#define AF_SERVICE_PROPERTIES_GET af_service_properties
#define AF_WRITING_SYSTEM_CLASSES_GET af_writing_system_classes
#define AF_SCRIPT_CLASSES_GET af_script_classes
#define AF_STYLE_CLASSES_GET af_style_classes
#define AF_INTERFACE_GET af_autofitter_interface
#else /* FT_CONFIG_OPTION_PIC */
/* some include files required for members of AFModulePIC */
#include FT_SERVICE_PROPERTIES_H
#include "aftypes.h"
FT_BEGIN_HEADER
typedef struct AFModulePIC_
{
FT_ServiceDescRec* af_services;
FT_Service_PropertiesRec af_service_properties;
AF_WritingSystemClass af_writing_system_classes
[AF_WRITING_SYSTEM_MAX + 1];
AF_WritingSystemClassRec af_writing_system_classes_rec
[AF_WRITING_SYSTEM_MAX];
AF_ScriptClass af_script_classes
[AF_SCRIPT_MAX + 1];
AF_ScriptClassRec af_script_classes_rec
[AF_SCRIPT_MAX];
AF_StyleClass af_style_classes
[AF_STYLE_MAX + 1];
AF_StyleClassRec af_style_classes_rec
[AF_STYLE_MAX];
FT_AutoHinter_InterfaceRec af_autofitter_interface;
} AFModulePIC;
#define GET_PIC( lib ) \
( (AFModulePIC*)( (lib)->pic_container.autofit ) )
#define AF_SERVICES_GET \
( GET_PIC( library )->af_services )
#define AF_SERVICE_PROPERTIES_GET \
( GET_PIC( library )->af_service_properties )
#define AF_WRITING_SYSTEM_CLASSES_GET \
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes )
#define AF_SCRIPT_CLASSES_GET \
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
#define AF_STYLE_CLASSES_GET \
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes )
#define AF_INTERFACE_GET \
( GET_PIC( library )->af_autofitter_interface )
/* see afpic.c for the implementation */
void
autofit_module_class_pic_free( FT_Library library );
FT_Error
autofit_module_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* AFPIC_H_ */
/* END */

View File

@ -486,8 +486,6 @@ extern void* _af_debug_hints;
/* Declare and define vtables for classes */
#ifndef FT_CONFIG_OPTION_PIC
#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
FT_CALLBACK_TABLE const AF_WritingSystemClassRec \
writing_system_class;
@ -562,87 +560,9 @@ extern void* _af_debug_hints;
coverage \
};
#else /* FT_CONFIG_OPTION_PIC */
#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
FT_LOCAL( void ) \
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac );
#define AF_DEFINE_WRITING_SYSTEM_CLASS( \
writing_system_class, \
system, \
m_size, \
m_init, \
m_scale, \
m_done, \
m_stdw, \
h_init, \
h_apply ) \
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \
{ \
ac->writing_system = system; \
\
ac->style_metrics_size = m_size; \
\
ac->style_metrics_init = m_init; \
ac->style_metrics_scale = m_scale; \
ac->style_metrics_done = m_done; \
ac->style_metrics_getstdw = m_stdw; \
\
ac->style_hints_init = h_init; \
ac->style_hints_apply = h_apply; \
}
#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
FT_LOCAL( void ) \
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac );
#define AF_DEFINE_SCRIPT_CLASS( \
script_class, \
script_, \
ranges, \
nonbase_ranges, \
top_to_bottom, \
std_charstring ) \
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
{ \
ac->script = script_; \
ac->script_uni_ranges = ranges; \
ac->script_uni_nonbase_ranges = nonbase_ranges; \
ac->top_to_bottom_hinting = top_to_bottom; \
ac->standard_charstring = std_charstring; \
}
#define AF_DECLARE_STYLE_CLASS( style_class ) \
FT_LOCAL( void ) \
FT_Init_Class_ ## style_class( AF_StyleClassRec* ac );
#define AF_DEFINE_STYLE_CLASS( \
style_class, \
style_, \
writing_system_, \
script_, \
blue_stringset_, \
coverage_ ) \
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## style_class( AF_StyleClassRec* ac ) \
{ \
ac->style = style_; \
ac->writing_system = writing_system_; \
ac->script = script_; \
ac->blue_stringset = blue_stringset_; \
ac->coverage = coverage_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* AFTYPES_H_ */

View File

@ -30,7 +30,6 @@
#include "aflatin2.c"
#include "afloader.c"
#include "afmodule.c"
#include "afpic.c"
#include "afranges.c"
#include "afshaper.c"
#include "afwarp.c"

View File

@ -38,7 +38,6 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
$(AUTOF_DIR)/aflatin.c \
$(AUTOF_DIR)/afloader.c \
$(AUTOF_DIR)/afmodule.c \
$(AUTOF_DIR)/afpic.c \
$(AUTOF_DIR)/afranges.c \
$(AUTOF_DIR)/afshaper.c \
$(AUTOF_DIR)/afwarp.c

View File

@ -1,108 +0,0 @@
/***************************************************************************/
/* */
/* basepic.c */
/* */
/* The FreeType position independent code services for base. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "basepic.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from ftglyph.c */
void
FT_Init_Class_ft_outline_glyph_class( FT_Glyph_Class* clazz );
void
FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class* clazz );
#ifdef FT_CONFIG_OPTION_MAC_FONTS
/* forward declaration of PIC init function from ftrfork.c */
/* (not modularized) */
void
FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec* record );
#endif
/* forward declaration of PIC init functions from ftinit.c */
FT_Error
ft_create_default_module_classes( FT_Library library );
void
ft_destroy_default_module_classes( FT_Library library );
void
ft_base_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->base )
{
/* destroy default module classes */
/* (in case FT_Add_Default_Modules was used) */
ft_destroy_default_module_classes( library );
FT_FREE( pic_container->base );
pic_container->base = NULL;
}
}
FT_Error
ft_base_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
BasePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->base = container;
/* initialize default modules list and pointers */
error = ft_create_default_module_classes( library );
if ( error )
goto Exit;
/* initialize pointer table - */
/* this is how the module usually expects this data */
FT_Init_Class_ft_outline_glyph_class(
&container->ft_outline_glyph_class );
FT_Init_Class_ft_bitmap_glyph_class(
&container->ft_bitmap_glyph_class );
#ifdef FT_CONFIG_OPTION_MAC_FONTS
FT_Init_Table_ft_raccess_guess_table(
(ft_raccess_guess_rec*)&container->ft_raccess_guess_table );
#endif
Exit:
if ( error )
ft_base_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,91 +0,0 @@
/***************************************************************************/
/* */
/* basepic.h */
/* */
/* The FreeType position independent code services for base. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef BASEPIC_H_
#define BASEPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class
#define FT_BITMAP_GLYPH_CLASS_GET &ft_bitmap_glyph_class
#define FT_DEFAULT_MODULES_GET ft_default_modules
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#define FT_RACCESS_GUESS_TABLE_GET ft_raccess_guess_table
#endif
#else /* FT_CONFIG_OPTION_PIC */
#include FT_GLYPH_H
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#include FT_INTERNAL_RFORK_H
#endif
FT_BEGIN_HEADER
typedef struct BasePIC_
{
FT_Module_Class** default_module_classes;
FT_Glyph_Class ft_outline_glyph_class;
FT_Glyph_Class ft_bitmap_glyph_class;
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
ft_raccess_guess_rec ft_raccess_guess_table[FT_RACCESS_N_RULES];
#endif
} BasePIC;
#define GET_PIC( lib ) ( (BasePIC*)( (lib)->pic_container.base ) )
#define FT_OUTLINE_GLYPH_CLASS_GET \
( &GET_PIC( library )->ft_outline_glyph_class )
#define FT_BITMAP_GLYPH_CLASS_GET \
( &GET_PIC( library )->ft_bitmap_glyph_class )
#define FT_DEFAULT_MODULES_GET \
( GET_PIC( library )->default_module_classes )
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#define FT_RACCESS_GUESS_TABLE_GET \
( GET_PIC( library )->ft_raccess_guess_table )
#endif
/* see basepic.c for the implementation */
void
ft_base_pic_free( FT_Library library );
FT_Error
ft_base_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* BASEPIC_H_ */
/* END */

View File

@ -19,7 +19,6 @@
#include <ft2build.h>
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include "basepic.c"
#include "ftadvanc.c"
#include "ftcalc.c"
#include "ftdbgmem.c"
@ -30,7 +29,6 @@
#include "ftmac.c"
#include "ftobjs.c"
#include "ftoutln.c"
#include "ftpic.c"
#include "ftpsprop.c"
#include "ftrfork.c"
#include "ftsnames.c"

View File

@ -490,12 +490,6 @@
FT_Error error;
TBBox_Rec user;
#ifdef FT_CONFIG_OPTION_PIC
FT_Outline_Funcs bbox_interface;
Init_Class_bbox_interface( &bbox_interface );
#endif
user.bbox = bbox;

View File

@ -36,7 +36,6 @@
#include FT_BITMAP_H
#include FT_INTERNAL_OBJECTS_H
#include "basepic.h"
/*************************************************************************/
/* */
@ -380,11 +379,11 @@
/* if it is a bitmap, that's easy :-) */
if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
clazz = FT_BITMAP_GLYPH_CLASS_GET;
clazz = &ft_bitmap_glyph_class;
/* if it is an outline */
else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
clazz = FT_OUTLINE_GLYPH_CLASS_GET;
clazz = &ft_outline_glyph_class;
else
{
@ -536,7 +535,6 @@
FT_BitmapGlyph bitmap = NULL;
const FT_Glyph_Class* clazz;
/* FT_BITMAP_GLYPH_CLASS_GET dereferences `library' in PIC mode */
FT_Library library;
@ -553,7 +551,7 @@
goto Bad;
/* when called with a bitmap glyph, do nothing and return successfully */
if ( clazz == FT_BITMAP_GLYPH_CLASS_GET )
if ( clazz == &ft_bitmap_glyph_class )
goto Exit;
if ( !clazz->glyph_prepare )
@ -569,7 +567,7 @@
dummy.format = clazz->glyph_format;
/* create result bitmap glyph */
error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &b );
error = ft_new_glyph( library, &ft_bitmap_glyph_class, &b );
if ( error )
goto Exit;
bitmap = (FT_BitmapGlyph)b;

View File

@ -42,7 +42,6 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_MODULE_H
#include "basepic.h"
/*************************************************************************/
@ -55,9 +54,6 @@
#define FT_COMPONENT trace_init
#ifndef FT_CONFIG_OPTION_PIC
#undef FT_USE_MODULE
#ifdef __cplusplus
#define FT_USE_MODULE( type, x ) extern "C" const type x;
@ -78,120 +74,6 @@
};
#else /* FT_CONFIG_OPTION_PIC */
#ifdef __cplusplus
#define FT_EXTERNC extern "C"
#else
#define FT_EXTERNC extern
#endif
/* declare the module's class creation/destruction functions */
#undef FT_USE_MODULE
#define FT_USE_MODULE( type, x ) \
FT_EXTERNC FT_Error \
FT_Create_Class_ ## x( FT_Library library, \
FT_Module_Class* *output_class ); \
FT_EXTERNC void \
FT_Destroy_Class_ ## x( FT_Library library, \
FT_Module_Class* clazz );
#include FT_CONFIG_MODULES_H
/* count all module classes */
#undef FT_USE_MODULE
#define FT_USE_MODULE( type, x ) MODULE_CLASS_ ## x,
enum
{
#include FT_CONFIG_MODULES_H
FT_NUM_MODULE_CLASSES
};
/* destroy all module classes */
#undef FT_USE_MODULE
#define FT_USE_MODULE( type, x ) \
if ( classes[i] ) \
{ \
FT_Destroy_Class_ ## x( library, classes[i] ); \
} \
i++;
FT_BASE_DEF( void )
ft_destroy_default_module_classes( FT_Library library )
{
FT_Module_Class* *classes;
FT_Memory memory;
FT_UInt i;
BasePIC* pic_container = (BasePIC*)library->pic_container.base;
if ( !pic_container->default_module_classes )
return;
memory = library->memory;
classes = pic_container->default_module_classes;
i = 0;
#include FT_CONFIG_MODULES_H
FT_FREE( classes );
pic_container->default_module_classes = NULL;
}
/* initialize all module classes and the pointer table */
#undef FT_USE_MODULE
#define FT_USE_MODULE( type, x ) \
error = FT_Create_Class_ ## x( library, &clazz ); \
if ( error ) \
goto Exit; \
classes[i++] = clazz;
FT_BASE_DEF( FT_Error )
ft_create_default_module_classes( FT_Library library )
{
FT_Error error;
FT_Memory memory;
FT_Module_Class* *classes = NULL;
FT_Module_Class* clazz;
FT_UInt i;
BasePIC* pic_container = (BasePIC*)library->pic_container.base;
memory = library->memory;
pic_container->default_module_classes = NULL;
if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *
( FT_NUM_MODULE_CLASSES + 1 ) ) )
return error;
/* initialize all pointers to 0, especially the last one */
for ( i = 0; i < FT_NUM_MODULE_CLASSES; i++ )
classes[i] = NULL;
classes[FT_NUM_MODULE_CLASSES] = NULL;
i = 0;
#include FT_CONFIG_MODULES_H
Exit:
if ( error )
ft_destroy_default_module_classes( library );
else
pic_container->default_module_classes = classes;
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* documentation is in ftmodapi.h */
FT_EXPORT_DEF( void )
@ -201,16 +83,10 @@
const FT_Module_Class* const* cur;
/* FT_DEFAULT_MODULES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !library )
return;
#endif
/* GCC 4.6 warns the type difference:
* FT_Module_Class** != const FT_Module_Class* const*
*/
cur = (const FT_Module_Class* const*)FT_DEFAULT_MODULES_GET;
cur = (const FT_Module_Class* const*)ft_default_modules;
/* test for valid `library' delayed to FT_Add_Module() */
while ( *cur )

View File

@ -5156,13 +5156,6 @@
library->memory = memory;
#ifdef FT_CONFIG_OPTION_PIC
/* initialize position independent code containers */
error = ft_pic_container_init( library );
if ( error )
goto Fail;
#endif
library->version_major = FREETYPE_MAJOR;
library->version_minor = FREETYPE_MINOR;
library->version_patch = FREETYPE_PATCH;
@ -5173,13 +5166,6 @@
*alibrary = library;
return FT_Err_Ok;
#ifdef FT_CONFIG_OPTION_PIC
Fail:
ft_pic_container_destroy( library );
FT_FREE( library );
return error;
#endif
}
@ -5310,11 +5296,6 @@
}
#endif
#ifdef FT_CONFIG_OPTION_PIC
/* Destroy pic container contents */
ft_pic_container_destroy( library );
#endif
FT_FREE( library );
Exit:

View File

@ -1,55 +0,0 @@
/***************************************************************************/
/* */
/* ftpic.c */
/* */
/* The FreeType position independent code services (body). */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "basepic.h"
#ifdef FT_CONFIG_OPTION_PIC
/* documentation is in ftpic.h */
FT_BASE_DEF( FT_Error )
ft_pic_container_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error;
FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );
error = ft_base_pic_init( library );
if ( error )
return error;
return FT_Err_Ok;
}
/* Destroy the contents of the container. */
FT_BASE_DEF( void )
ft_pic_container_destroy( FT_Library library )
{
ft_base_pic_free( library );
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -28,7 +28,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_RFORK_H
#include "basepic.h"
#include "ftbase.h"
#undef FT_COMPONENT
@ -468,10 +468,10 @@
if ( errors[i] )
continue;
errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,
stream, base_name,
&(new_names[i]),
&(offsets[i]) );
errors[i] = ft_raccess_guess_table[i].func( library,
stream, base_name,
&(new_names[i]),
&(offsets[i]) );
}
return;
@ -488,7 +488,7 @@
if ( rule_index >= FT_RACCESS_N_RULES )
return FT_RFork_Rule_invalid;
return FT_RACCESS_GUESS_TABLE_GET[rule_index].type;
return ft_raccess_guess_table[rule_index].type;
}

View File

@ -24,15 +24,10 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
#include "basepic.h"
/* declare an extern to access `ft_outline_glyph_class' globally */
/* allocated in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
/* macro to access it when FT_CONFIG_OPTION_PIC is defined */
#ifndef FT_CONFIG_OPTION_PIC
/* declare an extern to access `ft_outline_glyph_class' globally */
/* allocated in `ftglyph.c' */
FT_CALLBACK_TABLE const FT_Glyph_Class ft_outline_glyph_class;
#endif
/* documentation is in ftstroke.h */
@ -2306,17 +2301,12 @@
FT_Error error = FT_ERR( Invalid_Argument );
FT_Glyph glyph = NULL;
/* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
FT_Library library = stroker->library;
FT_UNUSED( library );
if ( !pglyph )
goto Exit;
glyph = *pglyph;
if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
goto Exit;
{
@ -2386,17 +2376,12 @@
FT_Error error = FT_ERR( Invalid_Argument );
FT_Glyph glyph = NULL;
/* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
FT_Library library = stroker->library;
FT_UNUSED( library );
if ( !pglyph )
goto Exit;
glyph = *pglyph;
if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
goto Exit;
{

View File

@ -36,8 +36,7 @@ BASE_COMPILE := $(CC) $(ANSIFLAGS) \
# All files listed here should be included in `ftbase.c' (for a `single'
# build).
#
BASE_SRC := $(BASE_DIR)/basepic.c \
$(BASE_DIR)/ftadvanc.c \
BASE_SRC := $(BASE_DIR)/ftadvanc.c \
$(BASE_DIR)/ftcalc.c \
$(BASE_DIR)/ftdbgmem.c \
$(BASE_DIR)/ftfntfmt.c \
@ -46,7 +45,6 @@ BASE_SRC := $(BASE_DIR)/basepic.c \
$(BASE_DIR)/ftlcdfil.c \
$(BASE_DIR)/ftobjs.c \
$(BASE_DIR)/ftoutln.c \
$(BASE_DIR)/ftpic.c \
$(BASE_DIR)/ftpsprop.c \
$(BASE_DIR)/ftrfork.c \
$(BASE_DIR)/ftsnames.c \
@ -60,8 +58,7 @@ ifneq ($(ftmac_c),)
endif
# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h')
BASE_H := $(BASE_DIR)/basepic.h \
$(BASE_DIR)/ftbase.h \
BASE_H := $(BASE_DIR)/ftbase.h \
$(BASE_DIR)/md5.c \
$(BASE_DIR)/md5.h

View File

@ -36,10 +36,6 @@ THE SOFTWARE.
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
typedef struct BDF_encoding_el_
{

View File

@ -43,10 +43,6 @@
#ifdef FT_CONFIG_OPTION_USE_BZIP2
#ifdef FT_CONFIG_OPTION_PIC
#error "bzip2 code does not support PIC yet"
#endif
#define BZ_NO_STDIO /* Do not need FILE */
#include <bzlib.h>

View File

@ -26,10 +26,6 @@
#include "ftccback.h"
#include "ftcerror.h"
#ifdef FT_CONFIG_OPTION_PIC
#error "cache system does not support PIC yet"
#endif
#undef FT_COMPONENT
#define FT_COMPONENT trace_cache

View File

@ -23,7 +23,6 @@
#include "cffdrivr.c"
#include "cffgload.c"
#include "cffparse.c"
#include "cffpic.c"
#include "cffload.c"
#include "cffobjs.c"

View File

@ -42,7 +42,6 @@
#endif
#include "cfferrs.h"
#include "cffpic.h"
#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_GLYPH_DICT_H
@ -654,8 +653,8 @@
FT_Library library = FT_FACE_LIBRARY( face );
if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&
cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET )
if ( cmap->clazz != &cff_cmap_encoding_class_rec &&
cmap->clazz != &cff_cmap_unicode_class_rec )
{
FT_Module sfnt = FT_Get_Module( library, "sfnt" );
FT_Service_TTCMaps service =
@ -1001,54 +1000,54 @@
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
FT_SERVICE_ID_MULTI_MASTERS, &cff_service_multi_masters,
FT_SERVICE_ID_METRICS_VARIATIONS, &cff_service_metrics_variations,
FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict,
FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
FT_SERVICE_ID_CID, &cff_service_cid_info,
FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#elif !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES
FT_DEFINE_SERVICEDESCREC8(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict,
FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
FT_SERVICE_ID_CID, &cff_service_cid_info,
FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#elif defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICEDESCREC9(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
FT_SERVICE_ID_MULTI_MASTERS, &cff_service_multi_masters,
FT_SERVICE_ID_METRICS_VARIATIONS, &cff_service_metrics_var,
FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
FT_SERVICE_ID_CID, &cff_service_cid_info,
FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#else
FT_DEFINE_SERVICEDESCREC7(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
FT_SERVICE_ID_CID, &cff_service_cid_info,
FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#endif
@ -1062,27 +1061,16 @@
FT_Module_Interface result;
/* CFF_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
result = ft_service_list_lookup( cff_services, module_interface );
if ( result )
return result;
/* `driver' is not yet evaluated in non-PIC mode */
#ifndef FT_CONFIG_OPTION_PIC
/* `driver' is not yet evaluated */
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
/* we pass our request to the `sfnt' module */
sfnt = FT_Get_Module( library, "sfnt" );

View File

@ -26,10 +26,8 @@
FT_BEGIN_HEADER
FT_DECLARE_DRIVER( cff_driver_class )
FT_END_HEADER
#endif /* CFFDRIVER_H_ */

View File

@ -37,7 +37,6 @@
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
#include "cffpic.h"
#include "cfferrs.h"
@ -1070,7 +1069,7 @@
nn = (FT_UInt)cffface->num_charmaps;
error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
error = FT_CMap_New( &cff_cmap_unicode_class_rec, NULL,
&cmaprec, NULL );
if ( error &&
FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
@ -1094,19 +1093,19 @@
{
cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
clazz = &cff_cmap_encoding_class_rec;
}
else if ( encoding->offset == 1 )
{
cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
clazz = &cff_cmap_encoding_class_rec;
}
else
{
cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
clazz = &cff_cmap_encoding_class_rec;
}
error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );

View File

@ -24,7 +24,6 @@
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include "cfferrs.h"
#include "cffpic.h"
#include "cffload.h"
@ -1003,9 +1002,6 @@
CFF_FIELD( code, name, id, cff_kind_bool )
#ifndef FT_CONFIG_OPTION_PIC
#undef CFF_FIELD
#undef CFF_FIELD_DELTA
@ -1118,184 +1114,6 @@
#endif /* FT_DEBUG_LEVEL_TRACE */
#else /* FT_CONFIG_OPTION_PIC */
void
FT_Destroy_Class_cff_field_handlers( FT_Library library,
CFF_Field_Handler* clazz )
{
FT_Memory memory = library->memory;
if ( clazz )
FT_FREE( clazz );
}
FT_Error
FT_Create_Class_cff_field_handlers( FT_Library library,
CFF_Field_Handler** output_class )
{
CFF_Field_Handler* clazz = NULL;
FT_Error error;
FT_Memory memory = library->memory;
int i = 0;
#undef CFF_FIELD
#define CFF_FIELD( code, name, id, kind ) i++;
#undef CFF_FIELD_DELTA
#define CFF_FIELD_DELTA( code, name, max, id ) i++;
#undef CFF_FIELD_CALLBACK
#define CFF_FIELD_CALLBACK( code, name, id ) i++;
#undef CFF_FIELD_BLEND
#define CFF_FIELD_BLEND( code, id ) i++;
#include "cfftoken.h"
i++; /* { 0, 0, 0, 0, 0, 0, 0 } */
if ( FT_ALLOC( clazz, sizeof ( CFF_Field_Handler ) * i ) )
return error;
i = 0;
#ifndef FT_DEBUG_LEVEL_TRACE
#undef CFF_FIELD_CALLBACK
#define CFF_FIELD_CALLBACK( code_, name_, id_ ) \
clazz[i].kind = cff_kind_callback; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = 0; \
clazz[i].size = 0; \
clazz[i].reader = cff_parse_ ## name_; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
i++;
#undef CFF_FIELD
#define CFF_FIELD( code_, name_, id_, kind_ ) \
clazz[i].kind = kind_; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
clazz[i].size = FT_FIELD_SIZE( name_ ); \
clazz[i].reader = 0; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
i++; \
#undef CFF_FIELD_DELTA
#define CFF_FIELD_DELTA( code_, name_, max_, id_ ) \
clazz[i].kind = cff_kind_delta; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
clazz[i].reader = 0; \
clazz[i].array_max = max_; \
clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
i++;
#undef CFF_FIELD_BLEND
#define CFF_FIELD_BLEND( code_, id_ ) \
clazz[i].kind = cff_kind_blend; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = 0; \
clazz[i].size = 0; \
clazz[i].reader = cff_parse_blend; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
i++;
#include "cfftoken.h"
clazz[i].kind = 0;
clazz[i].code = 0;
clazz[i].offset = 0;
clazz[i].size = 0;
clazz[i].reader = 0;
clazz[i].array_max = 0;
clazz[i].count_offset = 0;
#else /* FT_DEBUG_LEVEL_TRACE */
#undef CFF_FIELD_CALLBACK
#define CFF_FIELD_CALLBACK( code_, name_, id_ ) \
clazz[i].kind = cff_kind_callback; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = 0; \
clazz[i].size = 0; \
clazz[i].reader = cff_parse_ ## name_; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
clazz[i].id = id_; \
i++;
#undef CFF_FIELD
#define CFF_FIELD( code_, name_, id_, kind_ ) \
clazz[i].kind = kind_; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
clazz[i].size = FT_FIELD_SIZE( name_ ); \
clazz[i].reader = 0; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
clazz[i].id = id_; \
i++; \
#undef CFF_FIELD_DELTA
#define CFF_FIELD_DELTA( code_, name_, max_, id_ ) \
clazz[i].kind = cff_kind_delta; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
clazz[i].reader = 0; \
clazz[i].array_max = max_; \
clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
clazz[i].id = id_; \
i++;
#undef CFF_FIELD_BLEND
#define CFF_FIELD_BLEND( code_, id_ ) \
clazz[i].kind = cff_kind_blend; \
clazz[i].code = code_ | CFFCODE; \
clazz[i].offset = 0; \
clazz[i].size = 0; \
clazz[i].reader = cff_parse_blend; \
clazz[i].array_max = 0; \
clazz[i].count_offset = 0; \
clazz[i].id = id_; \
i++;
#include "cfftoken.h"
clazz[i].kind = 0;
clazz[i].code = 0;
clazz[i].offset = 0;
clazz[i].size = 0;
clazz[i].reader = 0;
clazz[i].array_max = 0;
clazz[i].count_offset = 0;
clazz[i].id = 0;
#endif /* FT_DEBUG_LEVEL_TRACE */
*output_class = clazz;
return FT_Err_Ok;
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_LOCAL_DEF( FT_Error )
cff_parser_run( CFF_Parser parser,
FT_Byte* start,
@ -1523,7 +1341,7 @@
}
code = code | parser->object_code;
for ( field = CFF_FIELD_HANDLERS_GET; field->kind; field++ )
for ( field = cff_field_handlers; field->kind; field++ )
{
if ( field->code == (FT_Int)code )
{

View File

@ -1,138 +0,0 @@
/***************************************************************************/
/* */
/* cffpic.c */
/* */
/* The FreeType position independent code services for cff module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "cffcmap.h"
#include "cffpic.h"
#include "cfferrs.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from cffdrivr.c */
FT_Error
FT_Create_Class_cff_services( FT_Library library,
FT_ServiceDescRec** output_class );
void
FT_Destroy_Class_cff_services( FT_Library library,
FT_ServiceDescRec* clazz );
void
FT_Init_Class_cff_service_ps_info( FT_Library library,
FT_Service_PsInfoRec* clazz );
void
FT_Init_Class_cff_service_glyph_dict( FT_Library library,
FT_Service_GlyphDictRec* clazz );
void
FT_Init_Class_cff_service_ps_name( FT_Library library,
FT_Service_PsFontNameRec* clazz );
void
FT_Init_Class_cff_service_get_cmap_info( FT_Library library,
FT_Service_TTCMapsRec* clazz );
void
FT_Init_Class_cff_service_cid_info( FT_Library library,
FT_Service_CIDRec* clazz );
/* forward declaration of PIC init functions from cffparse.c */
FT_Error
FT_Create_Class_cff_field_handlers( FT_Library library,
CFF_Field_Handler** output_class );
void
FT_Destroy_Class_cff_field_handlers( FT_Library library,
CFF_Field_Handler* clazz );
void
cff_driver_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->cff )
{
CffModulePIC* container = (CffModulePIC*)pic_container->cff;
if ( container->cff_services )
FT_Destroy_Class_cff_services( library,
container->cff_services );
container->cff_services = NULL;
if ( container->cff_field_handlers )
FT_Destroy_Class_cff_field_handlers(
library, container->cff_field_handlers );
container->cff_field_handlers = NULL;
FT_FREE( container );
pic_container->cff = NULL;
}
}
FT_Error
cff_driver_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
CffModulePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->cff = container;
/* initialize pointer table - */
/* this is how the module usually expects this data */
error = FT_Create_Class_cff_services( library,
&container->cff_services );
if ( error )
goto Exit;
error = FT_Create_Class_cff_field_handlers(
library, &container->cff_field_handlers );
if ( error )
goto Exit;
FT_Init_Class_cff_service_ps_info(
library, &container->cff_service_ps_info );
FT_Init_Class_cff_service_glyph_dict(
library, &container->cff_service_glyph_dict );
FT_Init_Class_cff_service_ps_name(
library, &container->cff_service_ps_name );
FT_Init_Class_cff_service_get_cmap_info(
library, &container->cff_service_get_cmap_info );
FT_Init_Class_cff_service_cid_info(
library, &container->cff_service_cid_info );
FT_Init_Class_cff_cmap_encoding_class_rec(
library, &container->cff_cmap_encoding_class_rec );
FT_Init_Class_cff_cmap_unicode_class_rec(
library, &container->cff_cmap_unicode_class_rec );
Exit:
if ( error )
cff_driver_class_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,121 +0,0 @@
/***************************************************************************/
/* */
/* cffpic.h */
/* */
/* The FreeType position independent code services for cff module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef CFFPIC_H_
#define CFFPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define CFF_SERVICE_PS_INFO_GET cff_service_ps_info
#define CFF_SERVICE_GLYPH_DICT_GET cff_service_glyph_dict
#define CFF_SERVICE_PS_NAME_GET cff_service_ps_name
#define CFF_SERVICE_GET_CMAP_INFO_GET cff_service_get_cmap_info
#define CFF_SERVICE_CID_INFO_GET cff_service_cid_info
#define CFF_SERVICE_PROPERTIES_GET cff_service_properties
#define CFF_SERVICES_GET cff_services
#define CFF_SERVICE_MULTI_MASTERS_GET cff_service_multi_masters
#define CFF_SERVICE_METRICS_VAR_GET cff_service_metrics_variations
#define CFF_SERVICE_CFF_LOAD_GET cff_service_cff_load
#define CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec
#define CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec
#define CFF_FIELD_HANDLERS_GET cff_field_handlers
#else /* FT_CONFIG_OPTION_PIC */
#include FT_SERVICE_GLYPH_DICT_H
#include "cffparse.h"
#include FT_SERVICE_POSTSCRIPT_INFO_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_TT_CMAP_H
#include FT_SERVICE_CID_H
#include FT_SERVICE_PROPERTIES_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_METRICS_VARIATIONS_H
FT_BEGIN_HEADER
typedef struct CffModulePIC_
{
FT_ServiceDescRec* cff_services;
CFF_Field_Handler* cff_field_handlers;
FT_Service_PsInfoRec cff_service_ps_info;
FT_Service_GlyphDictRec cff_service_glyph_dict;
FT_Service_PsFontNameRec cff_service_ps_name;
FT_Service_TTCMapsRec cff_service_get_cmap_info;
FT_Service_CIDRec cff_service_cid_info;
FT_Service_PropertiesRec cff_service_properties;
FT_Service_MultiMastersRec cff_service_multi_masters;
FT_Service_MetricsVariationsRec cff_service_metrics_variations;
FT_Service_CFFLoadRec cff_service_cff_load;
FT_CMap_ClassRec cff_cmap_encoding_class_rec;
FT_CMap_ClassRec cff_cmap_unicode_class_rec;
} CffModulePIC;
#define GET_PIC( lib ) \
( (CffModulePIC*)( (lib)->pic_container.cff ) )
#define CFF_SERVICE_PS_INFO_GET \
( GET_PIC( library )->cff_service_ps_info )
#define CFF_SERVICE_GLYPH_DICT_GET \
( GET_PIC( library )->cff_service_glyph_dict )
#define CFF_SERVICE_PS_NAME_GET \
( GET_PIC( library )->cff_service_ps_name )
#define CFF_SERVICE_GET_CMAP_INFO_GET \
( GET_PIC( library )->cff_service_get_cmap_info )
#define CFF_SERVICE_CID_INFO_GET \
( GET_PIC( library )->cff_service_cid_info )
#define CFF_SERVICE_PROPERTIES_GET \
( GET_PIC( library )->cff_service_properties )
#define CFF_SERVICES_GET \
( GET_PIC( library )->cff_services )
#define CFF_SERVICE_MULTI_MASTERS_GET \
( GET_PIC( library )->cff_service_multi_masters )
#define CFF_SERVICE_METRICS_VAR_GET \
( GET_PIC( library )->cff_service_metrics_variations )
#define CFF_SERVICE_CFF_LOAD_GET \
( GET_PIC( library )->cff_service_cff_load )
#define CFF_CMAP_ENCODING_CLASS_REC_GET \
( GET_PIC( library )->cff_cmap_encoding_class_rec )
#define CFF_CMAP_UNICODE_CLASS_REC_GET \
( GET_PIC( library )->cff_cmap_unicode_class_rec )
#define CFF_FIELD_HANDLERS_GET \
( GET_PIC( library )->cff_field_handlers )
/* see cffpic.c for the implementation */
void
cff_driver_class_pic_free( FT_Library library );
FT_Error
cff_driver_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* CFFPIC_H_ */
/* END */

View File

@ -31,8 +31,7 @@ CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c \
$(CFF_DIR)/cffgload.c \
$(CFF_DIR)/cffload.c \
$(CFF_DIR)/cffobjs.c \
$(CFF_DIR)/cffparse.c \
$(CFF_DIR)/cffpic.c
$(CFF_DIR)/cffparse.c
# CFF driver headers

View File

@ -26,15 +26,9 @@
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_CALLBACK_TABLE
const FT_Driver_ClassRec t1cid_driver_class;
FT_END_HEADER
#endif /* CIDRIVER_H_ */

View File

@ -35,10 +35,6 @@
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_EXPORT_VAR( const FT_Module_Class ) gxv_module_class;

View File

@ -41,10 +41,6 @@
#ifdef FT_CONFIG_OPTION_USE_ZLIB
#ifdef FT_CONFIG_OPTION_PIC
#error "gzip code does not support PIC yet"
#endif
#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
#include <zlib.h>

View File

@ -42,10 +42,6 @@
#ifdef FT_CONFIG_OPTION_USE_LZW
#ifdef FT_CONFIG_OPTION_PIC
#error "lzw code does not support PIC yet"
#endif
#include "ftzopen.h"

View File

@ -27,10 +27,6 @@
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class;

View File

@ -31,11 +31,8 @@ THE SOFTWARE.
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_BEGIN_HEADER
FT_EXPORT_VAR( const FT_Driver_ClassRec ) pcf_driver_class;

View File

@ -26,14 +26,8 @@
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class;
FT_END_HEADER

View File

@ -28,10 +28,6 @@
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_CALLBACK_TABLE
const CFF_Builder_FuncsRec cff_builder_funcs;

View File

@ -22,7 +22,6 @@
#include "pshalgo.c"
#include "pshglob.c"
#include "pshmod.c"
#include "pshpic.c"
#include "pshrec.c"

View File

@ -20,7 +20,6 @@
#include FT_INTERNAL_OBJECTS_H
#include "pshrec.h"
#include "pshalgo.h"
#include "pshpic.h"
/* the Postscript Hinter module structure */
@ -111,7 +110,7 @@
0x10000L,
0x20000L,
&PSHINTER_INTERFACE_GET, /* module-specific interface */
&pshinter_interface, /* module-specific interface */
(FT_Module_Constructor)ps_hinter_init, /* module_init */
(FT_Module_Destructor) ps_hinter_done, /* module_done */

View File

@ -1,76 +0,0 @@
/***************************************************************************/
/* */
/* pshpic.c */
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "pshpic.h"
#include "pshnterr.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from pshmod.c */
void
FT_Init_Class_pshinter_interface( FT_Library library,
PSHinter_Interface* clazz );
void
pshinter_module_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->pshinter )
{
FT_FREE( pic_container->pshinter );
pic_container->pshinter = NULL;
}
}
FT_Error
pshinter_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
PSHinterPIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->pshinter = container;
/* add call to initialization function when you add new scripts */
FT_Init_Class_pshinter_interface(
library, &container->pshinter_interface );
if ( error )
pshinter_module_class_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,63 +0,0 @@
/***************************************************************************/
/* */
/* pshpic.h */
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef PSHPIC_H_
#define PSHPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define PSHINTER_INTERFACE_GET pshinter_interface
#else /* FT_CONFIG_OPTION_PIC */
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
FT_BEGIN_HEADER
typedef struct PSHinterPIC_
{
PSHinter_Interface pshinter_interface;
} PSHinterPIC;
#define GET_PIC( lib ) ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )
#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface )
/* see pshpic.c for the implementation */
void
pshinter_module_class_pic_free( FT_Library library );
FT_Error
pshinter_module_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* PSHPIC_H_ */
/* END */

View File

@ -31,7 +31,6 @@ PSHINTER_COMPILE := $(CC) $(ANSIFLAGS) \
PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \
$(PSHINTER_DIR)/pshglob.c \
$(PSHINTER_DIR)/pshmod.c \
$(PSHINTER_DIR)/pshpic.c \
$(PSHINTER_DIR)/pshrec.c

View File

@ -41,7 +41,6 @@
#include "pstables.h"
#include "psnamerr.h"
#include "pspic.h"
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@ -577,28 +576,16 @@
FT_DEFINE_SERVICEDESCREC1(
pscmaps_services,
FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET )
FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface )
static FT_Pointer
psnames_get_service( FT_Module module,
const char* service_id )
{
/* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
if ( !module )
return NULL;
library = module->library;
if ( !library )
return NULL;
#else
FT_UNUSED( module );
#endif
return ft_service_list_lookup( PSCMAPS_SERVICES_GET, service_id );
return ft_service_list_lookup( pscmaps_services, service_id );
}
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
@ -621,7 +608,7 @@
0x20000L, /* driver requires FreeType 2 or above */
PUT_PS_NAMES_SERVICE(
(void*)&PSCMAPS_INTERFACE_GET ), /* module specific interface */
(void*)&pscmaps_interface ), /* module specific interface */
(FT_Module_Constructor)NULL, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */

View File

@ -20,7 +20,6 @@
#include <ft2build.h>
#include "psmodule.c"
#include "pspic.c"
/* END */

View File

@ -1,97 +0,0 @@
/***************************************************************************/
/* */
/* pspic.c */
/* */
/* The FreeType position independent code services for psnames module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "pspic.h"
#include "psnamerr.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from psmodule.c */
FT_Error
FT_Create_Class_pscmaps_services( FT_Library library,
FT_ServiceDescRec** output_class );
void
FT_Destroy_Class_pscmaps_services( FT_Library library,
FT_ServiceDescRec* clazz );
void
FT_Init_Class_pscmaps_interface( FT_Library library,
FT_Service_PsCMapsRec* clazz );
void
psnames_module_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->psnames )
{
PSModulePIC* container = (PSModulePIC*)pic_container->psnames;
if ( container->pscmaps_services )
FT_Destroy_Class_pscmaps_services( library,
container->pscmaps_services );
container->pscmaps_services = NULL;
FT_FREE( container );
pic_container->psnames = NULL;
}
}
FT_Error
psnames_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
PSModulePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->psnames = container;
/* initialize pointer table - */
/* this is how the module usually expects this data */
error = FT_Create_Class_pscmaps_services(
library, &container->pscmaps_services );
if ( error )
goto Exit;
FT_Init_Class_pscmaps_interface( library,
&container->pscmaps_interface );
Exit:
if ( error )
psnames_module_class_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,68 +0,0 @@
/***************************************************************************/
/* */
/* pspic.h */
/* */
/* The FreeType position independent code services for psnames module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef PSPIC_H_
#define PSPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define PSCMAPS_SERVICES_GET pscmaps_services
#define PSCMAPS_INTERFACE_GET pscmaps_interface
#else /* FT_CONFIG_OPTION_PIC */
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER
typedef struct PSModulePIC_
{
FT_ServiceDescRec* pscmaps_services;
FT_Service_PsCMapsRec pscmaps_interface;
} PSModulePIC;
#define GET_PIC( lib ) \
( (PSModulePIC*)((lib)->pic_container.psnames) )
#define PSCMAPS_SERVICES_GET ( GET_PIC( library )->pscmaps_services )
#define PSCMAPS_INTERFACE_GET ( GET_PIC( library )->pscmaps_interface )
/* see pspic.c for the implementation */
void
psnames_module_class_pic_free( FT_Library library );
FT_Error
psnames_module_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* PSPIC_H_ */
/* END */

View File

@ -28,8 +28,7 @@ PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
# PSNames driver sources (i.e., C files)
#
PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c \
$(PSNAMES_DIR)/pspic.c
PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
# PSNames driver headers

View File

@ -66,8 +66,6 @@
#include "ftraster.h"
#include FT_INTERNAL_CALC_H /* for FT_MulDiv and FT_MulDiv_No_Round */
#include "rastpic.h"
#endif /* !STANDALONE_ */

View File

@ -22,7 +22,6 @@
#include FT_OUTLINE_H
#include "ftrend1.h"
#include "ftraster.h"
#include "rastpic.h"
#include "rasterrs.h"
@ -197,7 +196,7 @@
(FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_raster1_set_mode, /* set_mode */
(FT_Raster_Funcs*)&FT_STANDARD_RASTER_GET /* raster_class */
(FT_Raster_Funcs*)&ft_standard_raster /* raster_class */
)

View File

@ -21,7 +21,6 @@
#include "ftraster.c"
#include "ftrend1.c"
#include "rastpic.c"
/* END */

View File

@ -1,89 +0,0 @@
/***************************************************************************/
/* */
/* rastpic.c */
/* */
/* The FreeType position independent code services for raster module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "rastpic.h"
#include "rasterrs.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from ftraster.c */
void
FT_Init_Class_ft_standard_raster( FT_Raster_Funcs* funcs );
void
ft_raster1_renderer_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->raster )
{
RasterPIC* container = (RasterPIC*)pic_container->raster;
if ( --container->ref_count )
return;
FT_FREE( container );
pic_container->raster = NULL;
}
}
FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
RasterPIC* container = NULL;
FT_Memory memory = library->memory;
/* XXX: since this function also served the no longer available */
/* raster5 renderer it uses reference counting, which could */
/* be removed now */
if ( pic_container->raster )
{
((RasterPIC*)pic_container->raster)->ref_count++;
return error;
}
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->raster = container;
container->ref_count = 1;
/* initialize pointer table - */
/* this is how the module usually expects this data */
FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,63 +0,0 @@
/***************************************************************************/
/* */
/* rastpic.h */
/* */
/* The FreeType position independent code services for raster module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef RASTPIC_H_
#define RASTPIC_H_
#include FT_INTERNAL_PIC_H
FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC
#define FT_STANDARD_RASTER_GET ft_standard_raster
#else /* FT_CONFIG_OPTION_PIC */
typedef struct RasterPIC_
{
int ref_count;
FT_Raster_Funcs ft_standard_raster;
} RasterPIC;
#define GET_PIC( lib ) \
( (RasterPIC*)( (lib)->pic_container.raster ) )
#define FT_STANDARD_RASTER_GET ( GET_PIC( library )->ft_standard_raster )
/* see rastpic.c for the implementation */
void
ft_raster1_renderer_class_pic_free( FT_Library library );
FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* RASTPIC_H_ */
/* END */

View File

@ -28,8 +28,7 @@ RASTER_COMPILE := $(CC) $(ANSIFLAGS) \
# raster driver sources (i.e., C files)
#
RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
$(RASTER_DIR)/ftrend1.c \
$(RASTER_DIR)/rastpic.c
$(RASTER_DIR)/ftrend1.c
# raster driver headers

View File

@ -37,7 +37,6 @@ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \
$(SFNT_DIR)/ttbdf.c \
$(SFNT_DIR)/sfobjs.c \
$(SFNT_DIR)/sfdriver.c \
$(SFNT_DIR)/sfntpic.c \
$(SFNT_DIR)/pngshim.c
# SFNT driver headers

View File

@ -25,7 +25,6 @@
#include "sfdriver.h"
#include "ttload.h"
#include "sfobjs.h"
#include "sfntpic.h"
#include "sferrors.h"
@ -1139,34 +1138,34 @@
FT_DEFINE_SERVICEDESCREC5(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_BDF, &SFNT_SERVICE_BDF_GET,
FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
FT_SERVICE_ID_BDF, &sfnt_service_bdf,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_BDF, &SFNT_SERVICE_BDF_GET,
FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_BDF, &sfnt_service_bdf,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#else
FT_DEFINE_SERVICEDESCREC3(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#endif
@ -1174,21 +1173,9 @@
sfnt_get_interface( FT_Module module,
const char* module_interface )
{
/* SFNT_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
if ( !module )
return NULL;
library = module->library;
if ( !library )
return NULL;
#else
FT_UNUSED( module );
#endif
return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );
return ft_service_list_lookup( sfnt_services, module_interface );
}
@ -1277,7 +1264,7 @@
0x10000L, /* driver version 1.0 */
0x20000L, /* driver requires FreeType 2.0 or higher */
(const void*)&SFNT_INTERFACE_GET, /* module specific interface */
(const void*)&sfnt_interface, /* module specific interface */
(FT_Module_Constructor)NULL, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */

View File

@ -26,10 +26,8 @@
FT_BEGIN_HEADER
FT_DECLARE_MODULE( sfnt_module_class )
FT_END_HEADER
#endif /* SFDRIVER_H_ */

View File

@ -21,7 +21,6 @@
#include "pngshim.c"
#include "sfdriver.c"
#include "sfntpic.c"
#include "sfobjs.c"
#include "ttbdf.c"
#include "ttcmap.c"

View File

@ -1,143 +0,0 @@
/***************************************************************************/
/* */
/* sfntpic.c */
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "sfntpic.h"
#include "sferrors.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from sfdriver.c */
FT_Error
FT_Create_Class_sfnt_services( FT_Library library,
FT_ServiceDescRec** output_class );
void
FT_Destroy_Class_sfnt_services( FT_Library library,
FT_ServiceDescRec* clazz );
void
FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec* clazz );
void
FT_Init_Class_sfnt_interface( FT_Library library,
SFNT_Interface* clazz );
void
FT_Init_Class_sfnt_service_glyph_dict(
FT_Library library,
FT_Service_GlyphDictRec* clazz );
void
FT_Init_Class_sfnt_service_ps_name(
FT_Library library,
FT_Service_PsFontNameRec* clazz );
void
FT_Init_Class_tt_service_get_cmap_info(
FT_Library library,
FT_Service_TTCMapsRec* clazz );
void
FT_Init_Class_sfnt_service_sfnt_table(
FT_Service_SFNT_TableRec* clazz );
/* forward declaration of PIC init functions from ttcmap.c */
FT_Error
FT_Create_Class_tt_cmap_classes( FT_Library library,
TT_CMap_Class** output_class );
void
FT_Destroy_Class_tt_cmap_classes( FT_Library library,
TT_CMap_Class* clazz );
void
sfnt_module_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->sfnt )
{
sfntModulePIC* container = (sfntModulePIC*)pic_container->sfnt;
if ( container->sfnt_services )
FT_Destroy_Class_sfnt_services( library,
container->sfnt_services );
container->sfnt_services = NULL;
if ( container->tt_cmap_classes )
FT_Destroy_Class_tt_cmap_classes( library,
container->tt_cmap_classes );
container->tt_cmap_classes = NULL;
FT_FREE( container );
pic_container->sfnt = NULL;
}
}
FT_Error
sfnt_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
sfntModulePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->sfnt = container;
/* initialize pointer table - */
/* this is how the module usually expects this data */
error = FT_Create_Class_sfnt_services( library,
&container->sfnt_services );
if ( error )
goto Exit;
error = FT_Create_Class_tt_cmap_classes( library,
&container->tt_cmap_classes );
if ( error )
goto Exit;
FT_Init_Class_sfnt_service_glyph_dict(
library, &container->sfnt_service_glyph_dict );
FT_Init_Class_sfnt_service_ps_name(
library, &container->sfnt_service_ps_name );
FT_Init_Class_tt_service_get_cmap_info(
library, &container->tt_service_get_cmap_info );
FT_Init_Class_sfnt_service_sfnt_table(
&container->sfnt_service_sfnt_table );
#ifdef TT_CONFIG_OPTION_BDF
FT_Init_Class_sfnt_service_bdf( &container->sfnt_service_bdf );
#endif
FT_Init_Class_sfnt_interface( library, &container->sfnt_interface );
Exit:
if ( error )
sfnt_module_class_pic_free( library );
return error;
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,112 +0,0 @@
/***************************************************************************/
/* */
/* sfntpic.h */
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef SFNTPIC_H_
#define SFNTPIC_H_
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
#define SFNT_SERVICES_GET sfnt_services
#define SFNT_SERVICE_GLYPH_DICT_GET sfnt_service_glyph_dict
#define SFNT_SERVICE_PS_NAME_GET sfnt_service_ps_name
#define TT_SERVICE_CMAP_INFO_GET tt_service_get_cmap_info
#define TT_CMAP_CLASSES_GET tt_cmap_classes
#define SFNT_SERVICE_SFNT_TABLE_GET sfnt_service_sfnt_table
#define SFNT_SERVICE_BDF_GET sfnt_service_bdf
#define SFNT_INTERFACE_GET sfnt_interface
#else /* FT_CONFIG_OPTION_PIC */
/* some include files required for members of sfntModulePIC */
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_SFNT_H
#include FT_SERVICE_TT_CMAP_H
#ifdef TT_CONFIG_OPTION_BDF
#include "ttbdf.h"
#include FT_SERVICE_BDF_H
#endif
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include "ttcmap.h"
FT_BEGIN_HEADER
typedef struct sfntModulePIC_
{
FT_ServiceDescRec* sfnt_services;
FT_Service_GlyphDictRec sfnt_service_glyph_dict;
FT_Service_PsFontNameRec sfnt_service_ps_name;
FT_Service_TTCMapsRec tt_service_get_cmap_info;
TT_CMap_Class* tt_cmap_classes;
FT_Service_SFNT_TableRec sfnt_service_sfnt_table;
#ifdef TT_CONFIG_OPTION_BDF
FT_Service_BDFRec sfnt_service_bdf;
#endif
SFNT_Interface sfnt_interface;
} sfntModulePIC;
#define GET_PIC( lib ) \
( (sfntModulePIC*)( (lib)->pic_container.sfnt ) )
#define SFNT_SERVICES_GET \
( GET_PIC( library )->sfnt_services )
#define SFNT_SERVICE_GLYPH_DICT_GET \
( GET_PIC( library )->sfnt_service_glyph_dict )
#define SFNT_SERVICE_PS_NAME_GET \
( GET_PIC( library )->sfnt_service_ps_name )
#define TT_SERVICE_CMAP_INFO_GET \
( GET_PIC( library )->tt_service_get_cmap_info )
#define TT_CMAP_CLASSES_GET \
( GET_PIC( library )->tt_cmap_classes )
#define SFNT_SERVICE_SFNT_TABLE_GET \
( GET_PIC( library )->sfnt_service_sfnt_table )
#define SFNT_SERVICE_BDF_GET \
( GET_PIC( library )->sfnt_service_bdf )
#define SFNT_INTERFACE_GET \
( GET_PIC( library )->sfnt_interface )
/* see sfntpic.c for the implementation */
void
sfnt_module_class_pic_free( FT_Library library );
FT_Error
sfnt_module_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* SFNTPIC_H_ */
/* END */

View File

@ -27,7 +27,6 @@
#include "ttload.h"
#include "ttcmap.h"
#include "ttpost.h"
#include "sfntpic.h"
/*************************************************************************/
@ -3749,7 +3748,6 @@
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
#ifndef FT_CONFIG_OPTION_PIC
static const TT_CMap_Class tt_cmap_classes[] =
{
@ -3758,61 +3756,6 @@
NULL,
};
#else /*FT_CONFIG_OPTION_PIC*/
void
FT_Destroy_Class_tt_cmap_classes( FT_Library library,
TT_CMap_Class* clazz )
{
FT_Memory memory = library->memory;
if ( clazz )
FT_FREE( clazz );
}
FT_Error
FT_Create_Class_tt_cmap_classes( FT_Library library,
TT_CMap_Class** output_class )
{
TT_CMap_Class* clazz = NULL;
TT_CMap_ClassRec* recs;
FT_Error error;
FT_Memory memory = library->memory;
int i = 0;
#define TTCMAPCITEM( a ) i++;
#include "ttcmapc.h"
/* allocate enough space for both the pointers */
/* plus terminator and the class instances */
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * ( i + 1 ) +
sizeof ( TT_CMap_ClassRec ) * i ) )
return error;
/* the location of the class instances follows the array of pointers */
recs = (TT_CMap_ClassRec*)( (char*)clazz +
sizeof ( *clazz ) * ( i + 1 ) );
i = 0;
#undef TTCMAPCITEM
#define TTCMAPCITEM( a ) \
FT_Init_Class_ ## a( &recs[i] ); \
clazz[i] = &recs[i]; \
i++;
#include "ttcmapc.h"
clazz[i] = NULL;
*output_class = clazz;
return FT_Err_Ok;
}
#endif /*FT_CONFIG_OPTION_PIC*/
/* parse the `cmap' table and build the corresponding TT_CMap objects */
/* in the current face */
@ -3859,7 +3802,7 @@
{
FT_Byte* volatile cmap = table + offset;
volatile FT_UInt format = TT_PEEK_USHORT( cmap );
const TT_CMap_Class* volatile pclazz = TT_CMAP_CLASSES_GET;
const TT_CMap_Class* volatile pclazz = tt_cmap_classes;
TT_CMap_Class volatile clazz;

View File

@ -56,8 +56,6 @@ FT_BEGIN_HEADER
} TT_CMap_ClassRec;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_TT_CMAP( class_, \
size_, \
init_, \
@ -92,42 +90,6 @@ FT_BEGIN_HEADER
get_cmap_info_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_TT_CMAP( class_, \
size_, \
init_, \
done_, \
char_index_, \
char_next_, \
char_var_index_, \
char_var_default_, \
variant_list_, \
charvariant_list_, \
variantchar_list_, \
format_, \
validate_, \
get_cmap_info_ ) \
void \
FT_Init_Class_ ## class_( TT_CMap_ClassRec* clazz ) \
{ \
clazz->clazz.size = size_; \
clazz->clazz.init = init_; \
clazz->clazz.done = done_; \
clazz->clazz.char_index = char_index_; \
clazz->clazz.char_next = char_next_; \
clazz->clazz.char_var_index = char_var_index_; \
clazz->clazz.char_var_default = char_var_default_; \
clazz->clazz.variant_list = variant_list_; \
clazz->clazz.charvariant_list = charvariant_list_; \
clazz->clazz.variantchar_list = variantchar_list_; \
clazz->format = format_; \
clazz->validate = validate_; \
clazz->get_cmap_info = get_cmap_info_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
typedef struct TT_ValidatorRec_
{

View File

@ -279,8 +279,6 @@ typedef ptrdiff_t FT_PtrDist;
#include "ftsmerrs.h"
#include "ftspic.h"
#define Smooth_Err_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
#define Smooth_Err_Memory_Overflow Smooth_Err_Out_Of_Memory
#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory
@ -1704,13 +1702,8 @@ typedef ptrdiff_t FT_PtrDist;
static int
gray_convert_glyph_inner( RAS_ARG )
{
volatile int error = 0;
#ifdef FT_CONFIG_OPTION_PIC
FT_Outline_Funcs func_interface;
Init_Class_func_interface(&func_interface);
#endif
if ( ft_setjmp( ras.jump_buffer ) == 0 )
{

View File

@ -28,7 +28,6 @@
#include "ftimage.h"
#else
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */
#include FT_IMAGE_H
#endif

View File

@ -22,7 +22,6 @@
#include FT_OUTLINE_H
#include "ftsmooth.h"
#include "ftgrays.h"
#include "ftspic.h"
#include "ftsmerrs.h"
@ -403,7 +402,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
(FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
(FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)
@ -430,7 +429,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
(FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
(FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)
@ -457,7 +456,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
(FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
(FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)

View File

@ -1,118 +0,0 @@
/***************************************************************************/
/* */
/* ftspic.c */
/* */
/* The FreeType position independent code services for smooth module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
#include "ftspic.h"
#include "ftsmerrs.h"
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from ftgrays.c */
void
FT_Init_Class_ft_grays_raster( FT_Raster_Funcs* funcs );
void
ft_smooth_renderer_class_pic_free( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Memory memory = library->memory;
if ( pic_container->smooth )
{
SmoothPIC* container = (SmoothPIC*)pic_container->smooth;
if ( --container->ref_count )
return;
FT_FREE( container );
pic_container->smooth = NULL;
}
}
FT_Error
ft_smooth_renderer_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
SmoothPIC* container = NULL;
FT_Memory memory = library->memory;
/* since this function also serve smooth_lcd and smooth_lcdv renderers,
it implements reference counting */
if ( pic_container->smooth )
{
((SmoothPIC*)pic_container->smooth)->ref_count++;
return error;
}
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->smooth = container;
container->ref_count = 1;
/* initialize pointer table - */
/* this is how the module usually expects this data */
FT_Init_Class_ft_grays_raster( &container->ft_grays_raster );
return error;
}
/* re-route these init and free functions to the above functions */
FT_Error
ft_smooth_lcd_renderer_class_pic_init( FT_Library library )
{
return ft_smooth_renderer_class_pic_init( library );
}
void
ft_smooth_lcd_renderer_class_pic_free( FT_Library library )
{
ft_smooth_renderer_class_pic_free( library );
}
FT_Error
ft_smooth_lcdv_renderer_class_pic_init( FT_Library library )
{
return ft_smooth_renderer_class_pic_init( library );
}
void
ft_smooth_lcdv_renderer_class_pic_free( FT_Library library )
{
ft_smooth_renderer_class_pic_free( library );
}
#endif /* FT_CONFIG_OPTION_PIC */
/* END */

View File

@ -1,75 +0,0 @@
/***************************************************************************/
/* */
/* ftspic.h */
/* */
/* The FreeType position independent code services for smooth module. */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTSPIC_H_
#define FTSPIC_H_
#include FT_INTERNAL_PIC_H
FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC
#define FT_GRAYS_RASTER_GET ft_grays_raster
#else /* FT_CONFIG_OPTION_PIC */
typedef struct SmoothPIC_
{
int ref_count;
FT_Raster_Funcs ft_grays_raster;
} SmoothPIC;
#define GET_PIC( lib ) \
( (SmoothPIC*)( (lib)->pic_container.smooth ) )
#define FT_GRAYS_RASTER_GET ( GET_PIC( library )->ft_grays_raster )
/* see ftspic.c for the implementation */
void
ft_smooth_renderer_class_pic_free( FT_Library library );
void
ft_smooth_lcd_renderer_class_pic_free( FT_Library library );
void
ft_smooth_lcdv_renderer_class_pic_free( FT_Library library );
FT_Error
ft_smooth_renderer_class_pic_init( FT_Library library );
FT_Error
ft_smooth_lcd_renderer_class_pic_init( FT_Library library );
FT_Error
ft_smooth_lcdv_renderer_class_pic_init( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* FTSPIC_H_ */
/* END */

View File

@ -29,8 +29,7 @@ SMOOTH_COMPILE := $(CC) $(ANSIFLAGS) \
# smooth driver sources (i.e., C files)
#
SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \
$(SMOOTH_DIR)/ftsmooth.c \
$(SMOOTH_DIR)/ftspic.c
$(SMOOTH_DIR)/ftsmooth.c
# smooth driver headers

View File

@ -21,7 +21,6 @@
#include "ftgrays.c"
#include "ftsmooth.c"
#include "ftspic.c"
/* END */

View File

@ -33,7 +33,6 @@ TT_DRV_SRC := $(TT_DIR)/ttdriver.c \
$(TT_DIR)/ttgxvar.c \
$(TT_DIR)/ttinterp.c \
$(TT_DIR)/ttobjs.c \
$(TT_DIR)/ttpic.c \
$(TT_DIR)/ttpload.c \
$(TT_DIR)/ttsubpix.c

View File

@ -24,7 +24,6 @@
#include "ttgxvar.c" /* gx distortable font */
#include "ttinterp.c"
#include "ttobjs.c" /* object manager */
#include "ttpic.c"
#include "ttpload.c" /* tables loader */
#include "ttsubpix.c"

View File

@ -43,7 +43,6 @@
#include "tterrors.h"
#include "ttpic.h"
/*************************************************************************/
/* */
@ -548,19 +547,19 @@
tt_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
FT_SERVICE_ID_METRICS_VARIATIONS, &TT_SERVICE_METRICS_VARIATIONS_GET,
FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters,
FT_SERVICE_ID_METRICS_VARIATIONS, &tt_service_metrics_variations,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf,
FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
#else
FT_DEFINE_SERVICEDESCREC4(
tt_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf,
FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
#endif
@ -574,26 +573,15 @@
SFNT_Service sfnt;
/* TT_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
result = ft_service_list_lookup( tt_services, tt_interface );
if ( result )
return result;
#ifndef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
/* only return the default interface from the SFNT module */
sfntd = FT_Get_Module( library, "sfnt" );

Some files were not shown because too many files have changed in this diff Show More