*/* [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.parthw-pk-vf
parent
86bc8a9505
commit
9514959241
106 changed files with 158 additions and 4322 deletions
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
@ -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 */ |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue