2001-10-18 13:38:43 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* pshmod.c */
|
|
|
|
/* */
|
2001-12-05 02:22:05 +01:00
|
|
|
/* FreeType PostScript hinter module implementation (body). */
|
2001-10-18 13:38:43 +02:00
|
|
|
/* */
|
2016-01-13 11:54:10 +01:00
|
|
|
/* Copyright 2001-2016 by */
|
2001-10-18 13:38:43 +02:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
#include "pshrec.h"
|
|
|
|
#include "pshalgo.h"
|
2009-04-05 17:20:16 +02:00
|
|
|
#include "pshpic.h"
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
/* the Postscript Hinter module structure */
|
|
|
|
typedef struct PS_Hinter_Module_Rec_
|
2001-10-18 13:38:43 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_ModuleRec root;
|
|
|
|
PS_HintsRec ps_hints;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
PSH_Globals_FuncsRec globals_funcs;
|
|
|
|
T1_Hints_FuncsRec t1_funcs;
|
|
|
|
T2_Hints_FuncsRec t2_funcs;
|
2001-10-19 11:17:49 +02:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
} PS_Hinter_ModuleRec, *PS_Hinter_Module;
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* finalize module */
|
|
|
|
FT_CALLBACK_DEF( void )
|
2001-10-18 13:38:43 +02:00
|
|
|
ps_hinter_done( PS_Hinter_Module module )
|
|
|
|
{
|
|
|
|
module->t1_funcs.hints = NULL;
|
|
|
|
module->t2_funcs.hints = NULL;
|
|
|
|
|
|
|
|
ps_hints_done( &module->ps_hints );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* initialize module, create hints recorder and the interface */
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
2001-10-18 13:38:43 +02:00
|
|
|
ps_hinter_init( PS_Hinter_Module module )
|
|
|
|
{
|
|
|
|
FT_Memory memory = module->root.memory;
|
2007-05-16 17:19:42 +02:00
|
|
|
void* ph = &module->ps_hints;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
ps_hints_init( &module->ps_hints, memory );
|
|
|
|
|
|
|
|
psh_globals_funcs_init( &module->globals_funcs );
|
|
|
|
|
|
|
|
t1_hints_funcs_init( &module->t1_funcs );
|
2007-05-16 17:19:42 +02:00
|
|
|
module->t1_funcs.hints = (T1_Hints)ph;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
t2_hints_funcs_init( &module->t2_funcs );
|
2007-05-16 17:19:42 +02:00
|
|
|
module->t2_funcs.hints = (T2_Hints)ph;
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* returns global hints interface */
|
|
|
|
FT_CALLBACK_DEF( PSH_Globals_Funcs )
|
2001-10-18 13:38:43 +02:00
|
|
|
pshinter_get_globals_funcs( FT_Module module )
|
|
|
|
{
|
|
|
|
return &((PS_Hinter_Module)module)->globals_funcs;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* return Type 1 hints interface */
|
|
|
|
FT_CALLBACK_DEF( T1_Hints_Funcs )
|
2001-10-18 13:38:43 +02:00
|
|
|
pshinter_get_t1_funcs( FT_Module module )
|
|
|
|
{
|
|
|
|
return &((PS_Hinter_Module)module)->t1_funcs;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
/* return Type 2 hints interface */
|
|
|
|
FT_CALLBACK_DEF( T2_Hints_Funcs )
|
2001-10-18 13:38:43 +02:00
|
|
|
pshinter_get_t2_funcs( FT_Module module )
|
|
|
|
{
|
|
|
|
return &((PS_Hinter_Module)module)->t2_funcs;
|
|
|
|
}
|
2001-10-19 11:17:49 +02:00
|
|
|
|
|
|
|
|
2012-08-27 06:01:46 +02:00
|
|
|
FT_DEFINE_PSHINTER_INTERFACE(
|
|
|
|
pshinter_interface,
|
2016-09-17 17:12:50 +02:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
pshinter_get_globals_funcs,
|
|
|
|
pshinter_get_t1_funcs,
|
2016-09-17 17:12:50 +02:00
|
|
|
pshinter_get_t2_funcs
|
|
|
|
)
|
2001-10-18 13:38:43 +02:00
|
|
|
|
|
|
|
|
2012-08-27 06:01:46 +02:00
|
|
|
FT_DEFINE_MODULE(
|
|
|
|
pshinter_module_class,
|
2009-04-05 17:20:16 +02:00
|
|
|
|
2001-10-18 13:38:43 +02:00
|
|
|
0,
|
2001-12-05 02:22:05 +01:00
|
|
|
sizeof ( PS_Hinter_ModuleRec ),
|
2001-10-18 13:38:43 +02:00
|
|
|
"pshinter",
|
|
|
|
0x10000L,
|
|
|
|
0x20000L,
|
|
|
|
|
2012-08-27 08:41:43 +02:00
|
|
|
&PSHINTER_INTERFACE_GET, /* module-specific interface */
|
2001-10-18 13:38:43 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
(FT_Module_Constructor)ps_hinter_init, /* module_init */
|
|
|
|
(FT_Module_Destructor) ps_hinter_done, /* module_done */
|
|
|
|
(FT_Module_Requester) NULL /* get_interface */
|
|
|
|
)
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
/* END */
|