Lines Matching refs:cmap
5 /* TrueType character mapping table (cmap) support (body). */
55 tt_cmap_init( TT_CMap cmap,
58 cmap->data = table;
118 tt_cmap0_char_index( TT_CMap cmap,
121 FT_Byte* table = cmap->data;
129 tt_cmap0_char_next( TT_CMap cmap,
132 FT_Byte* table = cmap->data;
155 tt_cmap0_get_info( TT_CMap cmap,
158 FT_Byte* p = cmap->data + 4;
273 /* outside of the CMap). */
430 tt_cmap2_char_index( TT_CMap cmap,
433 FT_Byte* table = cmap->data;
468 tt_cmap2_char_next( TT_CMap cmap,
471 FT_Byte* table = cmap->data;
535 tt_cmap2_get_info( TT_CMap cmap,
538 FT_Byte* p = cmap->data + 4;
645 TT_CMapRec cmap;
660 tt_cmap4_init( TT_CMap4 cmap,
666 cmap->cmap.data = table;
669 cmap->num_ranges = FT_PEEK_USHORT( p ) >> 1;
670 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
671 cmap->cur_gindex = 0;
678 tt_cmap4_set_range( TT_CMap4 cmap,
681 FT_Byte* table = cmap->cmap.data;
683 FT_UInt num_ranges = cmap->num_ranges;
692 cmap->cur_end = FT_PEEK_USHORT( p );
695 cmap->cur_start = FT_PEEK_USHORT( p );
698 cmap->cur_delta = FT_PEEK_SHORT( p );
706 cmap->cur_start == 0xFFFFU &&
707 cmap->cur_end == 0xFFFFU )
709 TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face;
715 cmap->cur_delta = 1;
722 cmap->cur_values = offset ? p + offset : NULL;
723 cmap->cur_range = range_index;
735 /* search the index of the charcode next to cmap->cur_charcode; */
740 tt_cmap4_next( TT_CMap4 cmap )
745 if ( cmap->cur_charcode >= 0xFFFFUL )
748 charcode = (FT_UInt)cmap->cur_charcode + 1;
750 if ( charcode < cmap->cur_start )
751 charcode = cmap->cur_start;
755 FT_Byte* values = cmap->cur_values;
756 FT_UInt end = cmap->cur_end;
757 FT_Int delta = cmap->cur_delta;
764 FT_Byte* p = values + 2 * ( charcode - cmap->cur_start );
777 cmap->cur_charcode = charcode;
778 cmap->cur_gindex = gindex;
793 cmap->cur_charcode = charcode;
794 cmap->cur_gindex = gindex;
802 if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )
805 if ( charcode < cmap->cur_start )
806 charcode = cmap->cur_start;
810 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
811 cmap->cur_gindex = 0;
947 /* a cmap 4 is versatile and could be used for any */
954 /* routines which actually access the cmap. */
985 /* to mean missing glyph in cmap table */
1003 tt_cmap4_char_map_linear( TT_CMap cmap,
1015 p = cmap->data + 6;
1032 p = cmap->data + 14; /* ends table */
1033 q = cmap->data + 16 + num_segs2; /* starts table */
1052 TT_Face face = (TT_Face)cmap->cmap.charmap.face;
1092 tt_cmap4_char_map_binary( TT_CMap cmap,
1104 p = cmap->data + 6;
1126 p = cmap->data + 14 + mid * 2;
1147 TT_Face face = (TT_Face)cmap->cmap.charmap.face;
1159 if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING )
1178 p = cmap->data + 14 + ( i - 1 ) * 2;
1204 p = cmap->data + 14 + max * 2;
1222 p = cmap->data + 14 + i * 2;
1254 p = cmap->data + 14 + mid * 2;
1286 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1328 tt_cmap4_char_index( TT_CMap cmap,
1334 if ( cmap->flags & TT_CMAP_FLAG_UNSORTED )
1335 return tt_cmap4_char_map_linear( cmap, &char_code, 0 );
1337 return tt_cmap4_char_map_binary( cmap, &char_code, 0 );
1342 tt_cmap4_char_next( TT_CMap cmap,
1351 if ( cmap->flags & TT_CMAP_FLAG_UNSORTED )
1352 gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );
1355 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1367 gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );
1375 tt_cmap4_get_info( TT_CMap cmap,
1378 FT_Byte* p = cmap->data + 4;
1476 tt_cmap6_char_index( TT_CMap cmap,
1479 FT_Byte* table = cmap->data;
1497 tt_cmap6_char_next( TT_CMap cmap,
1500 FT_Byte* table = cmap->data;
1538 tt_cmap6_get_info( TT_CMap cmap,
1541 FT_Byte* p = cmap->data + 4;
1724 tt_cmap8_char_index( TT_CMap cmap,
1727 FT_Byte* table = cmap->data;
1754 tt_cmap8_char_next( TT_CMap cmap,
1760 FT_Byte* table = cmap->data;
1795 tt_cmap8_get_info( TT_CMap cmap,
1798 FT_Byte* p = cmap->data + 8;
1895 tt_cmap10_char_index( TT_CMap cmap,
1898 FT_Byte* table = cmap->data;
1916 tt_cmap10_char_next( TT_CMap cmap,
1919 FT_Byte* table = cmap->data;
1948 tt_cmap10_get_info( TT_CMap cmap,
1951 FT_Byte* p = cmap->data + 8;
2016 TT_CMapRec cmap;
2027 tt_cmap12_init( TT_CMap12 cmap,
2030 cmap->cmap.data = table;
2033 cmap->num_groups = FT_PEEK_ULONG( table );
2035 cmap->valid = 0;
2094 /* search the index of the charcode next to cmap->cur_charcode */
2095 /* cmap->cur_group should be set up properly by caller */
2098 tt_cmap12_next( TT_CMap12 cmap )
2106 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2109 char_code = cmap->cur_charcode + 1;
2111 n = cmap->cur_group;
2113 for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
2115 p = cmap->cmap.data + 16 + 12 * n;
2129 cmap->cur_charcode = char_code;;
2130 cmap->cur_gindex = gindex;
2131 cmap->cur_group = n;
2139 cmap->valid = 0;
2144 tt_cmap12_char_map_binary( TT_CMap cmap,
2149 FT_Byte* p = cmap->data + 12;
2173 p = cmap->data + 16 + 12 * mid;
2193 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2230 tt_cmap12_char_index( TT_CMap cmap,
2233 return tt_cmap12_char_map_binary( cmap, &char_code, 0 );
2238 tt_cmap12_char_next( TT_CMap cmap,
2241 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2264 gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
2272 tt_cmap12_get_info( TT_CMap cmap,
2275 FT_Byte* p = cmap->data + 8;
2340 TT_CMapRec cmap;
2351 tt_cmap13_init( TT_CMap13 cmap,
2354 cmap->cmap.data = table;
2357 cmap->num_groups = FT_PEEK_ULONG( table );
2359 cmap->valid = 0;
2418 /* search the index of the charcode next to cmap->cur_charcode */
2419 /* cmap->cur_group should be set up properly by caller */
2422 tt_cmap13_next( TT_CMap13 cmap )
2430 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2433 char_code = cmap->cur_charcode + 1;
2435 n = cmap->cur_group;
2437 for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
2439 p = cmap->cmap.data + 16 + 12 * n;
2453 cmap->cur_charcode = char_code;;
2454 cmap->cur_gindex = gindex;
2455 cmap->cur_group = n;
2463 cmap->valid = 0;
2468 tt_cmap13_char_map_binary( TT_CMap cmap,
2473 FT_Byte* p = cmap->data + 12;
2497 p = cmap->data + 16 + 12 * mid;
2516 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2552 tt_cmap13_char_index( TT_CMap cmap,
2555 return tt_cmap13_char_map_binary( cmap, &char_code, 0 );
2560 tt_cmap13_char_next( TT_CMap cmap,
2563 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2584 gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );
2591 tt_cmap13_get_info( TT_CMap cmap,
2594 FT_Byte* p = cmap->data + 8;
2653 /* standard cmap, with GIDs here */
2659 /* ranges of code points which are to be found in the standard cmap. No */
2691 TT_CMapRec cmap;
2695 * cmap 14 query functions. The data is overwritten
2706 tt_cmap14_done( TT_CMap14 cmap )
2708 FT_Memory memory = cmap->memory;
2711 cmap->max_results = 0;
2712 if ( memory != NULL && cmap->results != NULL )
2713 FT_FREE( cmap->results );
2718 tt_cmap14_ensure( TT_CMap14 cmap,
2722 FT_UInt32 old_max = cmap->max_results;
2726 if ( num_results > cmap->max_results )
2728 cmap->memory = memory;
2730 if ( FT_QRENEW_ARRAY( cmap->results, old_max, num_results ) )
2733 cmap->max_results = num_results;
2741 tt_cmap14_init( TT_CMap14 cmap,
2744 cmap->cmap.data = table;
2747 cmap->num_selectors = FT_PEEK_ULONG( table );
2748 cmap->max_results = 0;
2749 cmap->results = NULL;
2792 /* through the normal Unicode cmap, no GIDs, just check order) */
2858 tt_cmap14_char_index( TT_CMap cmap,
2861 FT_UNUSED( cmap );
2870 tt_cmap14_char_next( TT_CMap cmap,
2873 FT_UNUSED( cmap );
2882 tt_cmap14_get_info( TT_CMap cmap,
2885 FT_UNUSED( cmap );
2996 tt_cmap14_char_var_index( TT_CMap cmap,
3001 FT_Byte* p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
3013 tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) )
3017 return ucmap->cmap.clazz->char_index( &ucmap->cmap, charcode );
3021 return tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,
3029 tt_cmap14_char_var_isdefault( TT_CMap cmap,
3033 FT_Byte* p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
3045 tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) )
3049 tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,
3058 tt_cmap14_variants( TT_CMap cmap,
3061 TT_CMap14 cmap14 = (TT_CMap14)cmap;
3063 FT_Byte* p = cmap->data + 10;
3084 tt_cmap14_char_variants( TT_CMap cmap,
3088 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3090 FT_Byte* p = cmap->data + 10;
3105 tt_cmap14_char_map_def_binary( cmap->data + defOff,
3108 tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,
3140 tt_cmap14_get_def_chars( TT_CMap cmap,
3144 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3177 tt_cmap14_get_nondef_chars( TT_CMap cmap,
3181 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3205 tt_cmap14_variant_chars( TT_CMap cmap,
3209 FT_Byte *p = tt_cmap14_find_variant( cmap->data + 6,
3227 return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff,
3230 return tt_cmap14_get_def_chars( cmap, cmap->data + defOff,
3236 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3246 p = cmap->data + nondefOff;
3247 dp = cmap->data + defOff;
3254 return tt_cmap14_get_def_chars( cmap, cmap->data + defOff,
3257 return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff,
3429 /* parse the `cmap' table and build the corresponding TT_CMap objects */
3452 " unsupported `cmap' table format = %d\n",
3461 FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables (%d)\n"
3481 FT_Byte* volatile cmap = table + offset;
3482 volatile FT_UInt format = TT_PEEK_USHORT( cmap );
3496 ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,
3503 /* validate this cmap sub-table */
3504 error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );
3513 /* selector cmap somewhere special. But it would have to be */
3517 cmap, &charmap, &ttcmap ) )
3527 " broken cmap sub-table ignored\n" ));
3536 " unsupported cmap sub-table ignored\n" ));
3549 FT_CMap cmap = (FT_CMap)charmap;
3550 TT_CMap_Class clazz = (TT_CMap_Class)cmap->clazz;