[HB] Remove unused methods
[framework/uifw/harfbuzz.git] / src / harfbuzz-gpos.h
1 /*
2  * Copyright (C) 1998-2004  David Turner and Werner Lemberg
3  * Copyright (C) 2006  Behdad Esfahbod
4  *
5  *  This is part of HarfBuzz, an OpenType Layout engine library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  */
25
26 #ifndef HARFBUZZ_GPOS_H
27 #define HARFBUZZ_GPOS_H
28
29 #include "harfbuzz-open.h"
30 #include "harfbuzz-buffer.h"
31
32 HB_BEGIN_HEADER
33
34
35 /* Lookup types for glyph positioning */
36
37 #define HB_GPOS_LOOKUP_SINGLE     1
38 #define HB_GPOS_LOOKUP_PAIR       2
39 #define HB_GPOS_LOOKUP_CURSIVE    3
40 #define HB_GPOS_LOOKUP_MARKBASE   4
41 #define HB_GPOS_LOOKUP_MARKLIG    5
42 #define HB_GPOS_LOOKUP_MARKMARK   6
43 #define HB_GPOS_LOOKUP_CONTEXT    7
44 #define HB_GPOS_LOOKUP_CHAIN      8
45 #define HB_GPOS_LOOKUP_EXTENSION  9
46
47
48 /* A pointer to a function which loads a glyph.  Its parameters are
49    the same as in a call to Load_Glyph() -- if no glyph loading
50    function will be registered with HB_GPOS_Register_Glyph_Function(),
51    Load_Glyph() will be called indeed.  The purpose of this function
52    pointer is to provide a hook for caching glyph outlines and sbits
53    (using the instance's generic pointer to hold the data).
54
55    If for some reason no outline data is available (e.g. for an
56    embedded bitmap glyph), _glyph->outline.n_points should be set to
57    zero.                                                                */
58
59 typedef HB_Error  (*HB_GlyphFunction)(HB_Font      font,
60                                        HB_UInt      glyphIndex,
61                                        HB_Int       loadFlags );
62
63
64 /* A pointer to a function which accesses the PostScript interpreter.
65    Multiple Master fonts need this interface to convert a metric ID
66    (as stored in an OpenType font version 1.2 or higher) `metric_id'
67    into a metric value (returned in `metric_value').
68
69    `data' points to the user-defined structure specified during a
70    call to HB_GPOS_Register_MM_Function().
71
72    `metric_value' must be returned as a scaled value (but shouldn't
73    be rounded).                                                       */
74
75 typedef HB_Error  (*HB_MMFunction)(HB_Font      font,
76                                     HB_UShort    metric_id,
77                                     HB_Fixed*      metric_value,
78                                     void*        data );
79
80
81 struct  HB_GPOSHeader_
82 {
83   HB_16Dot16           Version;
84
85   HB_ScriptList     ScriptList;
86   HB_FeatureList    FeatureList;
87   HB_LookupList     LookupList;
88
89   hb_ot_layout_t     *layout;
90
91   /* the next field is used for a callback function to get the
92      glyph outline.                                            */
93
94   HB_GlyphFunction  gfunc;
95
96   /* this is OpenType 1.2 -- Multiple Master fonts need this
97      callback function to get various metric values from the
98      PostScript interpreter.                                 */
99
100   HB_MMFunction     mmfunc;
101   void*              data;
102 };
103
104 typedef struct HB_GPOSHeader_  HB_GPOSHeader;
105 typedef HB_GPOSHeader* HB_GPOS;
106
107
108 HB_Error  HB_Load_GPOS_Table( HB_Font          font,
109                               HB_GPOSHeader** gpos,
110                               hb_ot_layout_t   *layout );
111
112
113 HB_Error  HB_Done_GPOS_Table( HB_GPOSHeader* gpos );
114
115
116 HB_Error  HB_GPOS_Select_Script( HB_GPOSHeader*  gpos,
117                                  HB_UInt         script_tag,
118                                  HB_UShort*       script_index );
119
120 HB_Error  HB_GPOS_Select_Language( HB_GPOSHeader*  gpos,
121                                    HB_UInt         language_tag,
122                                    HB_UShort        script_index,
123                                    HB_UShort*       language_index,
124                                    HB_UShort*       req_feature_index );
125
126 HB_Error  HB_GPOS_Select_Feature( HB_GPOSHeader*  gpos,
127                                   HB_UInt         feature_tag,
128                                   HB_UShort        script_index,
129                                   HB_UShort        language_index,
130                                   HB_UShort*       feature_index );
131
132
133 HB_Error  HB_GPOS_Query_Scripts( HB_GPOSHeader*  gpos,
134                                  HB_UInt**       script_tag_list );
135
136 HB_Error  HB_GPOS_Query_Languages( HB_GPOSHeader*  gpos,
137                                    HB_UShort        script_index,
138                                    HB_UInt**       language_tag_list );
139
140 HB_Error  HB_GPOS_Query_Features( HB_GPOSHeader*  gpos,
141                                   HB_UShort        script_index,
142                                   HB_UShort        language_index,
143                                   HB_UInt**       feature_tag_list );
144
145
146 HB_Error  HB_GPOS_Add_Feature( HB_GPOSHeader*  gpos,
147                                HB_UShort        feature_index,
148                                HB_UInt          properties );
149
150 HB_Error  HB_GPOS_Clear_Features( HB_GPOSHeader*  gpos );
151
152
153 HB_Error  HB_GPOS_Register_Glyph_Function( HB_GPOSHeader*    gpos,
154                                            HB_GlyphFunction  gfunc );
155
156
157 HB_Error  HB_GPOS_Register_MM_Function( HB_GPOSHeader*  gpos,
158                                         HB_MMFunction   mmfunc,
159                                         void*            data );
160
161 /* If `dvi' is TRUE, glyph contour points for anchor points and device
162    tables are ignored -- you will get device independent values.         */
163
164
165 HB_Error  HB_GPOS_Apply_String( HB_Font           font,
166                                 HB_GPOSHeader*   gpos,
167                                 HB_UShort         load_flags,
168                                 HB_Buffer        buffer,
169                                 HB_Bool           dvi,
170                                 HB_Bool           r2l );
171
172 HB_END_HEADER
173
174 #endif /* HARFBUZZ_GPOS_H */