Git init
[external/pango1.0.git] / docs / tmpl / opentype.sgml
1 <!-- ##### SECTION Title ##### -->
2 OpenType Font Handling
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Obtaining information from OpenType tables
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
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
11 shaping engines
12 </para>
13
14 <!-- ##### SECTION See_Also ##### -->
15 <para>
16
17 </para>
18
19 <!-- ##### SECTION Stability_Level ##### -->
20 Unstable
21
22 <!-- ##### TYPEDEF PangoOTTag ##### -->
23 <para>
24 The <type>PangoOTTag</type> typedef is used to represent TrueType and OpenType
25 four letter tags inside Pango. Use PANGO_OT_TAG_MAKE()
26 or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create <type>PangoOTTag</type>s manually.
27 </para>
28
29
30 <!-- ##### STRUCT PangoOTInfo ##### -->
31 <para>
32 The #PangoOTInfo struct contains the various 
33 tables associated with an OpenType font. It contains only private fields and
34 should only be accessed via the <function>pango_ot_info_*</function> functions
35 which are documented below. To obtain a #PangoOTInfo,
36 use pango_ot_info_new().
37 </para>
38
39
40 <!-- ##### STRUCT PangoOTBuffer ##### -->
41 <para>
42 The #PangoOTBuffer structure is used to store strings of glyphs associated
43 with a #PangoFcFont, suitable for OpenType layout processing.  It contains
44 only private fields and should only be accessed via the
45 <function>pango_ot_buffer_*</function> functions which are documented below.
46 To obtain a #PangoOTBuffer, use pango_ot_buffer_new().
47 </para>
48
49
50 <!-- ##### STRUCT PangoOTGlyph ##### -->
51 <para>
52 The #PangoOTGlyph structure represents a single glyph together with
53 information used for OpenType layout processing of the glyph.
54 It contains the following fields.
55 </para>
56
57 @glyph: the glyph itself.
58 @properties: the properties value, identifying which features should be
59              applied on this glyph.  See pango_ruleset_add_feature().
60 @cluster: the cluster that this glyph belongs to.
61 @component: a component value, set by the OpenType layout engine.
62 @ligID: a ligature index value, set by the OpenType layout engine.
63 @internal: for Pango internal use
64
65 <!-- ##### STRUCT PangoOTRuleset ##### -->
66 <para>
67 The #PangoOTRuleset structure holds a
68 set of features selected from the tables in an OpenType font.
69 (A feature is an operation such as adjusting glyph positioning
70 that should be applied to a text feature such as a certain
71 type of accent.) A #PangoOTRuleset
72 is created with pango_ot_ruleset_new(), features are added
73 to it with pango_ot_ruleset_add_feature(), then it is
74 applied to a #PangoGlyphString with pango_ot_ruleset_shape().
75 </para>
76
77
78 <!-- ##### STRUCT PangoOTRulesetDescription ##### -->
79 <para>
80 The #PangoOTRuleset structure holds all the information needed
81 to build a complete #PangoOTRuleset from an OpenType font.
82 The main use of this struct is to act as the key for a per-font
83 hash of rulesets.  The user populates a ruleset description and
84 gets the ruleset using pango_ot_ruleset_get_for_description()
85 or create a new one using pango_ot_ruleset_new_from_description().
86 </para>
87
88 @script: a #PangoScript.
89 @language: a #PangoLanguage.
90 @static_gsub_features: static map of GSUB features, or %NULL.
91 @n_static_gsub_features: length of @static_gsub_features, or 0.
92 @static_gpos_features: static map of GPOS features, or %NULL.
93 @n_static_gpos_features: length of @static_gpos_features, or 0.
94 @other_features: map of extra features to add to both GSUB and GPOS, or %NULL.
95                  Unlike the static maps, this pointer need not live beyond
96                  the life of function calls taking this struct.
97 @n_other_features: length of @other_features, or 0.
98 @Since: 1.18
99
100 <!-- ##### ENUM PangoOTTableType ##### -->
101 <para>
102 The <type>PangoOTTableType</type> enumeration values are used to
103 identify the various OpenType tables in the
104 <function>pango_ot_info_*</function> functions.
105 </para>
106
107 @PANGO_OT_TABLE_GSUB: The GSUB table.
108 @PANGO_OT_TABLE_GPOS: The GPOS table.
109
110 <!-- ##### STRUCT PangoOTFeatureMap ##### -->
111 <para>
112 The <type>PangoOTFeatureMap</type> typedef is used to represent an OpenType
113 feature with the property bit associated with it.  The feature tag is
114 represented as a char array instead of a #PangoOTTag for convenience.
115 </para>
116
117 @feature_name: feature tag in represented as four-letter ASCII string.
118 @property_bit: the property bit to use for this feature.  See
119                pango_ot_ruleset_add_feature() for details.
120 @Since: 1.18
121
122 <!-- ##### MACRO PANGO_OT_TAG_MAKE ##### -->
123 <para>
124 Creates a #PangoOTTag from four characters.  This is similar and
125 compatible with the <function>FT_MAKE_TAG()</function> macro from
126 FreeType.
127 </para>
128
129 @c1: First character.
130 @c2: Second character.
131 @c3: Third character.
132 @c4: Fourth character.
133
134
135 <!-- ##### MACRO PANGO_OT_TAG_MAKE_FROM_STRING ##### -->
136 <para>
137 Creates a #PangoOTTag from a string. The string should be at least
138 four characters long (pad with space characters if needed), and need
139 not be nul-terminated.  This is a convenience wrapper around
140 PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for
141 example, as a switch expression, as it dereferences pointers.
142 </para>
143
144 @s: The string representation of the tag.
145
146
147 <!-- ##### MACRO PANGO_OT_ALL_GLYPHS ##### -->
148 <para>
149 This is used as the property bit in pango_ot_ruleset_add_feature() when a
150 feature should be applied to all glyphs.
151 </para>
152
153 @Since: 1.16
154
155
156 <!-- ##### MACRO PANGO_OT_NO_FEATURE ##### -->
157 <para>
158 This is used as a feature index that represent no feature, that is, should be
159 skipped.  It may be returned as feature index by pango_ot_info_find_feature()
160 if the feature is not found, and pango_ot_rulset_add_feature() function
161 automatically skips this value, so no special handling is required by the
162 user.
163 </para>
164
165 @Since: 1.18
166
167
168 <!-- ##### MACRO PANGO_OT_NO_SCRIPT ##### -->
169 <para>
170 This is used as a script index that represent no script, that is, when the
171 requested script was not found, and a default ('DFLT') script was not found
172 either.  It may be returned as script index by pango_ot_info_find_script()
173 if the script or a default script are not found, all other functions
174 taking a script index essentially return if the input script index is
175 this value, so no special handling is required by the user.
176 </para>
177
178 @Since: 1.18
179
180
181 <!-- ##### MACRO PANGO_OT_DEFAULT_LANGUAGE ##### -->
182 <para>
183 This is used as the language index in pango_ot_info_find_feature() when
184 the default language system of the script is desired.
185
186 It is also returned by pango_ot_info_find_language() if the requested language
187 is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE.
188 The end result is that one can always call pango_ot_tag_from_language()
189 followed by pango_ot_info_find_language() and pass the result to
190 pango_ot_info_find_feature() without having to worry about falling back to
191 default language system explicitly.
192 </para>
193
194 @Since: 1.16
195
196
197 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_LANGUAGE ##### -->
198 <para>
199 This is a #PangoOTTag representing a special language tag 'dflt'.  It is
200 returned as language tag by pango_ot_tag_from_language() if the requested
201 language is not found.  It is safe to pass this value to
202 pango_ot_info_find_language() as that function falls back to returning default
203 language-system if the requested language tag is not found.
204 </para>
205
206 @Since: 1.18
207
208
209 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_SCRIPT ##### -->
210 <para>
211 This is a #PangoOTTag representing the special script tag 'DFLT'.  It is
212 returned as script tag by pango_ot_tag_from_script() if the requested script
213 is not found.
214 </para>
215
216 @Since: 1.18
217
218
219 <!-- ##### FUNCTION pango_ot_info_get ##### -->
220 <para>
221
222 </para>
223
224 @face: 
225 @Returns: 
226
227
228 <!-- ##### FUNCTION pango_ot_info_find_script ##### -->
229 <para>
230
231 </para>
232
233 @info: 
234 @table_type: 
235 @script_tag: 
236 @script_index: 
237 @Returns: 
238
239
240 <!-- ##### FUNCTION pango_ot_info_find_language ##### -->
241 <para>
242
243 </para>
244
245 @info: 
246 @table_type: 
247 @script_index: 
248 @language_tag: 
249 @language_index: 
250 @required_feature_index: 
251 @Returns: 
252
253
254 <!-- ##### FUNCTION pango_ot_info_find_feature ##### -->
255 <para>
256
257 </para>
258
259 @info: 
260 @table_type: 
261 @feature_tag: 
262 @script_index: 
263 @language_index: 
264 @feature_index: 
265 @Returns: 
266
267
268 <!-- ##### FUNCTION pango_ot_info_list_scripts ##### -->
269 <para>
270
271 </para>
272
273 @info: 
274 @table_type: 
275 @Returns: 
276
277
278 <!-- ##### FUNCTION pango_ot_info_list_languages ##### -->
279 <para>
280
281 </para>
282
283 @info: 
284 @table_type: 
285 @script_index: 
286 @language_tag: 
287 @Returns: 
288
289
290 <!-- ##### FUNCTION pango_ot_info_list_features ##### -->
291 <para>
292
293 </para>
294
295 @info: 
296 @table_type: 
297 @tag: 
298 @script_index: 
299 @language_index: 
300 @Returns: 
301
302
303 <!-- ##### FUNCTION pango_ot_buffer_new ##### -->
304 <para>
305
306 </para>
307
308 @font: 
309 @Returns: 
310
311
312 <!-- ##### FUNCTION pango_ot_buffer_destroy ##### -->
313 <para>
314
315 </para>
316
317 @buffer: 
318
319
320 <!-- ##### FUNCTION pango_ot_buffer_clear ##### -->
321 <para>
322
323 </para>
324
325 @buffer: 
326
327
328 <!-- ##### FUNCTION pango_ot_buffer_add_glyph ##### -->
329 <para>
330
331 </para>
332
333 @buffer: 
334 @glyph: 
335 @properties: 
336 @cluster: 
337
338
339 <!-- ##### FUNCTION pango_ot_buffer_set_rtl ##### -->
340 <para>
341
342 </para>
343
344 @buffer: 
345 @rtl: 
346
347
348 <!-- ##### FUNCTION pango_ot_buffer_set_zero_width_marks ##### -->
349 <para>
350
351 </para>
352
353 @buffer: 
354 @zero_width_marks: 
355
356
357 <!-- ##### FUNCTION pango_ot_buffer_get_glyphs ##### -->
358 <para>
359
360 </para>
361
362 @buffer: 
363 @glyphs: 
364 @n_glyphs: 
365
366
367 <!-- ##### FUNCTION pango_ot_buffer_output ##### -->
368 <para>
369
370 </para>
371
372 @buffer: 
373 @glyphs: 
374
375
376 <!-- ##### FUNCTION pango_ot_ruleset_get_for_description ##### -->
377 <para>
378
379 </para>
380
381 @info: 
382 @desc: 
383 @Returns: 
384
385
386 <!-- ##### FUNCTION pango_ot_ruleset_new ##### -->
387 <para>
388
389 </para>
390
391 @info: 
392 @Returns: 
393
394
395 <!-- ##### FUNCTION pango_ot_ruleset_new_for ##### -->
396 <para>
397
398 </para>
399
400 @info: 
401 @script: 
402 @language: 
403 @Returns: 
404
405
406 <!-- ##### FUNCTION pango_ot_ruleset_new_from_description ##### -->
407 <para>
408
409 </para>
410
411 @info: 
412 @desc: 
413 @Returns: 
414
415
416 <!-- ##### FUNCTION pango_ot_ruleset_add_feature ##### -->
417 <para>
418
419 </para>
420
421 @ruleset: 
422 @table_type: 
423 @feature_index: 
424 @property_bit: 
425
426
427 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_feature ##### -->
428 <para>
429
430 </para>
431
432 @ruleset: 
433 @table_type: 
434 @feature_tag: 
435 @property_bit: 
436 @Returns: 
437
438
439 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_features ##### -->
440 <para>
441
442 </para>
443
444 @ruleset: 
445 @table_type: 
446 @features: 
447 @n_features: 
448 @Returns: 
449
450
451 <!-- ##### FUNCTION pango_ot_ruleset_get_feature_count ##### -->
452 <para>
453
454 </para>
455
456 @ruleset: 
457 @n_gsub_features: 
458 @n_gpos_features: 
459 @Returns: 
460
461
462 <!-- ##### FUNCTION pango_ot_ruleset_substitute ##### -->
463 <para>
464
465 </para>
466
467 @ruleset: 
468 @buffer: 
469
470
471 <!-- ##### FUNCTION pango_ot_ruleset_position ##### -->
472 <para>
473
474 </para>
475
476 @ruleset: 
477 @buffer: 
478
479
480 <!-- ##### FUNCTION pango_ot_ruleset_description_copy ##### -->
481 <para>
482
483 </para>
484
485 @desc: 
486 @Returns: 
487
488
489 <!-- ##### FUNCTION pango_ot_ruleset_description_equal ##### -->
490 <para>
491
492 </para>
493
494 @desc1: 
495 @desc2: 
496 @Returns: 
497
498
499 <!-- ##### FUNCTION pango_ot_ruleset_description_free ##### -->
500 <para>
501
502 </para>
503
504 @desc: 
505
506
507 <!-- ##### FUNCTION pango_ot_ruleset_description_hash ##### -->
508 <para>
509
510 </para>
511
512 @desc: 
513 @Returns: 
514
515
516 <!-- ##### FUNCTION pango_ot_tag_from_language ##### -->
517 <para>
518
519 </para>
520
521 @language: 
522 @Returns: 
523
524
525 <!-- ##### FUNCTION pango_ot_tag_from_script ##### -->
526 <para>
527
528 </para>
529
530 @script: 
531 @Returns: 
532
533
534 <!-- ##### FUNCTION pango_ot_tag_to_language ##### -->
535 <para>
536
537 </para>
538
539 @language_tag: 
540 @Returns: 
541
542
543 <!-- ##### FUNCTION pango_ot_tag_to_script ##### -->
544 <para>
545
546 </para>
547
548 @script_tag: 
549 @Returns: 
550
551