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
40#define FT_COMPONENT trace_ttcmap
43#define TT_PEEK_SHORT FT_PEEK_SHORT
44#define TT_PEEK_USHORT FT_PEEK_USHORT
45#define TT_PEEK_UINT24 FT_PEEK_UOFF3
46#define TT_PEEK_LONG FT_PEEK_LONG
47#define TT_PEEK_ULONG FT_PEEK_ULONG
49#define TT_NEXT_SHORT FT_NEXT_SHORT
50#define TT_NEXT_USHORT FT_NEXT_USHORT
51#define TT_NEXT_UINT24 FT_NEXT_UOFF3
52#define TT_NEXT_LONG FT_NEXT_LONG
53#define TT_NEXT_ULONG FT_NEXT_ULONG
94#ifdef TT_CONFIG_CMAP_FORMAT_0
120 for (
n = 0;
n < 256;
n++ )
133 tt_cmap0_char_index(
TT_CMap cmap,
134 FT_UInt32 char_code )
139 return char_code < 256 ?
table[6 + char_code] : 0;
144 tt_cmap0_char_next(
TT_CMap cmap,
145 FT_UInt32 *pchar_code )
148 FT_UInt32 charcode = *pchar_code;
154 while ( ++charcode < 256 )
156 gindex =
table[charcode];
170 tt_cmap0_get_info(
TT_CMap cmap,
293#ifdef TT_CONFIG_CMAP_FORMAT_2
322 for (
n = 0;
n < 256;
n++ )
333 if (
idx > max_subs )
340 glyph_ids = subs + ( max_subs + 1 ) * 8;
341 if ( glyph_ids >
valid->limit )
345 for (
n = 0;
n <= max_subs;
n++ )
357 if ( code_count == 0 )
363 if ( first_code >= 256 || first_code + code_count > 256 )
374 if ( ids < glyph_ids || ids + code_count * 2 >
table +
length )
406 FT_UInt32 char_code )
411 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 );
522 if ( charcode == 0x100 )
527 if ( char_lo <
start )
561 if ( charcode <= 0xFF )
563 else if ( charcode == 0x100 )
577 tt_cmap2_get_info(
TT_CMap cmap,
685#ifdef TT_CONFIG_CMAP_FORMAT_4
687 typedef struct TT_CMap4Rec_
690 FT_UInt32 cur_charcode;
700 } TT_CMap4Rec, *TT_CMap4;
704 tt_cmap4_init( TT_CMap4 cmap,
710 cmap->cmap.data =
table;
714 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
715 cmap->cur_gindex = 0;
722 tt_cmap4_set_range( TT_CMap4 cmap,
727 FT_UInt num_ranges = cmap->num_ranges;
730 while ( range_index < num_ranges )
735 p =
table + 14 + range_index * 2;
738 p += 2 + num_ranges * 2;
749 if ( range_index >= num_ranges - 1 &&
750 cmap->cur_start == 0xFFFFU &&
751 cmap->cur_end == 0xFFFFU )
767 cmap->cur_range = range_index;
784 tt_cmap4_next( TT_CMap4 cmap )
792 if ( cmap->cur_charcode >= 0xFFFFUL )
795 charcode = (
FT_UInt)cmap->cur_charcode + 1;
797 if ( charcode < cmap->cur_start )
798 charcode = cmap->cur_start;
804 FT_Int delta = cmap->cur_delta;
807 if ( charcode <=
end )
828 cmap->cur_charcode = charcode;
829 cmap->cur_gindex = gindex;
833 }
while ( ++charcode <=
end );
849 if ( (
FT_Int)charcode + delta < 0 &&
851 charcode = (
FT_UInt)( -delta );
853 else if ( (
FT_Int)charcode + delta < 0x10000L &&
855 charcode = (
FT_UInt)( 0x10000L - delta );
863 cmap->cur_charcode = charcode;
864 cmap->cur_gindex = gindex;
867 }
while ( ++charcode <=
end );
873 if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )
876 if ( charcode < cmap->cur_start )
877 charcode = cmap->cur_start;
881 cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
882 cmap->cur_gindex = 0;
929 if (
length < 16 + num_segs * 2 * 4 )
942 if ( ( search_range | range_shift ) & 1 )
950 if ( search_range > num_segs ||
951 search_range * 2 < num_segs ||
952 search_range + range_shift != num_segs ||
953 search_range != ( 1U << entry_selector ) )
958 starts =
table + 16 + num_segs * 2;
959 deltas = starts + num_segs * 2;
960 offsets = deltas + num_segs * 2;
961 glyph_ids =
offsets + num_segs * 2;
966 p =
ends + ( num_segs - 1 ) * 2;
973 FT_UInt last_start = 0, last_end = 0;
981 for (
n = 0;
n < num_segs;
n++ )
996 if ( start <= last_end && n > 0 )
1005 if ( last_start >
start || last_end >
end )
1019 if (
p < glyph_ids ||
1033 else if (
n != num_segs - 1 ||
1034 !(
start == 0xFFFFU &&
end == 0xFFFFU ) )
1036 if (
p < glyph_ids ||
1060 else if (
offset == 0xFFFFU )
1066 n != num_segs - 1 ||
1067 !(
start == 0xFFFFU &&
end == 0xFFFFU ) )
1081 tt_cmap4_char_map_linear(
TT_CMap cmap,
1082 FT_UInt32* pcharcode,
1092 FT_UInt32 charcode = *pcharcode;
1101 num_segs = num_segs2 >> 1;
1109 if ( charcode > 0xFFFFU )
1113 p = cmap->
data + 14;
1114 q = cmap->
data + 16 + num_segs2;
1116 for (
i = 0;
i < num_segs;
i++ )
1121 if ( charcode <
start )
1130 if ( charcode <=
end )
1135 r =
q - 2 + num_segs2;
1142 if (
i >= num_segs - 1 &&
1143 start == 0xFFFFU &&
end == 0xFFFFU )
1182 if ( (
FT_Int)charcode + delta < 0 &&
1184 charcode = (
FT_UInt)( -delta );
1186 else if ( (
FT_Int)charcode + delta < 0x10000L &&
1188 charcode = (
FT_UInt)( 0x10000L - delta );
1195 if (
next && !gindex )
1197 if ( charcode >= 0xFFFFU )
1209 *pcharcode = charcode;
1216 tt_cmap4_char_map_binary(
TT_CMap cmap,
1217 FT_UInt32* pcharcode,
1237 num_segs = num_segs2 >> 1;
1252 mid = (
min +
max ) >> 1;
1253 p = cmap->
data + 14 + mid * 2;
1258 if ( charcode <
start )
1260 else if ( charcode >
end )
1271 if ( mid >= num_segs - 1 &&
1272 start == 0xFFFFU &&
end == 0xFFFFU )
1294 for (
i =
max;
i > 0;
i-- )
1301 p = cmap->
data + 14 + (
i - 1 ) * 2;
1304 if ( charcode > prev_end )
1323 if ( mid ==
max + 1 )
1340 for (
i =
max + 1;
i < num_segs;
i++ )
1345 p = cmap->
data + 14 +
i * 2;
1350 if ( charcode < next_start )
1377 p = cmap->
data + 14 + mid * 2;
1420 if ( (
FT_Int)charcode + delta < 0 &&
1422 charcode = (
FT_UInt)( -delta );
1424 else if ( (
FT_Int)charcode + delta < 0x10000L &&
1426 charcode = (
FT_UInt)( 0x10000L - delta );
1436 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1442 if ( charcode >
end )
1445 if ( mid == num_segs )
1449 if ( tt_cmap4_set_range( cmap4, mid ) )
1452 *pcharcode = charcode;
1456 cmap4->cur_charcode = charcode;
1459 cmap4->cur_gindex = gindex;
1462 cmap4->cur_charcode = charcode;
1463 tt_cmap4_next( cmap4 );
1464 gindex = cmap4->cur_gindex;
1468 *pcharcode = cmap4->cur_charcode;
1477 tt_cmap4_char_index(
TT_CMap cmap,
1478 FT_UInt32 char_code )
1480 if ( char_code >= 0x10000UL )
1484 return tt_cmap4_char_map_linear( cmap, &char_code, 0 );
1486 return tt_cmap4_char_map_binary( cmap, &char_code, 0 );
1491 tt_cmap4_char_next(
TT_CMap cmap,
1492 FT_UInt32 *pchar_code )
1497 if ( *pchar_code >= 0xFFFFU )
1501 gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );
1504 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1508 if ( *pchar_code == cmap4->cur_charcode )
1510 tt_cmap4_next( cmap4 );
1511 gindex = cmap4->cur_gindex;
1513 *pchar_code = cmap4->cur_charcode;
1516 gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );
1524 tt_cmap4_get_info(
TT_CMap cmap,
1540 sizeof ( TT_CMap4Rec ),
1587#ifdef TT_CONFIG_CMAP_FORMAT_6
1628 tt_cmap6_char_index(
TT_CMap cmap,
1629 FT_UInt32 char_code )
1650 tt_cmap6_char_next(
TT_CMap cmap,
1651 FT_UInt32 *pchar_code )
1655 FT_UInt32 char_code = *pchar_code + 1;
1664 if ( char_code >= 0x10000UL )
1667 if ( char_code <
start )
1682 if ( char_code >= 0xFFFFU )
1694 tt_cmap6_get_info(
TT_CMap cmap,
1785#ifdef TT_CONFIG_CMAP_FORMAT_8
1794 FT_UInt32 num_groups;
1809 if ( num_groups > (FT_UInt32)(
valid->limit -
p ) / 12 )
1817 for (
n = 0;
n < num_groups;
n++ )
1844 if (
start & ~0xFFFFU )
1853 if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )
1856 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )
1866 if (
end & ~0xFFFFU )
1873 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )
1888 tt_cmap8_char_index(
TT_CMap cmap,
1889 FT_UInt32 char_code )
1898 for ( ; num_groups > 0; num_groups-- )
1904 if ( char_code <
start )
1907 if ( char_code <=
end )
1909 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1921 tt_cmap8_char_next(
TT_CMap cmap,
1922 FT_UInt32 *pchar_code )
1926 FT_UInt32 char_code;
1934 if ( *pchar_code >= 0xFFFFFFFFUL )
1937 char_code = *pchar_code + 1;
1941 for ( ; num_groups > 0; num_groups-- )
1947 if ( char_code <
start )
1951 if ( char_code <=
end )
1954 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
1957 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
1962 if ( char_code >= 0xFFFFFFFFUL )
1988 tt_cmap8_get_info(
TT_CMap cmap,
2050#ifdef TT_CONFIG_CMAP_FORMAT_10
2092 tt_cmap10_char_index(
TT_CMap cmap,
2093 FT_UInt32 char_code )
2103 if ( char_code <
start )
2119 tt_cmap10_char_next(
TT_CMap cmap,
2120 FT_UInt32 *pchar_code )
2123 FT_UInt32 char_code;
2131 if ( *pchar_code >= 0xFFFFFFFFUL )
2134 char_code = *pchar_code + 1;
2136 if ( char_code <
start )
2148 if ( char_code >= 0xFFFFFFFFUL )
2154 *pchar_code = char_code;
2160 tt_cmap10_get_info(
TT_CMap cmap,
2174 tt_cmap10_class_rec,
2226#ifdef TT_CONFIG_CMAP_FORMAT_12
2228 typedef struct TT_CMap12Rec_
2237 } TT_CMap12Rec, *TT_CMap12;
2241 tt_cmap12_init( TT_CMap12 cmap,
2244 cmap->cmap.data =
table;
2276 (
length - 16 ) / 12 < num_groups )
2284 for (
n = 0;
n < num_groups;
n++ )
2319 tt_cmap12_next( TT_CMap12 cmap )
2328 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2331 char_code = cmap->cur_charcode + 1;
2333 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2335 p = cmap->cmap.data + 16 + 12 *
n;
2340 if ( char_code <
start )
2344 if ( char_code <=
end )
2347 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2350 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2355 if ( char_code >= 0xFFFFFFFFUL )
2370 cmap->cur_charcode = char_code;
2371 cmap->cur_gindex = gindex;
2372 cmap->cur_group =
n;
2384 tt_cmap12_char_map_binary(
TT_CMap cmap,
2385 FT_UInt32* pchar_code,
2391 FT_UInt32 char_code = *pchar_code;
2405 if ( char_code >= 0xFFFFFFFFUL )
2417 mid = (
min +
max ) >> 1;
2418 p = cmap->
data + 16 + 12 * mid;
2423 if ( char_code <
start )
2425 else if ( char_code >
end )
2432 if ( start_id > 0xFFFFFFFFUL - ( char_code -
start ) )
2435 gindex = (
FT_UInt)( start_id + ( char_code -
start ) );
2443 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2449 if ( char_code >
end )
2452 if ( mid == num_groups )
2457 cmap12->cur_charcode = char_code;
2458 cmap12->cur_group = mid;
2465 tt_cmap12_next( cmap12 );
2467 if ( cmap12->valid )
2468 gindex = cmap12->cur_gindex;
2471 cmap12->cur_gindex = gindex;
2473 *pchar_code = cmap12->cur_charcode;
2481 tt_cmap12_char_index(
TT_CMap cmap,
2482 FT_UInt32 char_code )
2484 return tt_cmap12_char_map_binary( cmap, &char_code, 0 );
2489 tt_cmap12_char_next(
TT_CMap cmap,
2490 FT_UInt32 *pchar_code )
2492 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2497 if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )
2499 tt_cmap12_next( cmap12 );
2500 if ( cmap12->valid )
2502 gindex = cmap12->cur_gindex;
2503 *pchar_code = (FT_UInt32)cmap12->cur_charcode;
2509 gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
2516 tt_cmap12_get_info(
TT_CMap cmap,
2530 tt_cmap12_class_rec,
2532 sizeof ( TT_CMap12Rec ),
2582#ifdef TT_CONFIG_CMAP_FORMAT_13
2584 typedef struct TT_CMap13Rec_
2593 } TT_CMap13Rec, *TT_CMap13;
2597 tt_cmap13_init( TT_CMap13 cmap,
2600 cmap->cmap.data =
table;
2632 (
length - 16 ) / 12 < num_groups )
2640 for (
n = 0;
n < num_groups;
n++ )
2670 tt_cmap13_next( TT_CMap13 cmap )
2679 if ( cmap->cur_charcode >= 0xFFFFFFFFUL )
2682 char_code = cmap->cur_charcode + 1;
2684 for (
n = cmap->cur_group; n < cmap->num_groups;
n++ )
2686 p = cmap->cmap.data + 16 + 12 *
n;
2691 if ( char_code <
start )
2694 if ( char_code <=
end )
2698 if ( gindex && gindex < (
FT_UInt)
face->num_glyphs )
2700 cmap->cur_charcode = char_code;
2701 cmap->cur_gindex = gindex;
2702 cmap->cur_group =
n;
2715 tt_cmap13_char_map_binary(
TT_CMap cmap,
2716 FT_UInt32* pchar_code,
2722 FT_UInt32 char_code = *pchar_code;
2736 if ( char_code >= 0xFFFFFFFFUL )
2748 mid = (
min +
max ) >> 1;
2749 p = cmap->
data + 16 + 12 * mid;
2754 if ( char_code <
start )
2756 else if ( char_code >
end )
2769 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2775 if ( char_code >
end )
2778 if ( mid == num_groups )
2783 cmap13->cur_charcode = char_code;
2784 cmap13->cur_group = mid;
2791 tt_cmap13_next( cmap13 );
2793 if ( cmap13->valid )
2794 gindex = cmap13->cur_gindex;
2797 cmap13->cur_gindex = gindex;
2799 *pchar_code = cmap13->cur_charcode;
2807 tt_cmap13_char_index(
TT_CMap cmap,
2808 FT_UInt32 char_code )
2810 return tt_cmap13_char_map_binary( cmap, &char_code, 0 );
2815 tt_cmap13_char_next(
TT_CMap cmap,
2816 FT_UInt32 *pchar_code )
2818 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2823 if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )
2825 tt_cmap13_next( cmap13 );
2826 if ( cmap13->valid )
2828 gindex = cmap13->cur_gindex;
2829 *pchar_code = cmap13->cur_charcode;
2835 gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );
2842 tt_cmap13_get_info(
TT_CMap cmap,
2856 tt_cmap13_class_rec,
2858 sizeof ( TT_CMap13Rec ),
2940#ifdef TT_CONFIG_CMAP_FORMAT_14
2942 typedef struct TT_CMap14Rec_
2951 FT_UInt32 max_results;
2955 } TT_CMap14Rec, *TT_CMap14;
2959 tt_cmap14_done( TT_CMap14 cmap )
2964 cmap->max_results = 0;
2965 if (
memory && cmap->results )
2971 tt_cmap14_ensure( TT_CMap14 cmap,
2972 FT_UInt32 num_results,
2975 FT_UInt32 old_max = cmap->max_results;
2979 if ( num_results > cmap->max_results )
2986 cmap->max_results = num_results;
2994 tt_cmap14_init( TT_CMap14 cmap,
2997 cmap->cmap.data =
table;
3001 cmap->max_results = 0;
3002 cmap->results =
NULL;
3027 (
length - 10 ) / 11 < num_selectors )
3038 for (
n = 0;
n < num_selectors;
n++ )
3048 if ( varSel < lastVarSel )
3051 lastVarSel = varSel + 1;
3063 if ( defp + 4 >
valid->limit )
3072 for (
i = 0;
i < numRanges;
i++ )
3078 if (
base +
cnt >= 0x110000UL )
3081 if (
base < lastBase )
3089 if ( nondefOff != 0 )
3096 if ( ndp + 4 >
valid->limit )
3102 if ( numMappings > ( (
FT_ULong)(
valid->limit - ndp ) ) / 5 )
3105 for (
i = 0;
i < numMappings;
i++ )
3111 if ( uni >= 0x110000UL )
3114 if ( uni < lastUni )
3132 tt_cmap14_char_index(
TT_CMap cmap,
3133 FT_UInt32 char_code )
3144 tt_cmap14_char_next(
TT_CMap cmap,
3145 FT_UInt32 *pchar_code )
3156 tt_cmap14_get_info(
TT_CMap cmap,
3171 FT_UInt32 char_code )
3185 FT_UInt32 mid = (
min +
max ) >> 1;
3191 if ( char_code <
start )
3193 else if ( char_code >
start +
cnt )
3205 FT_UInt32 char_code )
3219 FT_UInt32 mid = (
min +
max ) >> 1;
3224 if ( char_code < uni )
3226 else if ( char_code > uni )
3238 FT_UInt32 variantCode )
3252 FT_UInt32 mid = (
min +
max ) >> 1;
3257 if ( variantCode < varSel )
3259 else if ( variantCode > varSel )
3270 tt_cmap14_char_var_index(
TT_CMap cmap,
3273 FT_UInt32 variantSelector )
3275 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3287 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3294 if ( nondefOff != 0 )
3295 return tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3303 tt_cmap14_char_var_isdefault(
TT_CMap cmap,
3305 FT_UInt32 variantSelector )
3307 FT_Byte*
p = tt_cmap14_find_variant( cmap->
data + 6, variantSelector );
3319 tt_cmap14_char_map_def_binary( cmap->
data + defOff, charcode ) )
3322 if ( nondefOff != 0 &&
3323 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3332 tt_cmap14_variants(
TT_CMap cmap,
3335 TT_CMap14 cmap14 = (TT_CMap14)cmap;
3336 FT_UInt32
count = cmap14->num_selectors;
3342 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3345 result = cmap14->results;
3358 tt_cmap14_char_variants(
TT_CMap cmap,
3360 FT_UInt32 charCode )
3362 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3363 FT_UInt32
count = cmap14->num_selectors;
3368 if ( tt_cmap14_ensure( cmap14, (
count + 1 ),
memory ) )
3378 if ( ( defOff != 0 &&
3379 tt_cmap14_char_map_def_binary( cmap->
data + defOff,
3382 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3391 return cmap14->results;
3396 tt_cmap14_def_char_count(
FT_Byte *
p )
3403 for ( ; numRanges > 0; numRanges-- )
3414 tt_cmap14_get_def_chars(
TT_CMap cmap,
3418 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3419 FT_UInt32 numRanges;
3424 cnt = tt_cmap14_def_char_count(
p );
3427 if ( tt_cmap14_ensure( cmap14, (
cnt + 1 ),
memory ) )
3430 for (
q = cmap14->results; numRanges > 0; numRanges-- )
3442 }
while ( --
cnt != 0 );
3446 return cmap14->results;
3451 tt_cmap14_get_nondef_chars(
TT_CMap cmap,
3455 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3456 FT_UInt32 numMappings;
3463 if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ),
memory ) )
3466 ret = cmap14->results;
3467 for (
i = 0;
i < numMappings;
i++ )
3479 tt_cmap14_variant_chars(
TT_CMap cmap,
3481 FT_UInt32 variantSelector )
3496 if ( defOff == 0 && nondefOff == 0 )
3500 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3502 else if ( nondefOff == 0 )
3503 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3509 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3510 FT_UInt32 numRanges;
3511 FT_UInt32 numMappings;
3521 p = cmap->
data + nondefOff;
3522 dp = cmap->
data + defOff;
3525 dcnt = tt_cmap14_def_char_count( dp );
3528 if ( numMappings == 0 )
3529 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3532 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3535 if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ),
memory ) )
3538 ret = cmap14->results;
3549 if ( nuni > duni + dcnt )
3551 for (
k = 0;
k <= dcnt;
k++ )
3552 ret[
i++] = duni +
k;
3556 if ( di > numRanges )
3569 if (
ni > numMappings )
3577 if (
ni <= numMappings )
3583 while (
ni < numMappings )
3590 else if ( di <= numRanges )
3595 for (
k = 0;
k <= dcnt;
k++ )
3596 ret[
i++] = duni +
k;
3598 while ( di < numRanges )
3603 for (
k = 0;
k <= dcnt;
k++ )
3604 ret[
i++] = duni +
k;
3617 tt_cmap14_class_rec,
3619 sizeof ( TT_CMap14Rec ),
3651#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
3672 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3677 return psnames->unicodes_init(
memory,
3679 face->root.num_glyphs,
3700 FT_UInt32 char_code )
3703 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3706 return psnames->unicodes_char_index( unicodes, char_code );
3712 FT_UInt32 *pchar_code )
3715 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)
face->psnames;
3718 return psnames->unicodes_char_next( unicodes, pchar_code );
3745#ifndef FT_CONFIG_OPTION_PIC
3749#define TTCMAPCITEM( a ) &a,
3780#define TTCMAPCITEM( a ) i++;
3785 if (
FT_ALLOC( clazz,
sizeof ( *clazz ) * (
i + 1 ) +
3791 sizeof ( *clazz ) * (
i + 1 ) );
3795#define TTCMAPCITEM( a ) \
3796 FT_Init_Class_ ## a( &recs[i] ); \
3797 clazz[i] = &recs[i]; \
3803 *output_class = clazz;
3832 " unsupported `cmap' table format = %d\n",
3839 for ( ; num_cmaps > 0 &&
p + 8 <=
limit; num_cmaps-- )
3848 charmap.
encoding = FT_ENCODING_NONE;
3851 if (
offset && offset <= face->cmap_size - 2 )
3859 for ( ; *pclazz; pclazz++ )
3879 if ( !
valid.validator.error )
3889 cmap, &charmap, &ttcmap ) )
3899 " broken cmap sub-table ignored\n" ));
3908 " unsupported cmap sub-table ignored\n" ));
3927 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_ALLOC(ptr, size)
#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_Bool(* FT_CMap_CharVarIsDefaultFunc)(FT_CMap cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
FT_UInt32 *(* FT_CMap_CharVariantListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 char_code)
#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
#define TT_CMAP_CLASSES_GET
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