~ubuntu-branches/ubuntu/utopic/pango1.0/utopic

« back to all changes in this revision

Viewing changes to pango/pango-ot.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-01-28 15:33:11 UTC
  • mfrom: (1.6.8)
  • Revision ID: package-import@ubuntu.com-20140128153311-mf1paynoiz8j4pop
Tags: 1.36.1-0ubuntu1
* New upstream release
* debian/control:
  - Bump build-depends on gtk-doc-tools

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
#ifdef PANGO_ENABLE_ENGINE
36
36
 
 
37
/**
 
38
 * PangoOTTag:
 
39
 *
 
40
 * The #PangoOTTag typedef is used to represent TrueType and OpenType
 
41
 * four letter tags inside Pango. Use PANGO_OT_TAG_MAKE()
 
42
 * or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create <type>PangoOTTag</type>s manually.
 
43
 */
37
44
typedef guint32 PangoOTTag;
38
45
 
 
46
/**
 
47
 * PANGO_OT_TAG_MAKE:
 
48
 * @c1: First character.
 
49
 * @c2: Second character.
 
50
 * @c3: Third character.
 
51
 * @c4: Fourth character.
 
52
 *
 
53
 * Creates a #PangoOTTag from four characters.  This is similar and
 
54
 * compatible with the <function>FT_MAKE_TAG()</function> macro from FreeType.
 
55
 */
 
56
/**
 
57
 * PANGO_OT_TAG_MAKE_FROM_STRING:
 
58
 * @s: The string representation of the tag.
 
59
 *
 
60
 * Creates a #PangoOTTag from a string. The string should be at least
 
61
 * four characters long (pad with space characters if needed), and need
 
62
 * not be nul-terminated.  This is a convenience wrapper around
 
63
 * PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for
 
64
 * example, as a switch expression, as it dereferences pointers.
 
65
 */
39
66
#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4)          ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4))
40
67
#define PANGO_OT_TAG_MAKE_FROM_STRING(s)        (PANGO_OT_TAG_MAKE(((const char *) s)[0], \
41
68
                                                                   ((const char *) s)[1], \
49
76
typedef struct _PangoOTFeatureMap PangoOTFeatureMap;
50
77
typedef struct _PangoOTRulesetDescription PangoOTRulesetDescription;
51
78
 
 
79
/**
 
80
 * PangoOTTableType:
 
81
 * @PANGO_OT_TABLE_GSUB: The GSUB table.
 
82
 * @PANGO_OT_TABLE_GPOS: The GPOS table.
 
83
 *
 
84
 * The <type>PangoOTTableType</type> enumeration values are used to
 
85
 * identify the various OpenType tables in the
 
86
 * <function>pango_ot_info_*</function> functions.
 
87
 */
52
88
typedef enum
53
89
{
54
90
  PANGO_OT_TABLE_GSUB,
55
91
  PANGO_OT_TABLE_GPOS
56
92
} PangoOTTableType;
57
93
 
 
94
/**
 
95
 * PANGO_OT_ALL_GLYPHS:
 
96
 *
 
97
 * This is used as the property bit in pango_ot_ruleset_add_feature() when a
 
98
 * feature should be applied to all glyphs.
 
99
 *
 
100
 * Since: 1.16
 
101
 */
 
102
/**
 
103
 * PANGO_OT_NO_FEATURE:
 
104
 *
 
105
 * This is used as a feature index that represent no feature, that is, should be
 
106
 * skipped.  It may be returned as feature index by pango_ot_info_find_feature()
 
107
 * if the feature is not found, and pango_ot_ruleset_add_feature() function
 
108
 * automatically skips this value, so no special handling is required by the user.
 
109
 *
 
110
 * Since: 1.18
 
111
 */
 
112
/**
 
113
 * PANGO_OT_NO_SCRIPT:
 
114
 *
 
115
 * This is used as a script index that represent no script, that is, when the
 
116
 * requested script was not found, and a default ('DFLT') script was not found
 
117
 * either.  It may be returned as script index by pango_ot_info_find_script()
 
118
 * if the script or a default script are not found, all other functions
 
119
 * taking a script index essentially return if the input script index is
 
120
 * this value, so no special handling is required by the user.
 
121
 *
 
122
 * Since: 1.18
 
123
 */
 
124
/**
 
125
 * PANGO_OT_DEFAULT_LANGUAGE:
 
126
 *
 
127
 * This is used as the language index in pango_ot_info_find_feature() when
 
128
 * the default language system of the script is desired.
 
129
 *
 
130
 * It is also returned by pango_ot_info_find_language() if the requested language
 
131
 * is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE.
 
132
 * The end result is that one can always call pango_ot_tag_from_language()
 
133
 * followed by pango_ot_info_find_language() and pass the result to
 
134
 * pango_ot_info_find_feature() without having to worry about falling back to
 
135
 * default language system explicitly.
 
136
 *
 
137
 * Since: 1.16
 
138
 */
