cccc5187716426f0e1a82f0d378ef582978c2bb5
[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 <!-- ##### SECTION Image ##### -->
23
24
25 <!-- ##### TYPEDEF PangoOTTag ##### -->
26 <para>
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.
30 </para>
31
32
33 <!-- ##### STRUCT PangoOTInfo ##### -->
34 <para>
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().
40 </para>
41
42
43 <!-- ##### STRUCT PangoOTBuffer ##### -->
44 <para>
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().
50 </para>
51
52
53 <!-- ##### STRUCT PangoOTGlyph ##### -->
54 <para>
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.
58 </para>
59
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
67
68 <!-- ##### STRUCT PangoOTRuleset ##### -->
69 <para>
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().
78 </para>
79
80
81 <!-- ##### STRUCT PangoOTRulesetDescription ##### -->
82 <para>
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().
89 </para>
90
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.
101 @Since: 1.18
102
103 <!-- ##### ENUM PangoOTTableType ##### -->
104 <para>
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.
108 </para>
109
110 @PANGO_OT_TABLE_GSUB: The GSUB table.
111 @PANGO_OT_TABLE_GPOS: The GPOS table.
112
113 <!-- ##### STRUCT PangoOTFeatureMap ##### -->
114 <para>
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.
118 </para>
119
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.
123 @Since: 1.18
124
125 <!-- ##### MACRO PANGO_OT_TAG_MAKE ##### -->
126 <para>
127 Creates a #PangoOTTag from four characters.  This is similar and
128 compatible with the <function>FT_MAKE_TAG()</function> macro from
129 FreeType.
130 </para>
131
132 @c1: First character.
133 @c2: Second character.
134 @c3: Third character.
135 @c4: Fourth character.
136
137
138 <!-- ##### MACRO PANGO_OT_TAG_MAKE_FROM_STRING ##### -->
139 <para>
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.
145 </para>
146
147 @s: The string representation of the tag.
148
149
150 <!-- ##### MACRO PANGO_OT_ALL_GLYPHS ##### -->
151 <para>
152 This is used as the property bit in pango_ot_ruleset_add_feature() when a
153 feature should be applied to all glyphs.
154 </para>
155
156 @Since: 1.16
157
158
159 <!-- ##### MACRO PANGO_OT_NO_FEATURE ##### -->
160 <para>
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
165 user.
166 </para>
167
168 @Since: 1.18
169
170
171 <!-- ##### MACRO PANGO_OT_NO_SCRIPT ##### -->
172 <para>
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.
179 </para>
180
181 @Since: 1.18
182
183
184 <!-- ##### MACRO PANGO_OT_DEFAULT_LANGUAGE ##### -->
185 <para>
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.
188
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.
195 </para>
196
197 @Since: 1.16
198
199
200 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_LANGUAGE ##### -->
201 <para>
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.
207 </para>
208
209 @Since: 1.18
210
211
212 <!-- ##### MACRO PANGO_OT_TAG_DEFAULT_SCRIPT ##### -->
213 <para>
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
216 is not found.
217 </para>
218
219 @Since: 1.18
220
221
222 <!-- ##### FUNCTION pango_ot_info_get ##### -->
223 <para>
224
225 </para>
226
227 @face: 
228 @Returns: 
229
230
231 <!-- ##### FUNCTION pango_ot_info_find_script ##### -->
232 <para>
233
234 </para>
235
236 @info: 
237 @table_type: 
238 @script_tag: 
239 @script_index: 
240 @Returns: 
241
242
243 <!-- ##### FUNCTION pango_ot_info_find_language ##### -->
244 <para>
245
246 </para>
247
248 @info: 
249 @table_type: 
250 @script_index: 
251 @language_tag: 
252 @language_index: 
253 @required_feature_index: 
254 @Returns: 
255
256
257 <!-- ##### FUNCTION pango_ot_info_find_feature ##### -->
258 <para>
259
260 </para>
261
262 @info: 
263 @table_type: 
264 @feature_tag: 
265 @script_index: 
266 @language_index: 
267 @feature_index: 
268 @Returns: 
269
270
271 <!-- ##### FUNCTION pango_ot_info_list_scripts ##### -->
272 <para>
273
274 </para>
275
276 @info: 
277 @table_type: 
278 @Returns: 
279
280
281 <!-- ##### FUNCTION pango_ot_info_list_languages ##### -->
282 <para>
283
284 </para>
285
286 @info: 
287 @table_type: 
288 @script_index: 
289 @language_tag: 
290 @Returns: 
291
292
293 <!-- ##### FUNCTION pango_ot_info_list_features ##### -->
294 <para>
295
296 </para>
297
298 @info: 
299 @table_type: 
300 @tag: 
301 @script_index: 
302 @language_index: 
303 @Returns: 
304
305
306 <!-- ##### FUNCTION pango_ot_buffer_new ##### -->
307 <para>
308
309 </para>
310
311 @font: 
312 @Returns: 
313
314
315 <!-- ##### FUNCTION pango_ot_buffer_destroy ##### -->
316 <para>
317
318 </para>
319
320 @buffer: 
321
322
323 <!-- ##### FUNCTION pango_ot_buffer_clear ##### -->
324 <para>
325
326 </para>
327
328 @buffer: 
329
330
331 <!-- ##### FUNCTION pango_ot_buffer_add_glyph ##### -->
332 <para>
333
334 </para>
335
336 @buffer: 
337 @glyph: 
338 @properties: 
339 @cluster: 
340
341
342 <!-- ##### FUNCTION pango_ot_buffer_set_rtl ##### -->
343 <para>
344
345 </para>
346
347 @buffer: 
348 @rtl: 
349
350
351 <!-- ##### FUNCTION pango_ot_buffer_set_zero_width_marks ##### -->
352 <para>
353
354 </para>
355
356 @buffer: 
357 @zero_width_marks: 
358
359
360 <!-- ##### FUNCTION pango_ot_buffer_get_glyphs ##### -->
361 <para>
362
363 </para>
364
365 @buffer: 
366 @glyphs: 
367 @n_glyphs: 
368
369
370 <!-- ##### FUNCTION pango_ot_buffer_output ##### -->
371 <para>
372
373 </para>
374
375 @buffer: 
376 @glyphs: 
377
378
379 <!-- ##### FUNCTION pango_ot_ruleset_get_for_description ##### -->
380 <para>
381
382 </para>
383
384 @info: 
385 @desc: 
386 @Returns: 
387
388
389 <!-- ##### FUNCTION pango_ot_ruleset_new ##### -->
390 <para>
391
392 </para>
393
394 @info: 
395 @Returns: 
396
397
398 <!-- ##### FUNCTION pango_ot_ruleset_new_for ##### -->
399 <para>
400
401 </para>
402
403 @info: 
404 @script: 
405 @language: 
406 @Returns: 
407
408
409 <!-- ##### FUNCTION pango_ot_ruleset_new_from_description ##### -->
410 <para>
411
412 </para>
413
414 @info: 
415 @desc: 
416 @Returns: 
417
418
419 <!-- ##### FUNCTION pango_ot_ruleset_add_feature ##### -->
420 <para>
421
422 </para>
423
424 @ruleset: 
425 @table_type: 
426 @feature_index: 
427 @property_bit: 
428
429
430 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_feature ##### -->
431 <para>
432
433 </para>
434
435 @ruleset: 
436 @table_type: 
437 @feature_tag: 
438 @property_bit: 
439 @Returns: 
440
441
442 <!-- ##### FUNCTION pango_ot_ruleset_maybe_add_features ##### -->
443 <para>
444
445 </para>
446
447 @ruleset: 
448 @table_type: 
449 @features: 
450 @n_features: 
451 @Returns: 
452
453
454 <!-- ##### FUNCTION pango_ot_ruleset_get_feature_count ##### -->
455 <para>
456
457 </para>
458
459 @ruleset: 
460 @n_gsub_features: 
461 @n_gpos_features: 
462 @Returns: 
463
464
465 <!-- ##### FUNCTION pango_ot_ruleset_substitute ##### -->
466 <para>
467
468 </para>
469
470 @ruleset: 
471 @buffer: 
472
473
474 <!-- ##### FUNCTION pango_ot_ruleset_position ##### -->
475 <para>
476
477 </para>
478
479 @ruleset: 
480 @buffer: 
481
482
483 <!-- ##### FUNCTION pango_ot_ruleset_description_copy ##### -->
484 <para>
485
486 </para>
487
488 @desc: 
489 @Returns: 
490
491
492 <!-- ##### FUNCTION pango_ot_ruleset_description_equal ##### -->
493 <para>
494
495 </para>
496
497 @desc1: 
498 @desc2: 
499 @Returns: 
500
501
502 <!-- ##### FUNCTION pango_ot_ruleset_description_free ##### -->
503 <para>
504
505 </para>
506
507 @desc: 
508
509
510 <!-- ##### FUNCTION pango_ot_ruleset_description_hash ##### -->
511 <para>
512
513 </para>
514
515 @desc: 
516 @Returns: 
517
518
519 <!-- ##### FUNCTION pango_ot_tag_from_language ##### -->
520 <para>
521
522 </para>
523
524 @language: 
525 @Returns: 
526
527
528 <!-- ##### FUNCTION pango_ot_tag_from_script ##### -->
529 <para>
530
531 </para>
532
533 @script: 
534 @Returns: 
535
536
537 <!-- ##### FUNCTION pango_ot_tag_to_language ##### -->
538 <para>
539
540 </para>
541
542 @language_tag: 
543 @Returns: 
544
545
546 <!-- ##### FUNCTION pango_ot_tag_to_script ##### -->
547 <para>
548
549 </para>
550
551 @script_tag: 
552 @Returns: 
553
554