Rev 1892 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1892 | Rev 3959 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | unsigned int font_id; |
45 | unsigned int font_id; |
46 | unsigned int subset_id; |
46 | unsigned int subset_id; |
47 | unsigned int subset_glyph_index; |
47 | unsigned int subset_glyph_index; |
48 | cairo_bool_t is_scaled; |
48 | cairo_bool_t is_scaled; |
49 | cairo_bool_t is_composite; |
49 | cairo_bool_t is_composite; |
- | 50 | cairo_bool_t is_latin; |
|
50 | double x_advance; |
51 | double x_advance; |
51 | double y_advance; |
52 | double y_advance; |
52 | cairo_bool_t utf8_is_mapped; |
53 | cairo_bool_t utf8_is_mapped; |
53 | uint32_t unicode; |
54 | uint32_t unicode; |
54 | } cairo_scaled_font_subsets_glyph_t; |
55 | } cairo_scaled_font_subsets_glyph_t; |
Line 123... | Line 124... | ||
123 | **/ |
124 | **/ |
124 | cairo_private void |
125 | cairo_private void |
125 | _cairo_scaled_font_subsets_destroy (cairo_scaled_font_subsets_t *font_subsets); |
126 | _cairo_scaled_font_subsets_destroy (cairo_scaled_font_subsets_t *font_subsets); |
Line 126... | Line 127... | ||
126 | 127 | ||
- | 128 | /** |
|
- | 129 | * _cairo_scaled_font_subsets_enable_latin_subset: |
|
- | 130 | * @font_subsets: a #cairo_scaled_font_subsets_t object to be destroyed |
|
- | 131 | * @use_latin: a #cairo_bool_t indicating if a latin subset is to be used |
|
- | 132 | * |
|
- | 133 | * If enabled, all CP1252 characters will be placed in a separate |
|
- | 134 | * 8-bit latin subset. |
|
- | 135 | **/ |
|
- | 136 | cairo_private void |
|
- | 137 | _cairo_scaled_font_subsets_enable_latin_subset (cairo_scaled_font_subsets_t *font_subsets, |
|
- | 138 | cairo_bool_t use_latin); |
|
- | 139 | ||
127 | /** |
140 | /** |
128 | * _cairo_scaled_font_subsets_map_glyph: |
141 | * _cairo_scaled_font_subsets_map_glyph: |
129 | * @font_subsets: a #cairo_scaled_font_subsets_t |
142 | * @font_subsets: a #cairo_scaled_font_subsets_t |
130 | * @scaled_font: the font of the glyph to be mapped |
143 | * @scaled_font: the font of the glyph to be mapped |
131 | * @scaled_font_glyph_index: the index of the glyph to be mapped |
144 | * @scaled_font_glyph_index: the index of the glyph to be mapped |
Line 205... | Line 218... | ||
205 | unsigned long scaled_font_glyph_index, |
218 | unsigned long scaled_font_glyph_index, |
206 | const char * utf8, |
219 | const char * utf8, |
207 | int utf8_len, |
220 | int utf8_len, |
208 | cairo_scaled_font_subsets_glyph_t *subset_glyph_ret); |
221 | cairo_scaled_font_subsets_glyph_t *subset_glyph_ret); |
Line 209... | Line 222... | ||
209 | 222 | ||
210 | typedef cairo_status_t |
223 | typedef cairo_int_status_t |
211 | (*cairo_scaled_font_subset_callback_func_t) (cairo_scaled_font_subset_t *font_subset, |
224 | (*cairo_scaled_font_subset_callback_func_t) (cairo_scaled_font_subset_t *font_subset, |
Line 212... | Line 225... | ||
212 | void *closure); |
225 | void *closure); |
213 | 226 | ||
214 | /** |
227 | /** |
215 | * _cairo_scaled_font_subsets_foreach: |
228 | * _cairo_scaled_font_subsets_foreach_scaled: |
216 | * @font_subsets: a #cairo_scaled_font_subsets_t |
229 | * @font_subsets: a #cairo_scaled_font_subsets_t |
217 | * @font_subset_callback: a function to be called for each font subset |
230 | * @font_subset_callback: a function to be called for each font subset |
218 | * @closure: closure data for the callback function |
231 | * @closure: closure data for the callback function |
Line 330... | Line 343... | ||
330 | **/ |
343 | **/ |
331 | cairo_private cairo_int_status_t |
344 | cairo_private cairo_int_status_t |
332 | _cairo_scaled_font_subset_create_glyph_names (cairo_scaled_font_subset_t *subset); |
345 | _cairo_scaled_font_subset_create_glyph_names (cairo_scaled_font_subset_t *subset); |
Line 333... | Line 346... | ||
333 | 346 | ||
334 | typedef struct _cairo_cff_subset { |
347 | typedef struct _cairo_cff_subset { |
335 | char *font_name; |
348 | char *family_name_utf8; |
336 | char *ps_name; |
349 | char *ps_name; |
337 | double *widths; |
350 | double *widths; |
338 | double x_min, y_min, x_max, y_max; |
351 | double x_min, y_min, x_max, y_max; |
339 | double ascent, descent; |
352 | double ascent, descent; |
Line 372... | Line 385... | ||
372 | **/ |
385 | **/ |
373 | cairo_private void |
386 | cairo_private void |
374 | _cairo_cff_subset_fini (cairo_cff_subset_t *cff_subset); |
387 | _cairo_cff_subset_fini (cairo_cff_subset_t *cff_subset); |
Line 375... | Line 388... | ||
375 | 388 | ||
- | 389 | /** |
|
- | 390 | * _cairo_cff_scaled_font_is_cid_cff: |
|
- | 391 | * @scaled_font: a #cairo_scaled_font_t |
|
- | 392 | * |
|
- | 393 | * Return %TRUE if @scaled_font is a CID CFF font, otherwise return %FALSE. |
|
- | 394 | **/ |
|
- | 395 | cairo_private cairo_bool_t |
|
- | 396 | _cairo_cff_scaled_font_is_cid_cff (cairo_scaled_font_t *scaled_font); |
|
- | 397 | ||
376 | /** |
398 | /** |
377 | * _cairo_cff_fallback_init: |
399 | * _cairo_cff_fallback_init: |
378 | * @cff_subset: a #cairo_cff_subset_t to initialize |
400 | * @cff_subset: a #cairo_cff_subset_t to initialize |
379 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
401 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
380 | * |
402 | * |
Line 403... | Line 425... | ||
403 | **/ |
425 | **/ |
404 | cairo_private void |
426 | cairo_private void |
405 | _cairo_cff_fallback_fini (cairo_cff_subset_t *cff_subset); |
427 | _cairo_cff_fallback_fini (cairo_cff_subset_t *cff_subset); |
Line 406... | Line 428... | ||
406 | 428 | ||
407 | typedef struct _cairo_truetype_subset { |
429 | typedef struct _cairo_truetype_subset { |
408 | char *font_name; |
430 | char *family_name_utf8; |
409 | char *ps_name; |
431 | char *ps_name; |
410 | double *widths; |
432 | double *widths; |
411 | double x_min, y_min, x_max, y_max; |
433 | double x_min, y_min, x_max, y_max; |
412 | double ascent, descent; |
434 | double ascent, descent; |
Line 415... | Line 437... | ||
415 | unsigned long *string_offsets; |
437 | unsigned long *string_offsets; |
416 | unsigned long num_string_offsets; |
438 | unsigned long num_string_offsets; |
417 | } cairo_truetype_subset_t; |
439 | } cairo_truetype_subset_t; |
Line 418... | Line 440... | ||
418 | 440 | ||
419 | /** |
441 | /** |
420 | * _cairo_truetype_subset_init: |
442 | * _cairo_truetype_subset_init_ps: |
421 | * @truetype_subset: a #cairo_truetype_subset_t to initialize |
443 | * @truetype_subset: a #cairo_truetype_subset_t to initialize |
422 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
444 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
423 | * |
445 | * |
424 | * If possible (depending on the format of the underlying |
446 | * If possible (depending on the format of the underlying |
425 | * #cairo_scaled_font_t and the font backend in use) generate a |
447 | * #cairo_scaled_font_t and the font backend in use) generate a |
426 | * truetype file corresponding to @font_subset and initialize |
448 | * truetype file corresponding to @font_subset and initialize |
- | 449 | * @truetype_subset with information about the subset and the truetype |
|
427 | * @truetype_subset with information about the subset and the truetype |
450 | * data. The generated font will be suitable for embedding in |
428 | * data. |
451 | * PostScript. |
429 | * |
452 | * |
430 | * Return value: %CAIRO_STATUS_SUCCESS if successful, |
453 | * Return value: %CAIRO_STATUS_SUCCESS if successful, |
431 | * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a |
454 | * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a |
432 | * truetype file, or an non-zero value indicating an error. Possible |
455 | * truetype file, or an non-zero value indicating an error. Possible |
433 | * errors include %CAIRO_STATUS_NO_MEMORY. |
456 | * errors include %CAIRO_STATUS_NO_MEMORY. |
434 | **/ |
457 | **/ |
435 | cairo_private cairo_status_t |
458 | cairo_private cairo_status_t |
- | 459 | _cairo_truetype_subset_init_ps (cairo_truetype_subset_t *truetype_subset, |
|
- | 460 | cairo_scaled_font_subset_t *font_subset); |
|
- | 461 | ||
- | 462 | /** |
|
- | 463 | * _cairo_truetype_subset_init_pdf: |
|
- | 464 | * @truetype_subset: a #cairo_truetype_subset_t to initialize |
|
- | 465 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
|
- | 466 | * |
|
- | 467 | * If possible (depending on the format of the underlying |
|
- | 468 | * #cairo_scaled_font_t and the font backend in use) generate a |
|
- | 469 | * truetype file corresponding to @font_subset and initialize |
|
- | 470 | * @truetype_subset with information about the subset and the truetype |
|
- | 471 | * data. The generated font will be suitable for embedding in |
|
- | 472 | * PDF. |
|
- | 473 | * |
|
- | 474 | * Return value: %CAIRO_STATUS_SUCCESS if successful, |
|
- | 475 | * %CAIRO_INT_STATUS_UNSUPPORTED if the font can't be subset as a |
|
- | 476 | * truetype file, or an non-zero value indicating an error. Possible |
|
- | 477 | * errors include %CAIRO_STATUS_NO_MEMORY. |
|
- | 478 | **/ |
|
- | 479 | cairo_private cairo_status_t |
|
436 | _cairo_truetype_subset_init (cairo_truetype_subset_t *truetype_subset, |
480 | _cairo_truetype_subset_init_pdf (cairo_truetype_subset_t *truetype_subset, |
Line 437... | Line 481... | ||
437 | cairo_scaled_font_subset_t *font_subset); |
481 | cairo_scaled_font_subset_t *font_subset); |
438 | 482 | ||
439 | /** |
483 | /** |
Line 445... | Line 489... | ||
445 | * subsequent call to _cairo_truetype_subset_init() again first. |
489 | * subsequent call to _cairo_truetype_subset_init() again first. |
446 | **/ |
490 | **/ |
447 | cairo_private void |
491 | cairo_private void |
448 | _cairo_truetype_subset_fini (cairo_truetype_subset_t *truetype_subset); |
492 | _cairo_truetype_subset_fini (cairo_truetype_subset_t *truetype_subset); |
Line -... | Line 493... | ||
- | 493 | ||
- | 494 | cairo_private const char * |
|
- | 495 | _cairo_ps_standard_encoding_to_glyphname (int glyph); |
|
- | 496 | ||
- | 497 | cairo_private int |
|
Line -... | Line 498... | ||
- | 498 | _cairo_unicode_to_winansi (unsigned long unicode); |
|
- | 499 | ||
Line 449... | Line 500... | ||
449 | 500 | cairo_private const char * |
|
450 | 501 | _cairo_winansi_to_glyphname (int glyph); |
|
451 | 502 | ||
452 | typedef struct _cairo_type1_subset { |
503 | typedef struct _cairo_type1_subset { |
Line 459... | Line 510... | ||
459 | unsigned long data_length; |
510 | unsigned long data_length; |
460 | unsigned long trailer_length; |
511 | unsigned long trailer_length; |
461 | } cairo_type1_subset_t; |
512 | } cairo_type1_subset_t; |
Line 462... | Line -... | ||
462 | - | ||
463 | - | ||
464 | #if CAIRO_HAS_FT_FONT |
513 | |
465 | 514 | ||
466 | /** |
515 | /** |
467 | * _cairo_type1_subset_init: |
516 | * _cairo_type1_subset_init: |
468 | * @type1_subset: a #cairo_type1_subset_t to initialize |
517 | * @type1_subset: a #cairo_type1_subset_t to initialize |
Line 494... | Line 543... | ||
494 | * _cairo_truetype_type1_init() again first. |
543 | * _cairo_truetype_type1_init() again first. |
495 | **/ |
544 | **/ |
496 | cairo_private void |
545 | cairo_private void |
497 | _cairo_type1_subset_fini (cairo_type1_subset_t *subset); |
546 | _cairo_type1_subset_fini (cairo_type1_subset_t *subset); |
Line 498... | Line -... | ||
498 | - | ||
499 | #endif /* CAIRO_HAS_FT_FONT */ |
- | |
500 | - | ||
501 | 547 | ||
502 | /** |
548 | /** |
503 | * _cairo_type1_scaled_font_is_type1: |
549 | * _cairo_type1_scaled_font_is_type1: |
504 | * @scaled_font: a #cairo_scaled_font_t |
550 | * @scaled_font: a #cairo_scaled_font_t |
505 | * |
551 | * |
Line 528... | Line 574... | ||
528 | _cairo_type1_fallback_init_binary (cairo_type1_subset_t *type_subset, |
574 | _cairo_type1_fallback_init_binary (cairo_type1_subset_t *type_subset, |
529 | const char *name, |
575 | const char *name, |
530 | cairo_scaled_font_subset_t *font_subset); |
576 | cairo_scaled_font_subset_t *font_subset); |
Line 531... | Line 577... | ||
531 | 577 | ||
532 | /** |
578 | /** |
533 | * _cairo_type1_fallback_init_hexencode: |
579 | * _cairo_type1_fallback_init_hex: |
534 | * @type1_subset: a #cairo_type1_subset_t to initialize |
580 | * @type1_subset: a #cairo_type1_subset_t to initialize |
535 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
581 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
536 | * |
582 | * |
537 | * If possible (depending on the format of the underlying |
583 | * If possible (depending on the format of the underlying |
Line 597... | Line 643... | ||
597 | **/ |
643 | **/ |
598 | cairo_private void |
644 | cairo_private void |
599 | _cairo_type2_charstrings_fini (cairo_type2_charstrings_t *charstrings); |
645 | _cairo_type2_charstrings_fini (cairo_type2_charstrings_t *charstrings); |
Line 600... | Line 646... | ||
600 | 646 | ||
601 | /** |
- | |
602 | * _cairo_truetype_create_glyph_to_unicode_map: |
- | |
603 | * @font_subset: the #cairo_scaled_font_subset_t to initialize from |
- | |
604 | * |
- | |
605 | * If possible (depending on the format of the underlying |
- | |
606 | * #cairo_scaled_font_t and the font backend in use) assign |
- | |
607 | * the unicode character of each glyph in font_subset to |
- | |
608 | * fontsubset->to_unicode. |
- | |
609 | * |
- | |
610 | * Return value: %CAIRO_STATUS_SUCCESS if successful, |
- | |
611 | * %CAIRO_INT_STATUS_UNSUPPORTED if the unicode encoding of |
- | |
612 | * the glyphs is not available. Possible errors include |
- | |
613 | * %CAIRO_STATUS_NO_MEMORY. |
- | |
614 | **/ |
- | |
615 | cairo_private cairo_int_status_t |
- | |
616 | _cairo_truetype_create_glyph_to_unicode_map (cairo_scaled_font_subset_t *font_subset); |
- | |
617 | - | ||
618 | /** |
647 | /** |
619 | * _cairo_truetype_index_to_ucs4: |
648 | * _cairo_truetype_index_to_ucs4: |
620 | * @scaled_font: the #cairo_scaled_font_t |
649 | * @scaled_font: the #cairo_scaled_font_t |
621 | * @index: the glyph index |
650 | * @index: the glyph index |
622 | * @ucs4: return value for the unicode value of the glyph |
651 | * @ucs4: return value for the unicode value of the glyph |
Line 661... | Line 690... | ||
661 | cairo_private cairo_int_status_t |
690 | cairo_private cairo_int_status_t |
662 | _cairo_truetype_read_font_name (cairo_scaled_font_t *scaled_font, |
691 | _cairo_truetype_read_font_name (cairo_scaled_font_t *scaled_font, |
663 | char **ps_name, |
692 | char **ps_name, |
664 | char **font_name); |
693 | char **font_name); |
Line -... | Line 694... | ||
- | 694 | ||
- | 695 | /** |
|
- | 696 | * _cairo_truetype_get_style: |
|
- | 697 | * @scaled_font: the #cairo_scaled_font_t |
|
- | 698 | * @weight: returns the font weight from the OS/2 table |
|
- | 699 | * @bold: returns true if font is bold |
|
- | 700 | * @italic: returns true if font is italic |
|
- | 701 | * |
|
- | 702 | * If the font is a truetype/opentype font with an OS/2 table, get the |
|
- | 703 | * weight, bold, and italic data from the OS/2 table. The weight |
|
- | 704 | * values have the same meaning as the lfWeight field of the Windows |
|
- | 705 | * LOGFONT structure. Refer to the TrueType Specification for |
|
- | 706 | * definition of the weight values. |
|
- | 707 | * |
|
- | 708 | * Return value: %CAIRO_STATUS_SUCCESS if successful, |
|
- | 709 | * %CAIRO_INT_STATUS_UNSUPPORTED if the font is not TrueType/OpenType |
|
- | 710 | * or the OS/2 table is not present. |
|
- | 711 | **/ |
|
- | 712 | cairo_private cairo_int_status_t |
|
- | 713 | _cairo_truetype_get_style (cairo_scaled_font_t *scaled_font, |
|
- | 714 | int *weight, |
|
- | 715 | cairo_bool_t *bold, |
|
- | 716 | cairo_bool_t *italic); |
|
665 | 717 | ||
Line 666... | Line 718... | ||
666 | #endif /* CAIRO_HAS_FONT_SUBSET */ |
718 | #endif /* CAIRO_HAS_FONT_SUBSET */ |