1 /***************************************************************************/
2 /*                                                                         */
3 /*  psauxmod.c                                                             */
4 /*                                                                         */
5 /*    FreeType auxiliary PostScript module implementation (body).          */
6 /*                                                                         */
7 /*  Copyright 2000-2016 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 "psauxmod.h"
21 #include "psobjs.h"
22 #include "t1decode.h"
23 #include "t1cmap.h"
24 
25 #ifndef T1_CONFIG_OPTION_NO_AFM
26 #include "afmparse.h"
27 #endif
28 
29 
30   FT_CALLBACK_TABLE_DEF
31   const PS_Table_FuncsRec  ps_table_funcs =
32   {
33     ps_table_new,     /* init    */
34     ps_table_done,    /* done    */
35     ps_table_add,     /* add     */
36     ps_table_release  /* release */
37   };
38 
39 
40   FT_CALLBACK_TABLE_DEF
41   const PS_Parser_FuncsRec  ps_parser_funcs =
42   {
43     ps_parser_init,             /* init             */
44     ps_parser_done,             /* done             */
45 
46     ps_parser_skip_spaces,      /* skip_spaces      */
47     ps_parser_skip_PS_token,    /* skip_PS_token    */
48 
49     ps_parser_to_int,           /* to_int           */
50     ps_parser_to_fixed,         /* to_fixed         */
51     ps_parser_to_bytes,         /* to_bytes         */
52     ps_parser_to_coord_array,   /* to_coord_array   */
53     ps_parser_to_fixed_array,   /* to_fixed_array   */
54     ps_parser_to_token,         /* to_token         */
55     ps_parser_to_token_array,   /* to_token_array   */
56 
57     ps_parser_load_field,       /* load_field       */
58     ps_parser_load_field_table  /* load_field_table */
59   };
60 
61 
62   FT_CALLBACK_TABLE_DEF
63   const T1_Builder_FuncsRec  t1_builder_funcs =
64   {
65     t1_builder_init,          /* init */
66     t1_builder_done,          /* done */
67 
68     t1_builder_check_points,  /* check_points  */
69     t1_builder_add_point,     /* add_point     */
70     t1_builder_add_point1,    /* add_point1    */
71     t1_builder_add_contour,   /* add_contour   */
72     t1_builder_start_point,   /* start_point   */
73     t1_builder_close_contour  /* close_contour */
74   };
75 
76 
77   FT_CALLBACK_TABLE_DEF
78   const T1_Decoder_FuncsRec  t1_decoder_funcs =
79   {
80     t1_decoder_init,              /* init              */
81     t1_decoder_done,              /* done              */
82     t1_decoder_parse_charstrings  /* parse_charstrings */
83   };
84 
85 
86 #ifndef T1_CONFIG_OPTION_NO_AFM
87   FT_CALLBACK_TABLE_DEF
88   const AFM_Parser_FuncsRec  afm_parser_funcs =
89   {
90     afm_parser_init,  /* init  */
91     afm_parser_done,  /* done  */
92     afm_parser_parse  /* parse */
93   };
94 #endif
95 
96 
97   FT_CALLBACK_TABLE_DEF
98   const T1_CMap_ClassesRec  t1_cmap_classes =
99   {
100     &t1_cmap_standard_class_rec,
101     &t1_cmap_expert_class_rec,
102     &t1_cmap_custom_class_rec,
103     &t1_cmap_unicode_class_rec
104   };
105 
106 
107   static
108   const PSAux_Interface  psaux_interface =
109   {
110     &ps_table_funcs,
111     &ps_parser_funcs,
112     &t1_builder_funcs,
113     &t1_decoder_funcs,
114     t1_decrypt,
115 
116     (const T1_CMap_ClassesRec*) &t1_cmap_classes,
117 
118 #ifndef T1_CONFIG_OPTION_NO_AFM
119     &afm_parser_funcs,
120 #else
121     0,
122 #endif
123   };
124 
125 
126   FT_CALLBACK_TABLE_DEF
127   const FT_Module_Class  psaux_module_class =
128   {
129     0,
130     sizeof ( FT_ModuleRec ),
131     "psaux",
132     0x20000L,
133     0x20000L,
134 
135     &psaux_interface,  /* module-specific interface */
136 
137     (FT_Module_Constructor)NULL,  /* module_init   */
138     (FT_Module_Destructor) NULL,  /* module_done   */
139     (FT_Module_Requester)  NULL   /* get_interface */
140   };
141 
142 
143 /* END */
144