1 /***************************************************************************/
2 /*                                                                         */
3 /*  cffpic.h                                                               */
4 /*                                                                         */
5 /*    The FreeType position independent code services for cff module.      */
6 /*                                                                         */
7 /*  Copyright 2009-2018 by                                                 */
8 /*  Oran Agra and Mickey Gabel.                                            */
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 #ifndef CFFPIC_H_
20 #define CFFPIC_H_
21 
22 
23 #include FT_INTERNAL_PIC_H
24 
25 #ifndef FT_CONFIG_OPTION_PIC
26 
27 #define CFF_SERVICE_PS_INFO_GET          cff_service_ps_info
28 #define CFF_SERVICE_GLYPH_DICT_GET       cff_service_glyph_dict
29 #define CFF_SERVICE_PS_NAME_GET          cff_service_ps_name
30 #define CFF_SERVICE_GET_CMAP_INFO_GET    cff_service_get_cmap_info
31 #define CFF_SERVICE_CID_INFO_GET         cff_service_cid_info
32 #define CFF_SERVICE_PROPERTIES_GET       cff_service_properties
33 #define CFF_SERVICES_GET                 cff_services
34 #define CFF_SERVICE_MULTI_MASTERS_GET    cff_service_multi_masters
35 #define CFF_SERVICE_METRICS_VAR_GET      cff_service_metrics_variations
36 #define CFF_SERVICE_CFF_LOAD_GET         cff_service_cff_load
37 #define CFF_CMAP_ENCODING_CLASS_REC_GET  cff_cmap_encoding_class_rec
38 #define CFF_CMAP_UNICODE_CLASS_REC_GET   cff_cmap_unicode_class_rec
39 #define CFF_FIELD_HANDLERS_GET           cff_field_handlers
40 
41 #else /* FT_CONFIG_OPTION_PIC */
42 
43 #include FT_SERVICE_GLYPH_DICT_H
44 #include "cffparse.h"
45 #include FT_SERVICE_POSTSCRIPT_INFO_H
46 #include FT_SERVICE_POSTSCRIPT_NAME_H
47 #include FT_SERVICE_TT_CMAP_H
48 #include FT_SERVICE_CID_H
49 #include FT_SERVICE_PROPERTIES_H
50 #include FT_SERVICE_MULTIPLE_MASTERS_H
51 #include FT_SERVICE_METRICS_VARIATIONS_H
52 
53 
54 FT_BEGIN_HEADER
55 
56   typedef struct  CffModulePIC_
57   {
58     FT_ServiceDescRec*               cff_services;
59     CFF_Field_Handler*               cff_field_handlers;
60     FT_Service_PsInfoRec             cff_service_ps_info;
61     FT_Service_GlyphDictRec          cff_service_glyph_dict;
62     FT_Service_PsFontNameRec         cff_service_ps_name;
63     FT_Service_TTCMapsRec            cff_service_get_cmap_info;
64     FT_Service_CIDRec                cff_service_cid_info;
65     FT_Service_PropertiesRec         cff_service_properties;
66     FT_Service_MultiMastersRec       cff_service_multi_masters;
67     FT_Service_MetricsVariationsRec  cff_service_metrics_variations;
68     FT_Service_CFFLoadRec            cff_service_cff_load;
69     FT_CMap_ClassRec                 cff_cmap_encoding_class_rec;
70     FT_CMap_ClassRec                 cff_cmap_unicode_class_rec;
71 
72   } CffModulePIC;
73 
74 
75 #define GET_PIC( lib )                                    \
76           ( (CffModulePIC*)( (lib)->pic_container.cff ) )
77 
78 #define CFF_SERVICE_PS_INFO_GET                       \
79           ( GET_PIC( library )->cff_service_ps_info )
80 #define CFF_SERVICE_GLYPH_DICT_GET                       \
81           ( GET_PIC( library )->cff_service_glyph_dict )
82 #define CFF_SERVICE_PS_NAME_GET                       \
83           ( GET_PIC( library )->cff_service_ps_name )
84 #define CFF_SERVICE_GET_CMAP_INFO_GET                       \
85           ( GET_PIC( library )->cff_service_get_cmap_info )
86 #define CFF_SERVICE_CID_INFO_GET                       \
87           ( GET_PIC( library )->cff_service_cid_info )
88 #define CFF_SERVICE_PROPERTIES_GET                       \
89           ( GET_PIC( library )->cff_service_properties )
90 #define CFF_SERVICES_GET                       \
91           ( GET_PIC( library )->cff_services )
92 #define CFF_SERVICE_MULTI_MASTERS_GET                       \
93           ( GET_PIC( library )->cff_service_multi_masters )
94 #define CFF_SERVICE_METRICS_VAR_GET                              \
95           ( GET_PIC( library )->cff_service_metrics_variations )
96 #define CFF_SERVICE_CFF_LOAD_GET                       \
97           ( GET_PIC( library )->cff_service_cff_load )
98 #define CFF_CMAP_ENCODING_CLASS_REC_GET                       \
99           ( GET_PIC( library )->cff_cmap_encoding_class_rec )
100 #define CFF_CMAP_UNICODE_CLASS_REC_GET                       \
101           ( GET_PIC( library )->cff_cmap_unicode_class_rec )
102 #define CFF_FIELD_HANDLERS_GET                       \
103           ( GET_PIC( library )->cff_field_handlers )
104 
105   /* see cffpic.c for the implementation */
106   void
107   cff_driver_class_pic_free( FT_Library  library );
108 
109   FT_Error
110   cff_driver_class_pic_init( FT_Library  library );
111 
112 FT_END_HEADER
113 
114 #endif /* FT_CONFIG_OPTION_PIC */
115 
116  /* */
117 
118 #endif /* CFFPIC_H_ */
119 
120 
121 /* END */
122