20#include FT_INTERNAL_DEBUG_H
24#include FT_INTERNAL_VALIDATE_H
25#include FT_INTERNAL_STREAM_H
26#include FT_SERVICE_POSTSCRIPT_CMAPS_H
39#define FT_COMPONENT ttcmap
42#define TT_PEEK_SHORT FT_PEEK_SHORT
43#define TT_PEEK_USHORT FT_PEEK_USHORT
44#define TT_PEEK_UINT24 FT_PEEK_UOFF3
45#define TT_PEEK_LONG FT_PEEK_LONG
46#define TT_PEEK_ULONG FT_PEEK_ULONG
48#define TT_NEXT_SHORT FT_NEXT_SHORT
49#define TT_NEXT_USHORT FT_NEXT_USHORT
50#define TT_NEXT_UINT24 FT_NEXT_UOFF3
51#define TT_NEXT_LONG FT_NEXT_LONG
52#define TT_NEXT_ULONG FT_NEXT_ULONG
93#ifdef TT_CONFIG_CMAP_FORMAT_0
119 for (
n = 0;
n < 256;
n++ )
132 tt_cmap0_char_index(
TT_CMap cmap,
133 FT_UInt32 char_code )
138 return char_code < 256 ?
table[6 + char_code] : 0;
143 tt_cmap0_char_next(
TT_CMap cmap,
144 FT_UInt32 *pchar_code )
147 FT_UInt32 charcode = *pchar_code;
153 while ( ++charcode < 256 )
155 gindex =
table[charcode];
169 tt_cmap0_get_info(
TT_CMap cmap,
292#ifdef TT_CONFIG_CMAP_FORMAT_2
321 for (
n = 0;
n < 256;
n++ )
332 if (
idx > max_subs )
339 glyph_ids = subs + ( max_subs + 1 ) * 8;
340 if ( glyph_ids >
valid->limit )
344 for (
n = 0;
n <= max_subs;
n++ )
356 if ( code_count == 0 )
362 if ( first_code >= 256 || code_count > 256 - first_code )
373 if ( ids < glyph_ids || ids + code_count * 2 >
table +
length )
405 FT_UInt32 char_code )
410 if ( char_code < 0x10000UL )
457 tt_cmap2_char_index(
TT_CMap cmap,
458 FT_UInt32 char_code )
465 subheader = tt_cmap2_get_subheader(
table, char_code );
496 tt_cmap2_char_next(
TT_CMap cmap,
497 FT_UInt32 *pcharcode )
502 FT_UInt32 charcode = *pcharcode + 1;
506 while ( charcode < 0x10000UL )
508 subheader = tt_cmap2_get_subheader(
table, charcode );
520 if ( char_lo >=
start +
count && charcode <= 0xFF )
529 if ( charcode == 0x100 )
534 if ( char_lo <
start )
569 if ( charcode <= 0xFF )
583 tt_cmap2_get_info(
TT_CMap cmap,
691#ifdef TT_CONFIG_CMAP_FORMAT_4
693 typedef struct TT_CMap4Rec_
696 FT_UInt32 cur_charcode;
706 } TT_CMap4Rec, *TT_CMap4;
710 tt_cmap4_init( TT_CMap4 cmap,
716 cmap->cmap.data =
table;
720 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
721 cmap->cur_gindex = 0;
728 tt_cmap4_set_range( TT_CMap4 cmap,
733 FT_UInt num_ranges = cmap->num_ranges;
736 while ( range_index < num_ranges )
741 p =
table + 14 + range_index * 2;
744 p += 2 + num_ranges * 2;
755 if ( range_index >= num_ranges - 1 &&
756 cmap->cur_start == 0xFFFFU &&
757 cmap->cur_end == 0xFFFFU )
773 cmap->cur_range = range_index;
790 tt_cmap4_next( TT_CMap4 cmap )
798 if ( cmap->cur_charcode >= 0xFFFFUL )
801 charcode = (
FT_UInt)cmap->cur_charcode + 1;
803 if ( charcode < cmap->cur_start )
804 charcode = cmap->cur_start;
810 FT_Int delta = cmap->cur_delta;
813 if ( charcode <=
end )
834 cmap->cur_charcode = charcode;
835 cmap->cur_gindex = gindex;
839 }
while ( ++charcode <=
end );
855 if ( (
FT_Int)charcode + delta < 0 &&
857 charcode = (
FT_UInt)( -delta );
859 else if ( (
FT_Int)charcode + delta < 0x10000L &&
861 charcode = (
FT_UInt)( 0x10000L - delta );
869 cmap->cur_charcode = charcode;
870 cmap->cur_gindex = gindex;
873 }
while ( ++charcode <=
end );
879 if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )
882 if ( charcode < cmap->cur_start )
883 charcode = cmap->cur_start;
887 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
888 cmap->cur_gindex = 0;
935 if (
length < 16 + num_segs * 2 * 4 )
948 if ( ( search_range | range_shift ) & 1 )
956 if ( search_range > num_segs ||
957 search_range * 2 < num_segs ||
958 search_range + range_shift != num_segs ||
959 search_range != ( 1U << entry_selector ) )
964 starts =
table + 16 + num_segs * 2;
965 deltas = starts + num_segs * 2;
966 offsets = deltas + num_segs * 2;
967 glyph_ids =
offsets + num_segs * 2;
972 p =
ends + ( num_segs - 1 ) * 2;
979 FT_UInt last_start = 0, last_end = 0;
987 for (
n = 0;
n < num_segs;
n++ )
1002 if ( start <= last_end && n > 0 )
1011 if ( last_start >
start || last_end >
end )
1025 if (
p < glyph_ids ||
1039 else if (
n != num_segs - 1 ||
1040 !(
start == 0xFFFFU &&
end == 0xFFFFU ) )
1042 if (
p < glyph_ids ||
1066 else if (
offset == 0xFFFFU )
1072 n != num_segs - 1 ||
1073 !(
start == 0xFFFFU &&
end == 0xFFFFU ) )
1087 tt_cmap4_char_map_linear(
TT_CMap cmap,
1088 FT_UInt32* pcharcode,
1098 FT_UInt32 charcode = *pcharcode;
1107 num_segs = num_segs2 >> 1;
1115 if ( charcode > 0xFFFFU )
1119 p = cmap->
data + 14;
1120 q = cmap->
data + 16 + num_segs2;
1122 for (
i = 0;
i < num_segs;
i++ )
1127 if ( charcode <
start )
1136 if ( charcode <=
end )
1141 r =
q - 2 + num_segs2;
1148 if (
i >= num_segs - 1 &&
1149 start == 0xFFFFU &&
end == 0xFFFFU )
1188 if ( (
FT_Int)charcode + delta < 0 &&
1190 charcode = (
FT_UInt)( -delta );
1192 else if ( (
FT_Int)charcode + delta < 0x10000L &&
1194 charcode = (
FT_UInt)( 0x10000L - delta );
1201 if (
next && !gindex )
1203 if ( charcode >= 0xFFFFU )
1215 *pcharcode = charcode;
1222 tt_cmap4_char_map_binary(
TT_CMap cmap,
1223 FT_UInt32* pcharcode,
1244 FT_ERROR((
"Bad cmap table number. Probable update font error in file\n"
1245 "'%s'\nPlease reboot and try again.\n", __FILE__ ));
1258 num_segs = num_segs2 >> 1;
1273 mid = (
min +
max ) >> 1;
1274 p = cmap->
data + 14 + mid * 2;
1279 if ( charcode <
start )
1281 else if ( charcode >
end )
1292 if ( mid >= num_segs - 1 &&
1293 start == 0xFFFFU &&
end == 0xFFFFU )
1315 for (
i =
max;
i > 0;
i-- )
1322 p = cmap->
data + 14 + (
i - 1 ) * 2;
1325 if ( charcode > prev_end )
1344 if ( mid ==
max + 1 )
1361 for (
i =
max + 1;
i < num_segs;
i++ )
1366 p = cmap->
data + 14 +
i * 2;
1371 if ( charcode < next_start )
1398 p = cmap->
data + 14 + mid * 2;
1441 if ( (
FT_Int)charcode + delta < 0 &&
1443 charcode = (
FT_UInt)( -delta );
1445 else if ( (
FT_Int)charcode + delta < 0x10000L &&
1447 charcode = (
FT_UInt)( 0x10000L - delta );
1457 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1463 if ( charcode >
end )
1466 if ( mid == num_segs )
1470 if ( tt_cmap4_set_range( cmap4, mid ) )
1473 *pcharcode = charcode;
1477 cmap4->cur_charcode = charcode;
1480 cmap4->cur_gindex = gindex;
1483 cmap4->cur_charcode = charcode;
1484 tt_cmap4_next( cmap4 );
1485 gindex = cmap4->cur_gindex;
1489 *pcharcode = cmap4->cur_charcode;
1498 tt_cmap4_char_index(
TT_CMap cmap,
1499 FT_UInt32 char_code )
1501 if ( char_code >= 0x10000UL )
1505 return tt_cmap4_char_map_linear( cmap, &char_code, 0 );
1507 return tt_cmap4_char_map_binary( cmap, &char_code, 0 );
1512 tt_cmap4_char_next(
TT_CMap cmap,
1513 FT_UInt32 *pchar_code )
1518 if ( *pchar_code >= 0xFFFFU )
1522 gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );
1525 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1529 if ( *pchar_code == cmap4->cur_charcode )
1531 tt_cmap4_next( cmap4 );
1532 gindex = cmap4->cur_gindex;
1534 *pchar_code = cmap4->cur_charcode;
1537 gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );
1545 tt_cmap4_get_info(
TT_CMap cmap,
1561 sizeof ( TT_CMap4Rec ),
1608#ifdef TT_CONFIG_CMAP_FORMAT_6
1649 tt_cmap6_char_index(
TT_CMap cmap,
1650 FT_UInt32 char_code )
1671 tt_cmap6_char_next(
TT_CMap cmap,
1672 FT_UInt32 *pchar_code )
1676 FT_UInt32 char_code = *pchar_code + 1;
1685 if ( char_code >= 0x10000UL )
1688 if ( char_code <
start )
1703 if ( char_code >= 0xFFFFU )
1715 tt_cmap6_get_info(
TT_CMap cmap,
1806#ifdef TT_CONFIG_CMAP_FORMAT_8
1815 FT_UInt32 num_groups;
1830 if ( num_groups > (FT_UInt32)(
valid->limit -
p ) / 12 )
1838 for (
n = 0;
n < num_groups;
n++ )
1865 if (
start & ~0xFFFFU )
1874 if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )
1877 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )
1887 if (
end & ~0xFFFFU )
1894 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )
1909 tt_cmap8_char_index(
TT_CMap cmap,
1910 FT_UInt32 char_code )
1919 for ( ; num_groups > 0; num_groups-- )
1925 if ( char_code <
start )
1928 if ( char_code <=
end )
1930 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1942 tt_cmap8_char_next(
TT_CMap cmap,
1943 FT_UInt32 *pchar_code )
1947 FT_UInt32 char_code;
1955 if ( *pchar_code >= 0xFFFFFFFFUL )
1958 char_code = *pchar_code + 1;
1962 for ( ; num_groups > 0; num_groups-- )
1968 if ( char_code <
start )
1972 if ( char_code <=
end )
1975 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1978 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
1983 if ( char_code >= 0xFFFFFFFFUL )
2009 tt_cmap8_get_info(
TT_CMap cmap,
2071#ifdef TT_CONFIG_CMAP_FORMAT_10
2113 tt_cmap10_char_index(
TT_CMap cmap,
2114 FT_UInt32 char_code )
2124 if ( char_code <
start )
2140 tt_cmap10_char_next(
TT_CMap cmap,
2141 FT_UInt32 *pchar_code )
2144 FT_UInt32 char_code;
2152 if ( *pchar_code >= 0xFFFFFFFFUL )
2155 char_code = *pchar_code + 1;
2157 if ( char_code <
start )
2169 if ( char_code >= 0xFFFFFFFFUL )
2175 *pchar_code = char_code;
2181 tt_cmap10_get_info(
TT_CMap cmap,
2195 tt_cmap10_class_rec,
2247#ifdef TT_CONFIG_CMAP_FORMAT_12
2249 typedef struct TT_CMap12Rec_
2258 } TT_CMap12Rec, *TT_CMap12;
2262 tt_cmap12_init( TT_CMap12 cmap,
2265 cmap->cmap.data =
table;
2297 (
length - 16 ) / 12 < num_groups )
2305 for (
n = 0;
n < num_groups;
n++ )
2340 tt_cmap12_next( TT_CMap12 cmap )
2349 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2352 char_code = cmap->cur_charcode + 1;
2354 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2356 p = cmap->cmap.data + 16 + 12 *
n;
2361 if ( char_code <
start )
2365 if ( char_code <=
end )
2368 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2371 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2376 if ( char_code >= 0xFFFFFFFFUL )
2391 cmap->cur_charcode = char_code;
2392 cmap->cur_gindex = gindex;
2393 cmap->cur_group =
n;
2405 tt_cmap12_char_map_binary(
TT_CMap cmap,
2406 FT_UInt32* pchar_code,
2412 FT_UInt32 char_code = *pchar_code;
2426 if ( char_code >= 0xFFFFFFFFUL )
2438 mid = (
min +
max ) >> 1;
2439 p = cmap->
data + 16 + 12 * mid;
2444 if ( char_code <
start )
2446 else if ( char_code >
end )
2453 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2456 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2464 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2470 if ( char_code >
end )
2473 if ( mid == num_groups )
2478 cmap12->cur_charcode = char_code;
2479 cmap12->cur_group = mid;
2486 tt_cmap12_next( cmap12 );
2488 if ( cmap12->valid )
2489 gindex = cmap12->cur_gindex;
2492 cmap12->cur_gindex = gindex;
2494 *pchar_code = cmap12->cur_charcode;
2502 tt_cmap12_char_index(
TT_CMap cmap,
2503 FT_UInt32 char_code )
2505 return tt_cmap12_char_map_binary( cmap, &char_code, 0 );
2510 tt_cmap12_char_next(
TT_CMap cmap,
2511 FT_UInt32 *pchar_code )
2513 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2518 if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )
2520 tt_cmap12_next( cmap12 );
2521 if ( cmap12->valid )
2523 gindex = cmap12->cur_gindex;
2524 *pchar_code = (FT_UInt32)cmap12->cur_charcode;
2530 gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
2537 tt_cmap12_get_info(
TT_CMap cmap,
2551 tt_cmap12_class_rec,
2553 sizeof ( TT_CMap12Rec ),
2603#ifdef TT_CONFIG_CMAP_FORMAT_13
2605 typedef struct TT_CMap13Rec_
2614 } TT_CMap13Rec, *TT_CMap13;
2618 tt_cmap13_init( TT_CMap13 cmap,
2621 cmap->cmap.data =
table;
2653 (
length - 16 ) / 12 < num_groups )
2661 for (
n = 0;
n < num_groups;
n++ )
2691 tt_cmap13_next( TT_CMap13 cmap )
2700 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2703 char_code = cmap->cur_charcode + 1;
2705 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2707 p = cmap->cmap.data + 16 + 12 *
n;
2712 if ( char_code <
start )
2715 if ( char_code <=
end )
2719 if ( gindex && gindex < (
FT_UInt)
face->num_glyphs )
2721 cmap->cur_charcode = char_code;
2722 cmap->cur_gindex = gindex;
2723 cmap->cur_group =
n;
2736 tt_cmap13_char_map_binary(
TT_CMap cmap,
2737 FT_UInt32* pchar_code,
2743 FT_UInt32 char_code = *pchar_code;
2757 if ( char_code >= 0xFFFFFFFFUL )
2769 mid = (
min +
max ) >> 1;
2770 p = cmap->
data + 16 + 12 * mid;
2775 if ( char_code <
start )
2777 else if ( char_code >
end )
2790 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2796 if ( char_code >
end )
2799 if ( mid == num_groups )
2804 cmap13->cur_charcode = char_code;
2805 cmap13->cur_group = mid;
2812 tt_cmap13_next( cmap13 );
2814 if ( cmap13->valid )
2815 gindex = cmap13->cur_gindex;
2818 cmap13->cur_gindex = gindex;
2820 *pchar_code = cmap13->cur_charcode;
2828 tt_cmap13_char_index(
TT_CMap cmap,
2829 FT_UInt32 char_code )
2831 return tt_cmap13_char_map_binary( cmap, &char_code, 0 );
2836 tt_cmap13_char_next(
TT_CMap cmap,
2837 FT_UInt32 *pchar_code )
2839 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2844 if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )
2846 tt_cmap13_next( cmap13 );
2847 if ( cmap13->valid )
2849 gindex = cmap13->cur_gindex;
2850 *pchar_code = cmap13->cur_charcode;
2856 gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );
2863 tt_cmap13_get_info(
TT_CMap cmap,
2877 tt_cmap13_class_rec,
2879 sizeof ( TT_CMap13Rec ),
2962#ifdef TT_CONFIG_CMAP_FORMAT_14
2964 typedef struct TT_CMap14Rec_
2973 FT_UInt32 max_results;
2977 } TT_CMap14Rec, *TT_CMap14;
2981 tt_cmap14_done( TT_CMap14 cmap )
2986 cmap->max_results = 0;
2987 if (
memory && cmap->results )
2993 tt_cmap14_ensure( TT_CMap14 cmap,
2994 FT_UInt32 num_results,
2997 FT_UInt32 old_max = cmap->max_results;
3001 if ( num_results > cmap->max_results )
3008 cmap->max_results = num_results;
3016 tt_cmap14_init( TT_CMap14 cmap,
3019 cmap->cmap.data =
table;
3023 cmap->max_results = 0;
3024 cmap->results =
NULL;
3049 (
length - 10 ) / 11 < num_selectors )
3060 for (
n = 0;
n < num_selectors;
n++ )
3070 if ( varSel < lastVarSel )
3073 lastVarSel = varSel + 1;
3085 if ( defp + 4 >
valid->limit )
3094 for (
i = 0;
i < numRanges;
i++ )
3100 if (
base +
cnt >= 0x110000UL )
3103 if (
base < lastBase )
3111 if ( nondefOff != 0 )
3118 if ( ndp + 4 >
valid->limit )
3124 if ( numMappings > ( (
FT_ULong)(
valid->limit - ndp ) ) / 5 )
3127 for (
i = 0;
i < numMappings;
i++ )
3133 if ( uni >= 0x110000UL )
3136 if ( uni < lastUni )
3154 tt_cmap14_char_index(
TT_CMap cmap,
3155 FT_UInt32 char_code )
3166 tt_cmap14_char_next(
TT_CMap cmap,
3167 FT_UInt32 *pchar_code )
3178 tt_cmap14_get_info(
TT_CMap cmap,
3193 FT_UInt32 char_code )
3207 FT_UInt32 mid = (
min +
max ) >> 1;
3213 if ( char_code <
start )
3215 else if ( char_code >
start +
cnt )
3227 FT_UInt32 char_code )
3241 FT_UInt32 mid = (
min +
max ) >> 1;
3246 if ( char_code < uni )
3248 else if ( char_code > uni )
3260 FT_UInt32 variantCode )
3274 FT_UInt32 mid = (
min +
max ) >> 1;
3279 if ( variantCode < varSel )
3281 else if ( variantCode > varSel )
3292 tt_cmap14_char_var_index(
TT_CMap cmap,
3295 FT_UInt32 variantSelector )
3297 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3309 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3316 if ( nondefOff != 0 )
3317 return tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3325 tt_cmap14_char_var_isdefault(
TT_CMap cmap,
3327 FT_UInt32 variantSelector )
3329 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3341 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3344 if ( nondefOff != 0 &&
3345 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3354 tt_cmap14_variants(
TT_CMap cmap,
3357 TT_CMap14 cmap14 = (TT_CMap14)cmap;
3358 FT_UInt32
count = cmap14->num_selectors;
3364 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3367 result = cmap14->results;
3380 tt_cmap14_char_variants(
TT_CMap cmap,
3382 FT_UInt32 charCode )
3384 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3385 FT_UInt32
count = cmap14->num_selectors;
3390 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3400 if ( ( defOff != 0 &&
3401 tt_cmap14_char_map_def_binary( cmap->
data + defOff,
3404 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3413 return cmap14->results;
3418 tt_cmap14_def_char_count(
FT_Byte *
p )
3425 for ( ; numRanges > 0; numRanges-- )
3436 tt_cmap14_get_def_chars(
TT_CMap cmap,
3440 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3441 FT_UInt32 numRanges;
3446 cnt = tt_cmap14_def_char_count(
p );
3449 if ( tt_cmap14_ensure( cmap14, (
cnt + 1 ),
memory ) )
3452 for (
q = cmap14->results; numRanges > 0; numRanges-- )
3464 }
while ( --
cnt != 0 );
3468 return cmap14->results;
3473 tt_cmap14_get_nondef_chars(
TT_CMap cmap,
3477 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3478 FT_UInt32 numMappings;
3485 if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ),
memory ) )
3488 ret = cmap14->results;
3489 for (
i = 0;
i < numMappings;
i++ )
3501 tt_cmap14_variant_chars(
TT_CMap cmap,
3503 FT_UInt32 variantSelector )
3518 if ( defOff == 0 && nondefOff == 0 )
3522 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3524 else if ( nondefOff == 0 )
3525 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3531 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3532 FT_UInt32 numRanges;
3533 FT_UInt32 numMappings;
3543 p = cmap->
data + nondefOff;
3544 dp = cmap->
data + defOff;
3547 dcnt = tt_cmap14_def_char_count( dp );
3550 if ( numMappings == 0 )
3551 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3554 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3557 if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ),
memory ) )
3560 ret = cmap14->results;
3571 if ( nuni > duni + dcnt )
3573 for (
k = 0;
k <= dcnt;
k++ )
3574 ret[
i++] = duni +
k;
3578 if ( di > numRanges )
3591 if (
ni > numMappings )
3599 if (
ni <= numMappings )
3605 while (
ni < numMappings )
3612 else if ( di <= numRanges )
3617 for (
k = 0;
k <= dcnt;
k++ )
3618 ret[
i++] = duni +
k;
3620 while ( di < numRanges )
3625 for (
k = 0;
k <= dcnt;
k++ )
3626 ret[
i++] = duni +
k;
3639 tt_cmap14_class_rec,
3641 sizeof ( TT_CMap14Rec ),
3673#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
3694 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3699 if ( !psnames->unicodes_init )
3700 return FT_THROW( Unimplemented_Feature );
3702 return psnames->unicodes_init(
memory,
3704 face->root.num_glyphs,
3725 FT_UInt32 char_code )
3728 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3731 return psnames->unicodes_char_index( unicodes, char_code );
3737 FT_UInt32 *pchar_code )
3740 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3743 return psnames->unicodes_char_next( unicodes, pchar_code );
3773#define TTCMAPCITEM( a ) &a,
3801 " unsupported `cmap' table format = %d\n",
3808 for ( ; num_cmaps > 0 &&
p + 8 <=
limit; num_cmaps-- )
3817 charmap.
encoding = FT_ENCODING_NONE;
3820 if (
offset && offset <= face->cmap_size - 2 )
3828 for ( ; *pclazz; pclazz++ )
3848 if ( !
valid.validator.error )
3858 cmap, &charmap, &ttcmap ) )
3868 " broken cmap sub-table ignored\n" ));
3877 " unsupported cmap sub-table ignored\n" ));
3896 return FT_THROW( Invalid_CharMap_Format );
static struct _test_info results[8]
basic_ostream< _CharT, _Traits > &_STLP_CALL ends(basic_ostream< _CharT, _Traits > &__os)
#define FT_CALLBACK_DEF(x)
#define FT_ASSERT(condition)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_QRENEW_ARRAY(ptr, curcnt, newcnt)
FT_UInt(* FT_CMap_CharNextFunc)(FT_CMap cmap, FT_UInt32 *achar_code)
#define FT_FACE_LIBRARY(x)
#define FT_PAD_FLOOR(x, n)
FT_UInt(* FT_CMap_CharVarIndexFunc)(FT_CMap cmap, FT_CMap unicode_cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
FT_UInt32 *(* FT_CMap_CharVariantListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 char_code)
FT_Int(* FT_CMap_CharVarIsDefaultFunc)(FT_CMap cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
#define FT_FACE_MEMORY(x)
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
struct FT_CMapRec_ * FT_CMap
FT_UInt32 *(* FT_CMap_VariantCharListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 variant_selector)
FT_UInt32 *(* FT_CMap_VariantListFunc)(FT_CMap cmap, FT_Memory mem)
FT_Error(* FT_CMap_InitFunc)(FT_CMap cmap, FT_Pointer init_data)
void(* FT_CMap_DoneFunc)(FT_CMap cmap)
FT_UInt(* FT_CMap_CharIndexFunc)(FT_CMap cmap, FT_UInt32 char_code)
#define FT_NEXT_USHORT(buffer)
#define FT_PEEK_USHORT(p)
#define FT_NEXT_BYTE(buffer)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
#define FT_INVALID_TOO_SHORT
#define FT_INVALID_OFFSET
ft_validator_init(FT_Validator valid, const FT_Byte *base, const FT_Byte *limit, FT_ValidationLevel level)
typedefFT_BEGIN_HEADER struct FT_ValidatorRec_ volatile * FT_Validator
#define FT_INVALID_GLYPH_ID
static const FxOffsetAndName offsets[]
static struct netconfig_info ni
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLvoid * pointer
GLenum GLuint GLint GLenum face
GLboolean GLenum GLenum GLvoid * values
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static char memory[1024 *256]
static unsigned __int64 next
FT_CMap_CharIndexFunc char_index
TT_CMap_ValidateFunc validate
TT_CMap_Info_GetFunc get_cmap_info
const char *(* PS_GetGlyphNameFunc)(FT_Pointer data, FT_UInt string_index)
void(* PS_FreeGlyphNameFunc)(FT_Pointer data, const char *name)
FT_Error(* TT_CMap_Info_GetFunc)(FT_CharMap charmap, TT_CMapInfo *cmap_info)
tt_get_cmap_info(FT_CharMap charmap, TT_CMapInfo *cmap_info)
tt_cmap_init(TT_CMap cmap, FT_Byte *table)
static const TT_CMap_Class tt_cmap_classes[]
tt_face_build_cmaps(TT_Face face)
#define TT_CMAP_FLAG_OVERLAPPING
struct TT_CMapRec_ * TT_CMap
#define TT_VALID_GLYPH_COUNT(x)
FT_CALLBACK_TABLE const TT_CMap_ClassRec tt_cmap_unicode_class_rec
const struct TT_CMap_ClassRec_ * TT_CMap_Class
#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_, char_next_, char_var_index_, char_var_default_, variant_list_, charvariant_list_, variantchar_list_, format_, validate_, get_cmap_info_)
FT_Error(* TT_CMap_ValidateFunc)(FT_Byte *data, FT_Validator valid)
#define TT_CMAP_FLAG_UNSORTED
FT_BEGIN_HEADER tt_face_get_ps_name(TT_Face face, FT_UInt idx, FT_String **PSname)
struct TT_FaceRec_ * TT_Face