zenilib: zenilib/jni/external/freetype2/src/pshinter/pshmod.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pshmod.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* pshmod.c */
4 /* */
5 /* FreeType PostScript hinter module implementation (body). */
6 /* */
7 /* Copyright 2001, 2002, 2007 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
15 /* */
16 /***************************************************************************/
17
18
19 #include <ft2build.h>
20 #include FT_INTERNAL_OBJECTS_H
21 #include "pshrec.h"
22 #include "pshalgo.h"
23 #include "pshpic.h"
24
25
26 /* the Postscript Hinter module structure */
27 typedef struct PS_Hinter_Module_Rec_
28 {
29 FT_ModuleRec root;
30 PS_HintsRec ps_hints;
31
32 PSH_Globals_FuncsRec globals_funcs;
33 T1_Hints_FuncsRec t1_funcs;
34 T2_Hints_FuncsRec t2_funcs;
35
36 } PS_Hinter_ModuleRec, *PS_Hinter_Module;
37
38
39 /* finalize module */
40 FT_CALLBACK_DEF( void )
41 ps_hinter_done( PS_Hinter_Module module )
42 {
43 module->t1_funcs.hints = NULL;
44 module->t2_funcs.hints = NULL;
45
46 ps_hints_done( &module->ps_hints );
47 }
48
49
50 /* initialize module, create hints recorder and the interface */
51 FT_CALLBACK_DEF( FT_Error )
52 ps_hinter_init( PS_Hinter_Module module )
53 {
54 FT_Memory memory = module->root.memory;
55 void* ph = &module->ps_hints;
56
57
58 ps_hints_init( &module->ps_hints, memory );
59
60 psh_globals_funcs_init( &module->globals_funcs );
61
62 t1_hints_funcs_init( &module->t1_funcs );
63 module->t1_funcs.hints = (T1_Hints)ph;
64
65 t2_hints_funcs_init( &module->t2_funcs );
66 module->t2_funcs.hints = (T2_Hints)ph;
67
68 return 0;
69 }
70
71
72 /* returns global hints interface */
73 FT_CALLBACK_DEF( PSH_Globals_Funcs )
74 pshinter_get_globals_funcs( FT_Module module )
75 {
76 return &((PS_Hinter_Module)module)->globals_funcs;
77 }
78
79
80 /* return Type 1 hints interface */
81 FT_CALLBACK_DEF( T1_Hints_Funcs )
82 pshinter_get_t1_funcs( FT_Module module )
83 {
84 return &((PS_Hinter_Module)module)->t1_funcs;
85 }
86
87
88 /* return Type 2 hints interface */
89 FT_CALLBACK_DEF( T2_Hints_Funcs )
90 pshinter_get_t2_funcs( FT_Module module )
91 {
92 return &((PS_Hinter_Module)module)->t2_funcs;
93 }
94
95
96 FT_DEFINE_PSHINTER_INTERFACE(pshinter_interface,
97 pshinter_get_globals_funcs,
98 pshinter_get_t1_funcs,
99 pshinter_get_t2_funcs
100 )
101
102
103 FT_DEFINE_MODULE(pshinter_module_class,
104
105 0,
106 sizeof ( PS_Hinter_ModuleRec ),
107 "pshinter",
108 0x10000L,
109 0x20000L,
110
111 &FTPSHINTER_INTERFACE_GET, /* module-specific interface */
112
113 (FT_Module_Constructor)ps_hinter_init,
114 (FT_Module_Destructor) ps_hinter_done,
115 (FT_Module_Requester) 0 /* no additional interface for now */
116 )
117
118 /* END */
FT_Error
int FT_Error
Definition: fttypes.h:296
T1_Hints_FuncsRec_
Definition: pshints.h:342
PS_HintsRec_
Definition: pshrec.h:131
pshinter_get_globals_funcs
pshinter_get_globals_funcs(FT_Module module)
Definition: pshmod.c:74
FT_ModuleRec_
Definition: ftobjs.h:439
T2_Hints
struct T2_HintsRec_ * T2_Hints
Definition: pshints.h:391
NULL
#define NULL
Definition: ftobjs.h:61
FTPSHINTER_INTERFACE_GET
#define FTPSHINTER_INTERFACE_GET
Definition: pshpic.h:29
FT_Module_Requester
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
Definition: ftmodapi.h:126
ps_hints_init
ps_hints_init(PS_Hints hints, FT_Memory memory)
Definition: pshrec.c:800
PS_Hinter_Module
struct PS_Hinter_Module_Rec_ * PS_Hinter_Module
ps_hints_done
ps_hints_done(PS_Hints hints)
Definition: pshrec.c:786
T2_Hints_FuncsRec_
Definition: pshints.h:656
FT_DEFINE_MODULE
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,interface_, init_, done_, get_interface_)
Definition: ftobjs.h:1317
FT_Module_Destructor
void(* FT_Module_Destructor)(FT_Module module)
Definition: ftmodapi.h:109
FT_DEFINE_PSHINTER_INTERFACE
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,get_t1_funcs_, get_t2_funcs_)
Definition: pshints.h:684
pshalgo.h
pshinter_get_t1_funcs
pshinter_get_t1_funcs(FT_Module module)
Definition: pshmod.c:82
FT_CALLBACK_DEF
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:554
T1_Hints
struct T1_HintsRec_ * T1_Hints
Definition: pshints.h:104
t2_hints_funcs_init
t2_hints_funcs_init(T2_Hints_FuncsRec *funcs)
Definition: pshrec.c:1211
FT_Memory
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
psh_globals_funcs_init
psh_globals_funcs_init(PSH_Globals_FuncsRec *funcs)
Definition: pshglob.c:742
sizeof
sizeof(FT_AutofitterRec)
FT_Module_Constructor
FT_Error(* FT_Module_Constructor)(FT_Module module)
Definition: ftmodapi.h:94
pshpic.h
t1_hints_funcs_init
t1_hints_funcs_init(T1_Hints_FuncsRec *funcs)
Definition: pshrec.c:1145
ft2build.h
PSH_Globals_FuncsRec_
Definition: pshints.h:59
ps_hinter_init
ps_hinter_init(PS_Hinter_Module module)
Definition: pshmod.c:52
ps_hinter_done
ps_hinter_done(PS_Hinter_Module module)
Definition: pshmod.c:41
pshrec.h
pshinter_get_t2_funcs
pshinter_get_t2_funcs(FT_Module module)
Definition: pshmod.c:90
PS_Hinter_ModuleRec
struct PS_Hinter_Module_Rec_ PS_Hinter_ModuleRec