Imported Upstream version 2.13.2
[platform/upstream/freetype2.git] / include / freetype / ftcid.h
1 /****************************************************************************
2  *
3  * ftcid.h
4  *
5  *   FreeType API for accessing CID font information (specification).
6  *
7  * Copyright (C) 2007-2023 by
8  * Dereg 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 FTCID_H_
20 #define FTCID_H_
21
22 #include <freetype/freetype.h>
23
24 #ifdef FREETYPE_H
25 #error "freetype.h of FreeType 1 has been loaded!"
26 #error "Please fix the directory search order for header files"
27 #error "so that freetype.h of FreeType 2 is found first."
28 #endif
29
30
31 FT_BEGIN_HEADER
32
33
34   /**************************************************************************
35    *
36    * @section:
37    *   cid_fonts
38    *
39    * @title:
40    *   CID Fonts
41    *
42    * @abstract:
43    *   CID-keyed font-specific API.
44    *
45    * @description:
46    *   This section contains the declaration of CID-keyed font-specific
47    *   functions.
48    *
49    */
50
51
52   /**************************************************************************
53    *
54    * @function:
55    *    FT_Get_CID_Registry_Ordering_Supplement
56    *
57    * @description:
58    *    Retrieve the Registry/Ordering/Supplement triple (also known as the
59    *    "R/O/S") from a CID-keyed font.
60    *
61    * @input:
62    *    face ::
63    *      A handle to the input face.
64    *
65    * @output:
66    *    registry ::
67    *      The registry, as a C~string, owned by the face.
68    *
69    *    ordering ::
70    *      The ordering, as a C~string, owned by the face.
71    *
72    *    supplement ::
73    *      The supplement.
74    *
75    * @return:
76    *    FreeType error code.  0~means success.
77    *
78    * @note:
79    *    This function only works with CID faces, returning an error
80    *    otherwise.
81    *
82    * @since:
83    *    2.3.6
84    */
85   FT_EXPORT( FT_Error )
86   FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,
87                                            const char*  *registry,
88                                            const char*  *ordering,
89                                            FT_Int       *supplement );
90
91
92   /**************************************************************************
93    *
94    * @function:
95    *    FT_Get_CID_Is_Internally_CID_Keyed
96    *
97    * @description:
98    *    Retrieve the type of the input face, CID keyed or not.  In contrast
99    *    to the @FT_IS_CID_KEYED macro this function returns successfully also
100    *    for CID-keyed fonts in an SFNT wrapper.
101    *
102    * @input:
103    *    face ::
104    *      A handle to the input face.
105    *
106    * @output:
107    *    is_cid ::
108    *      The type of the face as an @FT_Bool.
109    *
110    * @return:
111    *    FreeType error code.  0~means success.
112    *
113    * @note:
114    *    This function only works with CID faces and OpenType fonts, returning
115    *    an error otherwise.
116    *
117    * @since:
118    *    2.3.9
119    */
120   FT_EXPORT( FT_Error )
121   FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,
122                                       FT_Bool  *is_cid );
123
124
125   /**************************************************************************
126    *
127    * @function:
128    *    FT_Get_CID_From_Glyph_Index
129    *
130    * @description:
131    *    Retrieve the CID of the input glyph index.
132    *
133    * @input:
134    *    face ::
135    *      A handle to the input face.
136    *
137    *    glyph_index ::
138    *      The input glyph index.
139    *
140    * @output:
141    *    cid ::
142    *      The CID as an @FT_UInt.
143    *
144    * @return:
145    *    FreeType error code.  0~means success.
146    *
147    * @note:
148    *    This function only works with CID faces and OpenType fonts, returning
149    *    an error otherwise.
150    *
151    * @since:
152    *    2.3.9
153    */
154   FT_EXPORT( FT_Error )
155   FT_Get_CID_From_Glyph_Index( FT_Face   face,
156                                FT_UInt   glyph_index,
157                                FT_UInt  *cid );
158
159   /* */
160
161
162 FT_END_HEADER
163
164 #endif /* FTCID_H_ */
165
166
167 /* END */