1 /***************************************************************************/
2 /*                                                                         */
3 /*  svcid.h                                                                */
4 /*                                                                         */
5 /*    The FreeType CID font services (specification).                      */
6 /*                                                                         */
7 /*  Copyright 2007-2016 by                                                 */
8 /*  Derek Clegg and Michael Toftdal.                                       */
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 SVCID_H_
20 #define SVCID_H_
21 
22 #include FT_INTERNAL_SERVICE_H
23 
24 
25 FT_BEGIN_HEADER
26 
27 
28 #define FT_SERVICE_ID_CID  "CID"
29 
30   typedef FT_Error
31   (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,
32                                                const char*  *registry,
33                                                const char*  *ordering,
34                                                FT_Int       *supplement );
35   typedef FT_Error
36   (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,
37                                          FT_Bool  *is_cid );
38   typedef FT_Error
39   (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,
40                                       FT_UInt   glyph_index,
41                                       FT_UInt  *cid );
42 
FT_DEFINE_SERVICE(CID)43   FT_DEFINE_SERVICE( CID )
44   {
45     FT_CID_GetRegistryOrderingSupplementFunc  get_ros;
46     FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;
47     FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;
48   };
49 
50 
51 #ifndef FT_CONFIG_OPTION_PIC
52 
53 #define FT_DEFINE_SERVICE_CIDREC( class_,                                   \
54                                   get_ros_,                                 \
55                                   get_is_cid_,                              \
56                                   get_cid_from_glyph_index_ )               \
57   static const FT_Service_CIDRec class_ =                                   \
58   {                                                                         \
59     get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \
60   };
61 
62 #else /* FT_CONFIG_OPTION_PIC */
63 
64 #define FT_DEFINE_SERVICE_CIDREC( class_,                                   \
65                                   get_ros_,                                 \
66                                   get_is_cid_,                              \
67                                   get_cid_from_glyph_index_ )               \
68   void                                                                      \
69   FT_Init_Class_ ## class_( FT_Library          library,                    \
70                             FT_Service_CIDRec*  clazz )                     \
71   {                                                                         \
72     FT_UNUSED( library );                                                   \
73                                                                             \
74     clazz->get_ros                  = get_ros_;                             \
75     clazz->get_is_cid               = get_is_cid_;                          \
76     clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \
77   }
78 
79 #endif /* FT_CONFIG_OPTION_PIC */
80 
81   /* */
82 
83 
84 FT_END_HEADER
85 
86 
87 #endif /* SVCID_H_ */
88 
89 
90 /* END */
91