Updated: Sudoku no longer crashes
[moon.git] / cairo / src / cairo-scaled-font-subsets-private.h
blob88dedb59b5083cd1ce8fea10849f20935b82b581
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2006 Red Hat, Inc
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is University of Southern
31 * California.
33 * Contributor(s):
34 * Carl D. Worth <cworth@cworth.org>
37 #ifndef CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H
38 #define CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H
40 #include "cairoint.h"
42 #if CAIRO_HAS_FONT_SUBSET
44 typedef struct _cairo_scaled_font_subsets_glyph {
45 unsigned int font_id;
46 unsigned int subset_id;
47 unsigned int subset_glyph_index;
48 cairo_bool_t is_scaled;
49 cairo_bool_t is_composite;
50 double x_advance;
51 double y_advance;
52 cairo_bool_t utf8_is_mapped;
53 uint32_t unicode;
54 } cairo_scaled_font_subsets_glyph_t;
56 /**
57 * _cairo_scaled_font_subsets_create_scaled:
59 * Create a new #cairo_scaled_font_subsets_t object which can be used
60 * to create subsets of any number of #cairo_scaled_font_t
61 * objects. This allows the (arbitrarily large and sparse) glyph
62 * indices of a #cairo_scaled_font_t to be mapped to one or more font
63 * subsets with glyph indices packed into the range
64 * [0 .. max_glyphs_per_subset).
66 * Return value: a pointer to the newly creates font subsets. The
67 * caller owns this object and should call
68 * _cairo_scaled_font_subsets_destroy() when done with it.
69 **/
70 cairo_private cairo_scaled_font_subsets_t *
71 _cairo_scaled_font_subsets_create_scaled (void);
73 /**
74 * _cairo_scaled_font_subsets_create_simple:
76 * Create a new #cairo_scaled_font_subsets_t object which can be used
77 * to create font subsets suitable for embedding as Postscript or PDF
78 * simple fonts.
80 * Glyphs with an outline path available will be mapped to one font
81 * subset for each font face. Glyphs from bitmap fonts will mapped to
82 * separate font subsets for each #cairo_scaled_font_t object.
84 * The maximum number of glyphs per subset is 256. Each subset
85 * reserves the first glyph for the .notdef glyph.
87 * Return value: a pointer to the newly creates font subsets. The
88 * caller owns this object and should call
89 * _cairo_scaled_font_subsets_destroy() when done with it.
90 **/
91 cairo_private cairo_scaled_font_subsets_t *
92 _cairo_scaled_font_subsets_create_simple (void);
94 /**
95 * _cairo_scaled_font_subsets_create_composite:
97 * Create a new #cairo_scaled_font_subsets_t object which can be used
98 * to create font subsets suitable for embedding as Postscript or PDF
99 * composite fonts.
101 * Glyphs with an outline path available will be mapped to one font
102 * subset for each font face. Each unscaled subset has a maximum of
103 * 65536 glyphs except for Type1 fonts which have a maximum of 256 glyphs.
105 * Glyphs from bitmap fonts will mapped to separate font subsets for
106 * each #cairo_scaled_font_t object. Each unscaled subset has a maximum
107 * of 256 glyphs.
109 * Each subset reserves the first glyph for the .notdef glyph.
111 * Return value: a pointer to the newly creates font subsets. The
112 * caller owns this object and should call
113 * _cairo_scaled_font_subsets_destroy() when done with it.
115 cairo_private cairo_scaled_font_subsets_t *
116 _cairo_scaled_font_subsets_create_composite (void);
119 * _cairo_scaled_font_subsets_destroy:
120 * @font_subsets: a #cairo_scaled_font_subsets_t object to be destroyed
122 * Destroys @font_subsets and all resources associated with it.
124 cairo_private void
125 _cairo_scaled_font_subsets_destroy (cairo_scaled_font_subsets_t *font_subsets);
128 * _cairo_scaled_font_subsets_map_glyph:
129 * @font_subsets: a #cairo_scaled_font_subsets_t
130 * @scaled_font: the font of the glyph to be mapped
131 * @scaled_font_glyph_index: the index of the glyph to be mapped
132 * @utf8: a string of text encoded in UTF-8
133 * @utf8_len: length of @utf8 in bytes
134 * @subset_glyph_ret: return structure containing subset font and glyph id
136 * Map a glyph from a #cairo_scaled_font to a new index within a
137 * subset of that font. The mapping performed is from the tuple:
139 * (scaled_font, scaled_font_glyph_index)
141 * to the tuple:
143 * (font_id, subset_id, subset_glyph_index)
145 * This mapping is 1:1. If the input tuple has previously mapped, the
146 * the output tuple previously returned will be returned again.
148 * Otherwise, the return tuple will be constructed as follows:
150 * 1) There is a 1:1 correspondence between the input scaled_font
151 * value and the output font_id value. If no mapping has been
152 * previously performed with the scaled_font value then the
153 * smallest unused font_id value will be returned.
155 * 2) Within the set of output tuples of the same font_id value the
156 * smallest value of subset_id will be returned such that
157 * subset_glyph_index does not exceed max_glyphs_per_subset (as
158 * passed to _cairo_scaled_font_subsets_create()) and that the
159 * resulting tuple is unique.
161 * 3) The smallest value of subset_glyph_index is returned such that
162 * the resulting tuple is unique.
164 * The net result is that any #cairo_scaled_font_t will be represented
165 * by one or more font subsets. Each subset is effectively a tuple of
166 * (scaled_font, font_id, subset_id) and within each subset there
167 * exists a mapping of scaled_glyph_font_index to subset_glyph_index.
169 * This final description of a font subset is the same representation
170 * used by #cairo_scaled_font_subset_t as provided by
171 * _cairo_scaled_font_subsets_foreach.
173 * @utf8 and @utf8_len specify a string of unicode characters that the
174 * glyph @scaled_font_glyph_index maps to. If @utf8_is_mapped in
175 * @subset_glyph_ret is %TRUE, the font subsetting will (where index to
176 * unicode mapping is supported) ensure that @scaled_font_glyph_index
177 * maps to @utf8. If @utf8_is_mapped is %FALSE,
178 * @scaled_font_glyph_index has already been mapped to a different
179 * unicode string.
181 * The returned values in the #cairo_scaled_font_subsets_glyph_t struct are:
183 * @font_id: The font ID of the mapped glyph
184 * @subset_id : The subset ID of the mapped glyph within the @font_id
185 * @subset_glyph_index: The index of the mapped glyph within the @subset_id subset
186 * @is_scaled: If true, the mapped glyph is from a bitmap font, and separate font
187 * subset is created for each font scale used. If false, the outline of the mapped glyph
188 * is available. One font subset for each font face is created.
189 * @x_advance, @y_advance: When @is_scaled is true, @x_advance and @y_advance contain
190 * the x and y advance for the mapped glyph in device space.
191 * When @is_scaled is false, @x_advance and @y_advance contain the x and y advance for
192 * the the mapped glyph from an unhinted 1 point font.
193 * @utf8_is_mapped: If true the utf8 string provided to _cairo_scaled_font_subsets_map_glyph()
194 * is (or already was) the utf8 string mapped to this glyph. If false the glyph is already
195 * mapped to a different utf8 string.
196 * @unicode: the unicode character mapped to this glyph by the font backend.
198 * Return value: %CAIRO_STATUS_SUCCESS if successful, or a non-zero
199 * value indicating an error. Possible errors include
200 * %CAIRO_STATUS_NO_MEMORY.
202 cairo_private cairo_status_t
203 _cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *font_subsets,
204 cairo_scaled_font_t *scaled_font,
205 unsigned long scaled_font_glyph_index,
206 const char * utf8,
207 int utf8_len,
208 cairo_scaled_font_subsets_glyph_t *subset_glyph_ret);
210 typedef cairo_status_t
211 (*cairo_scaled_font_subset_callback_func_t) (cairo_scaled_font_subset_t *font_subset,
212 void *closure);
215 * _cairo_scaled_font_subsets_foreach:
216 * @font_subsets: a #cairo_scaled_font_subsets_t
217 * @font_subset_callback: a function to be called for each font subset
218 * @closure: closure data for the callback function
220 * Iterate over each unique scaled font subset as created by calls to
221 * _cairo_scaled_font_subsets_map_glyph(). A subset is determined by
222 * unique pairs of (font_id, subset_id) as returned by
223 * _cairo_scaled_font_subsets_map_glyph().
225 * For each subset, @font_subset_callback will be called and will be
226 * provided with both a #cairo_scaled_font_subset_t object containing
227 * all the glyphs in the subset as well as the value of @closure.
229 * The #cairo_scaled_font_subset_t object contains the scaled_font,
230 * the font_id, and the subset_id corresponding to all glyphs
231 * belonging to the subset. In addition, it contains an array providing
232 * a mapping between subset glyph indices and the original scaled font
233 * glyph indices.
235 * The index of the array corresponds to subset_glyph_index values
236 * returned by _cairo_scaled_font_subsets_map_glyph() while the
237 * values of the array correspond to the scaled_font_glyph_index
238 * values passed as input to the same function.
240 * Return value: %CAIRO_STATUS_SUCCESS if successful, or a non-zero
241 * value indicating an error. Possible errors include
242 * %CAIRO_STATUS_NO_MEMORY.
244 cairo_private cairo_status_t
245 _cairo_scaled_font_subsets_foreach_scaled (cairo_scaled_font_subsets_t *font_subsets,
246 cairo_scaled_font_subset_callback_func_t font_subset_callback,
247 void *closure);
250 * _cairo_scaled_font_subsets_foreach_unscaled:
251 * @font_subsets: a #cairo_scaled_font_subsets_t
252 * @font_subset_callback: a function to be called for each font subset
253 * @closure: closure data for the callback function
255 * Iterate over each unique unscaled font subset as created by calls to
256 * _cairo_scaled_font_subsets_map_glyph(). A subset is determined by
257 * unique pairs of (font_id, subset_id) as returned by
258 * _cairo_scaled_font_subsets_map_glyph().
260 * For each subset, @font_subset_callback will be called and will be
261 * provided with both a #cairo_scaled_font_subset_t object containing
262 * all the glyphs in the subset as well as the value of @closure.
264 * The #cairo_scaled_font_subset_t object contains the scaled_font,
265 * the font_id, and the subset_id corresponding to all glyphs
266 * belonging to the subset. In addition, it contains an array providing
267 * a mapping between subset glyph indices and the original scaled font
268 * glyph indices.
270 * The index of the array corresponds to subset_glyph_index values
271 * returned by _cairo_scaled_font_subsets_map_glyph() while the
272 * values of the array correspond to the scaled_font_glyph_index
273 * values passed as input to the same function.
275 * Return value: %CAIRO_STATUS_SUCCESS if successful, or a non-zero
276 * value indicating an error. Possible errors include
277 * %CAIRO_STATUS_NO_MEMORY.
279 cairo_private cairo_status_t
280 _cairo_scaled_font_subsets_foreach_unscaled (cairo_scaled_font_subsets_t *font_subsets,
281 cairo_scaled_font_subset_callback_func_t font_subset_callback,
282 void *closure);
285 * _cairo_scaled_font_subsets_foreach_user:
286 * @font_subsets: a #cairo_scaled_font_subsets_t
287 * @font_subset_callback: a function to be called for each font subset
288 * @closure: closure data for the callback function
290 * Iterate over each unique scaled font subset as created by calls to
291 * _cairo_scaled_font_subsets_map_glyph(). A subset is determined by
292 * unique pairs of (font_id, subset_id) as returned by
293 * _cairo_scaled_font_subsets_map_glyph().
295 * For each subset, @font_subset_callback will be called and will be
296 * provided with both a #cairo_scaled_font_subset_t object containing
297 * all the glyphs in the subset as well as the value of @closure.
299 * The #cairo_scaled_font_subset_t object contains the scaled_font,
300 * the font_id, and the subset_id corresponding to all glyphs
301 * belonging to the subset. In addition, it contains an array providing
302 * a mapping between subset glyph indices and the original scaled font
303 * glyph indices.
305 * The index of the array corresponds to subset_glyph_index values
306 * returned by _cairo_scaled_font_subsets_map_glyph() while the
307 * values of the array correspond to the scaled_font_glyph_index
308 * values passed as input to the same function.
310 * Return value: %CAIRO_STATUS_SUCCESS if successful, or a non-zero
311 * value indicating an error. Possible errors include
312 * %CAIRO_STATUS_NO_MEMORY.
314 cairo_private cairo_status_t
315 _cairo_scaled_font_subsets_foreach_user (cairo_scaled_font_subsets_t *font_subsets,
316 cairo_scaled_font_subset_callback_func_t font_subset_callback,
317 void *closure);
320 * _cairo_scaled_font_subset_create_glyph_names:
321 * @font_subsets: a #cairo_scaled_font_subsets_t
323 * Create an array of strings containing the glyph name for each glyph
324 * in @font_subsets. The array as store in font_subsets->glyph_names.
326 * Return value: %CAIRO_STATUS_SUCCESS if successful,
327 * %CAIRO_INT_STATUS_UNSUPPORTED if the font backend does not support
328 * mapping the glyph indices to unicode characters. Possible errors
329 * include %CAIRO_STATUS_NO_MEMORY.
331 cairo_private cairo_int_status_t
332 _cairo_scaled_font_subset_create_glyph_names (cairo_scaled_font_subset_t *subset);
334 typedef struct _cairo_cff_subset {
335 char *base_font;
336 int *widths;
337 long x_min, y_min, x_max, y_max;
338 long ascent, descent;
339 char *data;
340 unsigned long data_length;
341 } cairo_cff_subset_t;
344 * _cairo_cff_subset_init:
345 * @cff_subset: a #cairo_cff_subset_t to initialize
346 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
348 * If possible (depending on the format of the underlying
349 * #cairo_scaled_font_t and the font backend in use) generate a
350 * cff file corresponding to @font_subset and initialize
351 * @cff_subset with information about the subset and the cff
352 * data.
354 * Return value: %CAIRO_STATUS_SUCCESS if successful,
355 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a
356 * cff file, or an non-zero value indicating an error. Possible
357 * errors include %CAIRO_STATUS_NO_MEMORY.
359 cairo_private cairo_status_t
360 _cairo_cff_subset_init (cairo_cff_subset_t *cff_subset,
361 const char *name,
362 cairo_scaled_font_subset_t *font_subset);
365 * _cairo_cff_subset_fini:
366 * @cff_subset: a #cairo_cff_subset_t
368 * Free all resources associated with @cff_subset. After this
369 * call, @cff_subset should not be used again without a
370 * subsequent call to _cairo_cff_subset_init() again first.
372 cairo_private void
373 _cairo_cff_subset_fini (cairo_cff_subset_t *cff_subset);
376 * _cairo_cff_fallback_init:
377 * @cff_subset: a #cairo_cff_subset_t to initialize
378 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
380 * If possible (depending on the format of the underlying
381 * #cairo_scaled_font_t and the font backend in use) generate a cff
382 * file corresponding to @font_subset and initialize @cff_subset
383 * with information about the subset and the cff data.
385 * Return value: %CAIRO_STATUS_SUCCESS if successful,
386 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a
387 * cff file, or an non-zero value indicating an error. Possible
388 * errors include %CAIRO_STATUS_NO_MEMORY.
390 cairo_private cairo_status_t
391 _cairo_cff_fallback_init (cairo_cff_subset_t *cff_subset,
392 const char *name,
393 cairo_scaled_font_subset_t *font_subset);
396 * _cairo_cff_fallback_fini:
397 * @cff_subset: a #cairo_cff_subset_t
399 * Free all resources associated with @cff_subset. After this
400 * call, @cff_subset should not be used again without a
401 * subsequent call to _cairo_cff_subset_init() again first.
403 cairo_private void
404 _cairo_cff_fallback_fini (cairo_cff_subset_t *cff_subset);
406 typedef struct _cairo_truetype_subset {
407 char *base_font;
408 double *widths;
409 double x_min, y_min, x_max, y_max;
410 double ascent, descent;
411 unsigned char *data;
412 unsigned long data_length;
413 unsigned long *string_offsets;
414 unsigned long num_string_offsets;
415 } cairo_truetype_subset_t;
418 * _cairo_truetype_subset_init:
419 * @truetype_subset: a #cairo_truetype_subset_t to initialize
420 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
422 * If possible (depending on the format of the underlying
423 * #cairo_scaled_font_t and the font backend in use) generate a
424 * truetype file corresponding to @font_subset and initialize
425 * @truetype_subset with information about the subset and the truetype
426 * data.
428 * Return value: %CAIRO_STATUS_SUCCESS if successful,
429 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a
430 * truetype file, or an non-zero value indicating an error. Possible
431 * errors include %CAIRO_STATUS_NO_MEMORY.
433 cairo_private cairo_status_t
434 _cairo_truetype_subset_init (cairo_truetype_subset_t *truetype_subset,
435 cairo_scaled_font_subset_t *font_subset);
438 * _cairo_truetype_subset_fini:
439 * @truetype_subset: a #cairo_truetype_subset_t
441 * Free all resources associated with @truetype_subset. After this
442 * call, @truetype_subset should not be used again without a
443 * subsequent call to _cairo_truetype_subset_init() again first.
445 cairo_private void
446 _cairo_truetype_subset_fini (cairo_truetype_subset_t *truetype_subset);
450 typedef struct _cairo_type1_subset {
451 char *base_font;
452 int *widths;
453 long x_min, y_min, x_max, y_max;
454 long ascent, descent;
455 char *data;
456 unsigned long header_length;
457 unsigned long data_length;
458 unsigned long trailer_length;
459 } cairo_type1_subset_t;
462 #if CAIRO_HAS_FT_FONT
465 * _cairo_type1_subset_init:
466 * @type1_subset: a #cairo_type1_subset_t to initialize
467 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
468 * @hex_encode: if true the encrypted portion of the font is hex encoded
470 * If possible (depending on the format of the underlying
471 * #cairo_scaled_font_t and the font backend in use) generate a type1
472 * file corresponding to @font_subset and initialize @type1_subset
473 * with information about the subset and the type1 data.
475 * Return value: %CAIRO_STATUS_SUCCESS if successful,
476 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a type1
477 * file, or an non-zero value indicating an error. Possible errors
478 * include %CAIRO_STATUS_NO_MEMORY.
480 cairo_private cairo_status_t
481 _cairo_type1_subset_init (cairo_type1_subset_t *type_subset,
482 const char *name,
483 cairo_scaled_font_subset_t *font_subset,
484 cairo_bool_t hex_encode);
487 * _cairo_type1_subset_fini:
488 * @type1_subset: a #cairo_type1_subset_t
490 * Free all resources associated with @type1_subset. After this call,
491 * @type1_subset should not be used again without a subsequent call to
492 * _cairo_truetype_type1_init() again first.
494 cairo_private void
495 _cairo_type1_subset_fini (cairo_type1_subset_t *subset);
497 #endif /* CAIRO_HAS_FT_FONT */
501 * _cairo_type1_scaled_font_is_type1:
502 * @scaled_font: a #cairo_scaled_font_t
504 * Return %TRUE if @scaled_font is a Type 1 font, otherwise return %FALSE.
506 cairo_private cairo_bool_t
507 _cairo_type1_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font);
510 * _cairo_type1_fallback_init_binary:
511 * @type1_subset: a #cairo_type1_subset_t to initialize
512 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
514 * If possible (depending on the format of the underlying
515 * #cairo_scaled_font_t and the font backend in use) generate a type1
516 * file corresponding to @font_subset and initialize @type1_subset
517 * with information about the subset and the type1 data. The encrypted
518 * part of the font is binary encoded.
520 * Return value: %CAIRO_STATUS_SUCCESS if successful,
521 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a type1
522 * file, or an non-zero value indicating an error. Possible errors
523 * include %CAIRO_STATUS_NO_MEMORY.
525 cairo_private cairo_status_t
526 _cairo_type1_fallback_init_binary (cairo_type1_subset_t *type_subset,
527 const char *name,
528 cairo_scaled_font_subset_t *font_subset);
531 * _cairo_type1_fallback_init_hexencode:
532 * @type1_subset: a #cairo_type1_subset_t to initialize
533 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
535 * If possible (depending on the format of the underlying
536 * #cairo_scaled_font_t and the font backend in use) generate a type1
537 * file corresponding to @font_subset and initialize @type1_subset
538 * with information about the subset and the type1 data. The encrypted
539 * part of the font is hex encoded.
541 * Return value: %CAIRO_STATUS_SUCCESS if successful,
542 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a type1
543 * file, or an non-zero value indicating an error. Possible errors
544 * include %CAIRO_STATUS_NO_MEMORY.
546 cairo_private cairo_status_t
547 _cairo_type1_fallback_init_hex (cairo_type1_subset_t *type_subset,
548 const char *name,
549 cairo_scaled_font_subset_t *font_subset);
552 * _cairo_type1_fallback_fini:
553 * @type1_subset: a #cairo_type1_subset_t
555 * Free all resources associated with @type1_subset. After this call,
556 * @type1_subset should not be used again without a subsequent call to
557 * _cairo_truetype_type1_init() again first.
559 cairo_private void
560 _cairo_type1_fallback_fini (cairo_type1_subset_t *subset);
562 typedef struct _cairo_type2_charstrings {
563 int *widths;
564 long x_min, y_min, x_max, y_max;
565 long ascent, descent;
566 cairo_array_t charstrings;
567 } cairo_type2_charstrings_t;
570 * _cairo_type2_charstrings_init:
571 * @type2_subset: a #cairo_type2_subset_t to initialize
572 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
574 * If possible (depending on the format of the underlying
575 * #cairo_scaled_font_t and the font backend in use) generate type2
576 * charstrings to @font_subset and initialize @type2_subset
577 * with information about the subset.
579 * Return value: %CAIRO_STATUS_SUCCESS if successful,
580 * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a type2
581 * charstrings, or an non-zero value indicating an error. Possible errors
582 * include %CAIRO_STATUS_NO_MEMORY.
584 cairo_private cairo_status_t
585 _cairo_type2_charstrings_init (cairo_type2_charstrings_t *charstrings,
586 cairo_scaled_font_subset_t *font_subset);
589 * _cairo_type2_charstrings_fini:
590 * @subset: a #cairo_type2_charstrings_t
592 * Free all resources associated with @type2_charstring. After this call,
593 * @type2_charstring should not be used again without a subsequent call to
594 * _cairo_type2_charstring_init() again first.
596 cairo_private void
597 _cairo_type2_charstrings_fini (cairo_type2_charstrings_t *charstrings);
600 * _cairo_truetype_create_glyph_to_unicode_map:
601 * @font_subset: the #cairo_scaled_font_subset_t to initialize from
603 * If possible (depending on the format of the underlying
604 * #cairo_scaled_font_t and the font backend in use) assign
605 * the unicode character of each glyph in font_subset to
606 * fontsubset->to_unicode.
608 * Return value: %CAIRO_STATUS_SUCCESS if successful,
609 * %CAIRO_INT_STATUS_UNSUPPORTED if the unicode encoding of
610 * the glyphs is not available. Possible errors include
611 * %CAIRO_STATUS_NO_MEMORY.
613 cairo_private cairo_int_status_t
614 _cairo_truetype_create_glyph_to_unicode_map (cairo_scaled_font_subset_t *font_subset);
617 * _cairo_truetype_index_to_ucs4:
618 * @scaled_font: the #cairo_scaled_font_t
619 * @index: the glyph index
620 * @ucs4: return value for the unicode value of the glyph
622 * If possible (depending on the format of the underlying
623 * #cairo_scaled_font_t and the font backend in use) assign
624 * the unicode character of the glyph to @ucs4.
626 * If mapping glyph indices to unicode is supported but the unicode
627 * value of the specified glyph is not available, @ucs4 is set to -1.
629 * Return value: %CAIRO_STATUS_SUCCESS if successful,
630 * %CAIRO_INT_STATUS_UNSUPPORTED if mapping glyph indices to unicode
631 * is not supported. Possible errors include %CAIRO_STATUS_NO_MEMORY.
633 cairo_private cairo_int_status_t
634 _cairo_truetype_index_to_ucs4 (cairo_scaled_font_t *scaled_font,
635 unsigned long index,
636 uint32_t *ucs4);
638 #endif /* CAIRO_HAS_FONT_SUBSET */
640 #endif /* CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H */