1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Obtaining information from OpenType tables
7 <!-- ##### SECTION Long_Description ##### -->
9 Functions and macros in this section are used to implement the OpenType Layout
10 features and algorithms. These are mostly useful when writing Fontconfig-based
14 <!-- ##### SECTION See_Also ##### -->
19 <!-- ##### SECTION Stability_Level ##### -->
22 <!-- ##### SECTION Image ##### -->
25 <!-- ##### TYPEDEF PangoOTTag ##### -->
27 The <type>PangoOTTag</type> typedef is used to represent TrueType and OpenType
28 four letter tags inside Pango. Use PANGO_OT_TAG_MAKE()
29 or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create <type>PangoOTTag</type>s manually.
33 <!-- ##### STRUCT PangoOTInfo ##### -->
35 The #PangoOTInfo struct contains the various
36 tables associated with an OpenType font. It contains only private fields and
37 should only be accessed via the <function>pango_ot_info_*</function> functions
38 which are documented below. To obtain a #PangoOTInfo,
39 use pango_ot_info_new().
43 <!-- ##### STRUCT PangoOTBuffer ##### -->
45 The #PangoOTBuffer structure is used to store strings of glyphs associated
46 with a #PangoFcFont, suitable for OpenType layout processing. It contains
47 only private fields and should only be accessed via the
48 <function>pango_ot_buffer_*</function> functions which are documented below.
49 To obtain a #PangoOTBuffer, use pango_ot_buffer_new().
53 <!-- ##### STRUCT PangoOTGlyph ##### -->
55 The #PangoOTGlyph structure represents a single glyph together with
56 information used for OpenType layout processing of the glyph.
57 It contains the following fields.
60 @glyph: the glyph itself.
61 @properties: the properties value, identifying which features should be
62 applied on this glyph. See pango_ruleset_add_feature().
63 @cluster: the cluster that this glyph belongs to.
64 @component: a component value, set by the OpenType layout engine.
65 @ligID: a ligature index value, set by the OpenType layout engine.
66 @internal: for Pango internal use
68 <!-- ##### STRUCT PangoOTRuleset ##### -->
70 The #PangoOTRuleset structure holds a
71 set of features selected from the tables in an OpenType font.
72 (A feature is an operation such as adjusting glyph positioning
73 that should be applied to a text feature such as a certain
74 type of accent.) A #PangoOTRuleset
75 is created with pango_ot_ruleset_new(), features are added
76 to it with pango_ot_ruleset_add_feature(), then it is
77 applied to a #PangoGlyphString with pango_ot_ruleset_shape().
81 <!-- ##### STRUCT PangoOTRulesetDescription ##### -->
83 The #PangoOTRuleset structure holds all the information needed
84 to build a complete #PangoOTRuleset from an OpenType font.
85 The main use of this struct is to act as the key for a per-font
86 hash of rulesets. The user populates a ruleset description and
87 gets the ruleset using pango_ot_ruleset_get_for_description()
88 or create a new one using pango_ot_ruleset_new_from_description().
91 @script: a #PangoScript.
92 @language: a #PangoLanguage.
93 @static_gsub_features: static map of GSUB features, or %NULL.
94 @n_static_gsub_features: length of @static_gsub_features, or 0.
95 @static_gpos_features: static map of GPOS features, or %NULL.
96 @n_static_gpos_features: length of @static_gpos_features, or 0.
97 @other_features: map of extra features to add to both GSUB and GPOS, or %NULL.
98 Unlike the static maps, this pointer need not live beyond
99 the life of function calls taking this struct.
100 @n_other_features: length of @other_features, or 0.
103 <!-- ##### ENUM PangoOTTableType ##### -->
105 The <type>PangoOTTableType</type> enumeration values are used to
106 identify the various OpenType tables in the
107 <function>pango_ot_info_*</function> functions.
110 @PANGO_OT_TABLE_GSUB: The GSUB table.
111 @PANGO_OT_TABLE_GPOS: The GPOS table.
113 <!-- ##### STRUCT PangoOTFeatureMap ##### -->
115 The <type>PangoOTFeatureMap</type> typedef is used to represent an OpenType
116 feature with the property bit associated with it. The feature tag is
117 represented as a char array instead of a #PangoOTTag for convenience.
120 @feature_name: feature tag in represented as four-letter ASCII string.
121 @property_bit: the property bit to use for this feature. See
122 pango_ot_ruleset_add_feature() for details.
125 <!-- ##### MACRO PANGO_OT_TAG_MAKE ##### -->
127 Creates a #PangoOTTag from four characters. This is similar and
128 compatible with the <function>FT_MAKE_TAG()</function> macro from
132 @c1: First character.
133 @c2: Second character.
134 @c3: Third character.
135 @c4: Fourth character.
138 <!-- ##### MACRO PANGO_OT_TAG_MAKE_FROM_STRING ##### -->
140 Creates a #PangoOTTag from a string. The string should be at least
141 four characters long (pad with space characters if needed), and need
142 not be nul-terminated. This is a convenience wrapper around
143 PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for
144 example, as a switch expression, as it dereferences pointers.
147 @s: The string representation of the tag.
150 <!-- ##### MACRO PANGO_OT_ALL_GLYPHS ##### -->
152 This is used as the property bit in pango_ot_ruleset_add_feature() when a
153 feature should be applied to all glyphs.
159 <!-- ##### MACRO PANGO_OT_NO_FEATURE ##### -->
161 This is used as a feature index that represent no feature, that is, should be
162 skipped. It may be returned as feature index by pango_ot_info_find_feature()
163 if the feature is not found, and pango_ot_rulset_add_feature() function
164 automatically skips this value, so no special handling is required by the
171 <!-- ##### MACRO PANGO_OT_NO_SCRIPT ##### -->
173 This is used as a script index that represent no script, that is, when the
174 requested script was not found, and a default ('DFLT') script was not found
175 either. It may be returned as script index by pango_ot_info_find_script()
176 if the script or a default script are not found, all other functions
177 taking a script index essentially return if the input script index is
178 this value, so no special handling is required by the user.
184 <!-- ##### MACRO PANGO_OT_DEFAULT_LANGUAGE ##### -->
186 This is used as the language index in pango_ot_info_find_feature() when
187 the default language system of the script is desired.
189 It is also returned by pango_ot_info_find_language() if the requested language
190 is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE.
191 The end result is that one can always call pango_ot_tag_from_language()
192 followed by pango_ot_info_find_language() and pass the result to
193 pango_ot_info_find_feature() without having to worry about falling back to
194 default language system explicitly.
200 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_LANGUAGE ##### -->
202 This is a #PangoOTTag representing a special language tag 'dflt'. It is
203 returned as language tag by pango_ot_tag_from_language() if the requested
204 language is not found. It is safe to pass this value to
205 pango_ot_info_find_language() as that function falls back to returning default
206 language-system if the requested language tag is not found.
212 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_SCRIPT ##### -->
214 This is a #PangoOTTag representing the special script tag 'DFLT'. It is
215 returned as script tag by pango_ot_tag_from_script() if the requested script
222 <!-- ##### FUNCTION pango_ot_info_get ##### -->
231 <!-- ##### FUNCTION pango_ot_info_find_script ##### -->
243 <!-- ##### FUNCTION pango_ot_info_find_language ##### -->
253 @required_feature_index:
257 <!-- ##### FUNCTION pango_ot_info_find_feature ##### -->
271 <!-- ##### FUNCTION pango_ot_info_list_scripts ##### -->
281 <!-- ##### FUNCTION pango_ot_info_list_languages ##### -->
293 <!-- ##### FUNCTION pango_ot_info_list_features ##### -->
306 <!-- ##### FUNCTION pango_ot_buffer_new ##### -->
315 <!-- ##### FUNCTION pango_ot_buffer_destroy ##### -->
323 <!-- ##### FUNCTION pango_ot_buffer_clear ##### -->
331 <!-- ##### FUNCTION pango_ot_buffer_add_glyph ##### -->
342 <!-- ##### FUNCTION pango_ot_buffer_set_rtl ##### -->
351 <!-- ##### FUNCTION pango_ot_buffer_set_zero_width_marks ##### -->
360 <!-- ##### FUNCTION pango_ot_buffer_get_glyphs ##### -->
370 <!-- ##### FUNCTION pango_ot_buffer_output ##### -->
379 <!-- ##### FUNCTION pango_ot_ruleset_get_for_description ##### -->
389 <!-- ##### FUNCTION pango_ot_ruleset_new ##### -->
398 <!-- ##### FUNCTION pango_ot_ruleset_new_for ##### -->
409 <!-- ##### FUNCTION pango_ot_ruleset_new_from_description ##### -->
419 <!-- ##### FUNCTION pango_ot_ruleset_add_feature ##### -->
430 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_feature ##### -->
442 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_features ##### -->
454 <!-- ##### FUNCTION pango_ot_ruleset_get_feature_count ##### -->
465 <!-- ##### FUNCTION pango_ot_ruleset_substitute ##### -->
474 <!-- ##### FUNCTION pango_ot_ruleset_position ##### -->
483 <!-- ##### FUNCTION pango_ot_ruleset_description_copy ##### -->
492 <!-- ##### FUNCTION pango_ot_ruleset_description_equal ##### -->
502 <!-- ##### FUNCTION pango_ot_ruleset_description_free ##### -->
510 <!-- ##### FUNCTION pango_ot_ruleset_description_hash ##### -->
519 <!-- ##### FUNCTION pango_ot_tag_from_language ##### -->
528 <!-- ##### FUNCTION pango_ot_tag_from_script ##### -->
537 <!-- ##### FUNCTION pango_ot_tag_to_language ##### -->
546 <!-- ##### FUNCTION pango_ot_tag_to_script ##### -->