35
35
#ifdef PANGO_ENABLE_ENGINE
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.
37
44
typedef guint32 PangoOTTag;
48
* @c1: First character.
49
* @c2: Second character.
50
* @c3: Third character.
51
* @c4: Fourth character.
53
* Creates a #PangoOTTag from four characters. This is similar and
54
* compatible with the <function>FT_MAKE_TAG()</function> macro from FreeType.
57
* PANGO_OT_TAG_MAKE_FROM_STRING:
58
* @s: The string representation of the tag.
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.
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;
81
* @PANGO_OT_TABLE_GSUB: The GSUB table.
82
* @PANGO_OT_TABLE_GPOS: The GPOS table.
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.
54
90
PANGO_OT_TABLE_GSUB,
55
91
PANGO_OT_TABLE_GPOS
56
92
} PangoOTTableType;
95
* PANGO_OT_ALL_GLYPHS:
97
* This is used as the property bit in pango_ot_ruleset_add_feature() when a
98
* feature should be applied to all glyphs.
103
* PANGO_OT_NO_FEATURE:
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.
113
* PANGO_OT_NO_SCRIPT:
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.
125
* PANGO_OT_DEFAULT_LANGUAGE:
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.
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.
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)
145
* PANGO_OT_TAG_DEFAULT_SCRIPT:
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
154
* PANGO_OT_TAG_DEFAULT_LANGUAGE:
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.
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')
66
167
/* Note that this must match hb_glyph_info_t */
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
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.
67
182
struct _PangoOTGlyph
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.
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.
78
205
struct _PangoOTFeatureMap
80
207
char feature_name[5];
81
208
gulong property_bit;
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.
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().
84
233
struct _PangoOTRulesetDescription {
85
234
PangoScript script;
86
235
PangoLanguage *language;