58
139
#define PANGO_OT_ALL_GLYPHS                     ((guint) 0xFFFF)
59
140
#define PANGO_OT_NO_FEATURE                     ((guint) 0xFFFF)
60
141
#define PANGO_OT_NO_SCRIPT                      ((guint) 0xFFFF)
61
142
#define PANGO_OT_DEFAULT_LANGUAGE               ((guint) 0xFFFF)
62
143
 
 
144
/**
 
145
 * PANGO_OT_TAG_DEFAULT_SCRIPT:
 
146
 *
 
147
 * This is a #PangoOTTag representing the special script tag 'DFLT'.  It is
 
148
 * returned as script tag by pango_ot_tag_from_script() if the requested script
 
149
 * is not found.
 
150
 *
 
151
 * Since: 1.18
 
152
 */
 
153
/**
 
154
 * PANGO_OT_TAG_DEFAULT_LANGUAGE:
 
155
 *
 
156
 * This is a #PangoOTTag representing a special language tag 'dflt'.  It is
 
157
 * returned as language tag by pango_ot_tag_from_language() if the requested
 
158
 * language is not found.  It is safe to pass this value to
 
159
 * pango_ot_info_find_language() as that function falls back to returning default
 
160
 * language-system if the requested language tag is not found.
 
161
 *
 
162
 * Since: 1.18
 
163
 */
63
164
#define PANGO_OT_TAG_DEFAULT_SCRIPT             PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T')
64
165
#define PANGO_OT_TAG_DEFAULT_LANGUAGE           PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't')
65
166
 
66
167
/* Note that this must match hb_glyph_info_t */
 
168
/**
 
169
 * PangoOTGlyph:
 
170
 * @glyph: the glyph itself.
 
171
 * @properties: the properties value, identifying which features should be
 
172
 * applied on this glyph.  See pango_ot_ruleset_add_feature().
 
173
 * @cluster: the cluster that this glyph belongs to.
 
174
 * @component: a component value, set by the OpenType layout engine.
 
175
 * @ligID: a ligature index value, set by the OpenType layout engine.
 
176
 * @internal: for Pango internal use
 
177
 *
 
178
 * The #PangoOTGlyph structure represents a single glyph together with
 
179
 * information used for OpenType layout processing of the glyph.
 
180
 * It contains the following fields.
 
181
 */
67
182
struct _PangoOTGlyph
68
183
{
69
184
  guint32  glyph;
75
190
  guint    internal;
76
191
};
77
192
 
 
193
/**
 
194
 * PangoOTFeatureMap:
 
195
 * @feature_name: feature tag in represented as four-letter ASCII string.
 
196
 * @property_bit: the property bit to use for this feature.  See
 
197
 * pango_ot_ruleset_add_feature() for details.
 
198
 *
 
199
 * The #PangoOTFeatureMap typedef is used to represent an OpenType
 
200
 * feature with the property bit associated with it.  The feature tag is
 
201
 * represented as a char array instead of a #PangoOTTag for convenience.
 
202
 *
 
203
 * Since: 1.18
 
204
 */
78
205
struct _PangoOTFeatureMap
79
206
{
80
207
  char     feature_name[5];
81
208
  gulong   property_bit;
82
209
};
83
210
 
 
211
/**
 
212
 * PangoOTRulesetDescription:
 
213
 * @script: a #PangoScript.
 
214
 * @language: a #PangoLanguage.
 
215
 * @static_gsub_features: static map of GSUB features, or %NULL.
 
216
 * @n_static_gsub_features: length of @static_gsub_features, or 0.
 
217
 * @static_gpos_features: static map of GPOS features, or %NULL.
 
218
 * @n_static_gpos_features: length of @static_gpos_features, or 0.
 
219
 * @other_features: map of extra features to add to both GSUB and GPOS, or %NULL.
 
220
 * Unlike the static maps, this pointer need not live beyond
 
221
 * the life of function calls taking this struct.
 
222
 * @n_other_features: length of @other_features, or 0.
 
223
 *
 
224
 * The #PangoOTRuleset structure holds all the information needed
 
225
 * to build a complete #PangoOTRuleset from an OpenType font.
 
226
 * The main use of this struct is to act as the key for a per-font
 
227
 * hash of rulesets.  The user populates a ruleset description and
 
228
 * gets the ruleset using pango_ot_ruleset_get_for_description()
 
229
 * or create a new one using pango_ot_ruleset_new_from_description().
 
230
 *
 
231
 * Since: 1.18
 
232
 */
84
233
struct _PangoOTRulesetDescription {
85
234
  PangoScript               script;
86
235
  PangoLanguage            *language;