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,
1243 num_segs = num_segs2 >> 1;
1258 mid = (
min +
max ) >> 1;
1259 p = cmap->
data + 14 + mid * 2;
1264 if ( charcode <
start )
1266 else if ( charcode >
end )
1277 if ( mid >= num_segs - 1 &&
1278 start == 0xFFFFU &&
end == 0xFFFFU )
1300 for (
i =
max;
i > 0;
i-- )
1307 p = cmap->
data + 14 + (
i - 1 ) * 2;
1310 if ( charcode > prev_end )
1329 if ( mid ==
max + 1 )
1346 for (
i =
max + 1;
i < num_segs;
i++ )
1351 p = cmap->
data + 14 +
i * 2;
1356 if ( charcode < next_start )
1383 p = cmap->
data + 14 + mid * 2;
1426 if ( (
FT_Int)charcode + delta < 0 &&
1428 charcode = (
FT_UInt)( -delta );
1430 else if ( (
FT_Int)charcode + delta < 0x10000L &&
1432 charcode = (
FT_UInt)( 0x10000L - delta );
1442 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1448 if ( charcode >
end )
1451 if ( mid == num_segs )
1455 if ( tt_cmap4_set_range( cmap4, mid ) )
1458 *pcharcode = charcode;
1462 cmap4->cur_charcode = charcode;
1465 cmap4->cur_gindex = gindex;
1468 cmap4->cur_charcode = charcode;
1469 tt_cmap4_next( cmap4 );
1470 gindex = cmap4->cur_gindex;
1474 *pcharcode = cmap4->cur_charcode;
1483 tt_cmap4_char_index(
TT_CMap cmap,
1484 FT_UInt32 char_code )
1486 if ( char_code >= 0x10000UL )
1490 return tt_cmap4_char_map_linear( cmap, &char_code, 0 );
1492 return tt_cmap4_char_map_binary( cmap, &char_code, 0 );
1497 tt_cmap4_char_next(
TT_CMap cmap,
1498 FT_UInt32 *pchar_code )
1503 if ( *pchar_code >= 0xFFFFU )
1507 gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );
1510 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1514 if ( *pchar_code == cmap4->cur_charcode )
1516 tt_cmap4_next( cmap4 );
1517 gindex = cmap4->cur_gindex;
1519 *pchar_code = cmap4->cur_charcode;
1522 gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );
1530 tt_cmap4_get_info(
TT_CMap cmap,
1546 sizeof ( TT_CMap4Rec ),
1593#ifdef TT_CONFIG_CMAP_FORMAT_6
1634 tt_cmap6_char_index(
TT_CMap cmap,
1635 FT_UInt32 char_code )
1656 tt_cmap6_char_next(
TT_CMap cmap,
1657 FT_UInt32 *pchar_code )
1661 FT_UInt32 char_code = *pchar_code + 1;
1670 if ( char_code >= 0x10000UL )
1673 if ( char_code <
start )
1688 if ( char_code >= 0xFFFFU )
1700 tt_cmap6_get_info(
TT_CMap cmap,
1791#ifdef TT_CONFIG_CMAP_FORMAT_8
1800 FT_UInt32 num_groups;
1815 if ( num_groups > (FT_UInt32)(
valid->limit -
p ) / 12 )
1823 for (
n = 0;
n < num_groups;
n++ )
1850 if (
start & ~0xFFFFU )
1859 if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )
1862 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )
1872 if (
end & ~0xFFFFU )
1879 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )
1894 tt_cmap8_char_index(
TT_CMap cmap,
1895 FT_UInt32 char_code )
1904 for ( ; num_groups > 0; num_groups-- )
1910 if ( char_code <
start )
1913 if ( char_code <=
end )
1915 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1927 tt_cmap8_char_next(
TT_CMap cmap,
1928 FT_UInt32 *pchar_code )
1932 FT_UInt32 char_code;
1940 if ( *pchar_code >= 0xFFFFFFFFUL )
1943 char_code = *pchar_code + 1;
1947 for ( ; num_groups > 0; num_groups-- )
1953 if ( char_code <
start )
1957 if ( char_code <=
end )
1960 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1963 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
1968 if ( char_code >= 0xFFFFFFFFUL )
1994 tt_cmap8_get_info(
TT_CMap cmap,
2056#ifdef TT_CONFIG_CMAP_FORMAT_10
2098 tt_cmap10_char_index(
TT_CMap cmap,
2099 FT_UInt32 char_code )
2109 if ( char_code <
start )
2125 tt_cmap10_char_next(
TT_CMap cmap,
2126 FT_UInt32 *pchar_code )
2129 FT_UInt32 char_code;
2137 if ( *pchar_code >= 0xFFFFFFFFUL )
2140 char_code = *pchar_code + 1;
2142 if ( char_code <
start )
2154 if ( char_code >= 0xFFFFFFFFUL )
2160 *pchar_code = char_code;
2166 tt_cmap10_get_info(
TT_CMap cmap,
2180 tt_cmap10_class_rec,
2232#ifdef TT_CONFIG_CMAP_FORMAT_12
2234 typedef struct TT_CMap12Rec_
2243 } TT_CMap12Rec, *TT_CMap12;
2247 tt_cmap12_init( TT_CMap12 cmap,
2250 cmap->cmap.data =
table;
2282 (
length - 16 ) / 12 < num_groups )
2290 for (
n = 0;
n < num_groups;
n++ )
2325 tt_cmap12_next( TT_CMap12 cmap )
2334 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2337 char_code = cmap->cur_charcode + 1;
2339 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2341 p = cmap->cmap.data + 16 + 12 *
n;
2346 if ( char_code <
start )
2350 if ( char_code <=
end )
2353 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2356 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2361 if ( char_code >= 0xFFFFFFFFUL )
2376 cmap->cur_charcode = char_code;
2377 cmap->cur_gindex = gindex;
2378 cmap->cur_group =
n;
2390 tt_cmap12_char_map_binary(
TT_CMap cmap,
2391 FT_UInt32* pchar_code,
2397 FT_UInt32 char_code = *pchar_code;
2411 if ( char_code >= 0xFFFFFFFFUL )
2423 mid = (
min +
max ) >> 1;
2424 p = cmap->
data + 16 + 12 * mid;
2429 if ( char_code <
start )
2431 else if ( char_code >
end )
2438 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2441 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2449 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2455 if ( char_code >
end )
2458 if ( mid == num_groups )
2463 cmap12->cur_charcode = char_code;
2464 cmap12->cur_group = mid;
2471 tt_cmap12_next( cmap12 );
2473 if ( cmap12->valid )
2474 gindex = cmap12->cur_gindex;
2477 cmap12->cur_gindex = gindex;
2479 *pchar_code = cmap12->cur_charcode;
2487 tt_cmap12_char_index(
TT_CMap cmap,
2488 FT_UInt32 char_code )
2490 return tt_cmap12_char_map_binary( cmap, &char_code, 0 );
2495 tt_cmap12_char_next(
TT_CMap cmap,
2496 FT_UInt32 *pchar_code )
2498 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2503 if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )
2505 tt_cmap12_next( cmap12 );
2506 if ( cmap12->valid )
2508 gindex = cmap12->cur_gindex;
2509 *pchar_code = (FT_UInt32)cmap12->cur_charcode;
2515 gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
2522 tt_cmap12_get_info(
TT_CMap cmap,
2536 tt_cmap12_class_rec,
2538 sizeof ( TT_CMap12Rec ),
2588#ifdef TT_CONFIG_CMAP_FORMAT_13
2590 typedef struct TT_CMap13Rec_
2599 } TT_CMap13Rec, *TT_CMap13;
2603 tt_cmap13_init( TT_CMap13 cmap,
2606 cmap->cmap.data =
table;
2638 (
length - 16 ) / 12 < num_groups )
2646 for (
n = 0;
n < num_groups;
n++ )
2676 tt_cmap13_next( TT_CMap13 cmap )
2685 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2688 char_code = cmap->cur_charcode + 1;
2690 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2692 p = cmap->cmap.data + 16 + 12 *
n;
2697 if ( char_code <
start )
2700 if ( char_code <=
end )
2704 if ( gindex && gindex < (
FT_UInt)
face->num_glyphs )
2706 cmap->cur_charcode = char_code;
2707 cmap->cur_gindex = gindex;
2708 cmap->cur_group =
n;
2721 tt_cmap13_char_map_binary(
TT_CMap cmap,
2722 FT_UInt32* pchar_code,
2728 FT_UInt32 char_code = *pchar_code;
2742 if ( char_code >= 0xFFFFFFFFUL )
2754 mid = (
min +
max ) >> 1;
2755 p = cmap->
data + 16 + 12 * mid;
2760 if ( char_code <
start )
2762 else if ( char_code >
end )
2775 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2781 if ( char_code >
end )
2784 if ( mid == num_groups )
2789 cmap13->cur_charcode = char_code;
2790 cmap13->cur_group = mid;
2797 tt_cmap13_next( cmap13 );
2799 if ( cmap13->valid )
2800 gindex = cmap13->cur_gindex;
2803 cmap13->cur_gindex = gindex;
2805 *pchar_code = cmap13->cur_charcode;
2813 tt_cmap13_char_index(
TT_CMap cmap,
2814 FT_UInt32 char_code )
2816 return tt_cmap13_char_map_binary( cmap, &char_code, 0 );
2821 tt_cmap13_char_next(
TT_CMap cmap,
2822 FT_UInt32 *pchar_code )
2824 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2829 if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )
2831 tt_cmap13_next( cmap13 );
2832 if ( cmap13->valid )
2834 gindex = cmap13->cur_gindex;
2835 *pchar_code = cmap13->cur_charcode;
2841 gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );
2848 tt_cmap13_get_info(
TT_CMap cmap,
2862 tt_cmap13_class_rec,
2864 sizeof ( TT_CMap13Rec ),
2947#ifdef TT_CONFIG_CMAP_FORMAT_14
2949 typedef struct TT_CMap14Rec_
2958 FT_UInt32 max_results;
2962 } TT_CMap14Rec, *TT_CMap14;
2966 tt_cmap14_done( TT_CMap14 cmap )
2971 cmap->max_results = 0;
2972 if (
memory && cmap->results )
2978 tt_cmap14_ensure( TT_CMap14 cmap,
2979 FT_UInt32 num_results,
2982 FT_UInt32 old_max = cmap->max_results;
2986 if ( num_results > cmap->max_results )
2993 cmap->max_results = num_results;
3001 tt_cmap14_init( TT_CMap14 cmap,
3004 cmap->cmap.data =
table;
3008 cmap->max_results = 0;
3009 cmap->results =
NULL;
3034 (
length - 10 ) / 11 < num_selectors )
3045 for (
n = 0;
n < num_selectors;
n++ )
3055 if ( varSel < lastVarSel )
3058 lastVarSel = varSel + 1;
3070 if ( defp + 4 >
valid->limit )
3079 for (
i = 0;
i < numRanges;
i++ )
3085 if (
base +
cnt >= 0x110000UL )
3088 if (
base < lastBase )
3096 if ( nondefOff != 0 )
3103 if ( ndp + 4 >
valid->limit )
3109 if ( numMappings > ( (
FT_ULong)(
valid->limit - ndp ) ) / 5 )
3112 for (
i = 0;
i < numMappings;
i++ )
3118 if ( uni >= 0x110000UL )
3121 if ( uni < lastUni )
3139 tt_cmap14_char_index(
TT_CMap cmap,
3140 FT_UInt32 char_code )
3151 tt_cmap14_char_next(
TT_CMap cmap,
3152 FT_UInt32 *pchar_code )
3163 tt_cmap14_get_info(
TT_CMap cmap,
3178 FT_UInt32 char_code )
3192 FT_UInt32 mid = (
min +
max ) >> 1;
3198 if ( char_code <
start )
3200 else if ( char_code >
start +
cnt )
3212 FT_UInt32 char_code )
3226 FT_UInt32 mid = (
min +
max ) >> 1;
3231 if ( char_code < uni )
3233 else if ( char_code > uni )
3245 FT_UInt32 variantCode )
3259 FT_UInt32 mid = (
min +
max ) >> 1;
3264 if ( variantCode < varSel )
3266 else if ( variantCode > varSel )
3277 tt_cmap14_char_var_index(
TT_CMap cmap,
3280 FT_UInt32 variantSelector )
3282 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3294 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3301 if ( nondefOff != 0 )
3302 return tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3310 tt_cmap14_char_var_isdefault(
TT_CMap cmap,
3312 FT_UInt32 variantSelector )
3314 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3326 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3329 if ( nondefOff != 0 &&
3330 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3339 tt_cmap14_variants(
TT_CMap cmap,
3342 TT_CMap14 cmap14 = (TT_CMap14)cmap;
3343 FT_UInt32
count = cmap14->num_selectors;
3349 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3352 result = cmap14->results;
3365 tt_cmap14_char_variants(
TT_CMap cmap,
3367 FT_UInt32 charCode )
3369 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3370 FT_UInt32
count = cmap14->num_selectors;
3375 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3385 if ( ( defOff != 0 &&
3386 tt_cmap14_char_map_def_binary( cmap->
data + defOff,
3389 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3398 return cmap14->results;
3403 tt_cmap14_def_char_count(
FT_Byte *
p )
3410 for ( ; numRanges > 0; numRanges-- )
3421 tt_cmap14_get_def_chars(
TT_CMap cmap,
3425 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3426 FT_UInt32 numRanges;
3431 cnt = tt_cmap14_def_char_count(
p );
3434 if ( tt_cmap14_ensure( cmap14, (
cnt + 1 ),
memory ) )
3437 for (
q = cmap14->results; numRanges > 0; numRanges-- )
3449 }
while ( --
cnt != 0 );
3453 return cmap14->results;
3458 tt_cmap14_get_nondef_chars(
TT_CMap cmap,
3462 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3463 FT_UInt32 numMappings;
3470 if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ),
memory ) )
3473 ret = cmap14->results;
3474 for (
i = 0;
i < numMappings;
i++ )
3486 tt_cmap14_variant_chars(
TT_CMap cmap,
3488 FT_UInt32 variantSelector )
3503 if ( defOff == 0 && nondefOff == 0 )
3507 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3509 else if ( nondefOff == 0 )
3510 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3516 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3517 FT_UInt32 numRanges;
3518 FT_UInt32 numMappings;
3528 p = cmap->
data + nondefOff;
3529 dp = cmap->
data + defOff;
3532 dcnt = tt_cmap14_def_char_count( dp );
3535 if ( numMappings == 0 )
3536 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3539 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3542 if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ),
memory ) )
3545 ret = cmap14->results;
3556 if ( nuni > duni + dcnt )
3558 for (
k = 0;
k <= dcnt;
k++ )
3559 ret[
i++] = duni +
k;
3563 if ( di > numRanges )
3576 if (
ni > numMappings )
3584 if (
ni <= numMappings )
3590 while (
ni < numMappings )
3597 else if ( di <= numRanges )
3602 for (
k = 0;
k <= dcnt;
k++ )
3603 ret[
i++] = duni +
k;
3605 while ( di < numRanges )
3610 for (
k = 0;
k <= dcnt;
k++ )
3611 ret[
i++] = duni +
k;
3624 tt_cmap14_class_rec,
3626 sizeof ( TT_CMap14Rec ),
3658#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
3679 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3684 if ( !psnames->unicodes_init )
3685 return FT_THROW( Unimplemented_Feature );
3687 return psnames->unicodes_init(
memory,
3689 face->root.num_glyphs,
3710 FT_UInt32 char_code )
3713 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3716 return psnames->unicodes_char_index( unicodes, char_code );
3722 FT_UInt32 *pchar_code )
3725 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3728 return psnames->unicodes_char_next( unicodes, pchar_code );
3758#define TTCMAPCITEM( a ) &a,
3786 " unsupported `cmap' table format = %d\n",
3793 for ( ; num_cmaps > 0 &&
p + 8 <=
limit; num_cmaps-- )
3802 charmap.
encoding = FT_ENCODING_NONE;
3805 if (
offset && offset <= face->cmap_size - 2 )
3813 for ( ; *pclazz; pclazz++ )
3833 if ( !
valid.validator.error )
3843 cmap, &charmap, &ttcmap ) )
3853 " broken cmap sub-table ignored\n" ));
3862 " unsupported cmap sub-table ignored\n" ));
3881 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