20 #include FT_INTERNAL_DEBUG_H 24 #include FT_INTERNAL_VALIDATE_H 25 #include FT_INTERNAL_STREAM_H 38 #define FT_COMPONENT trace_ttcmap 41 #define TT_PEEK_SHORT FT_PEEK_SHORT 42 #define TT_PEEK_USHORT FT_PEEK_USHORT 43 #define TT_PEEK_UINT24 FT_PEEK_UOFF3 44 #define TT_PEEK_LONG FT_PEEK_LONG 45 #define TT_PEEK_ULONG FT_PEEK_ULONG 47 #define TT_NEXT_SHORT FT_NEXT_SHORT 48 #define TT_NEXT_USHORT FT_NEXT_USHORT 49 #define TT_NEXT_UINT24 FT_NEXT_UOFF3 50 #define TT_NEXT_LONG FT_NEXT_LONG 51 #define TT_NEXT_ULONG FT_NEXT_ULONG 85 #ifdef TT_CONFIG_CMAP_FORMAT_0 95 if (
table + length > valid->limit || length < 262 )
105 for ( n = 0; n < 256; n++ )
118 tt_cmap0_char_index(
TT_CMap cmap,
124 return char_code < 256 ? table[6 + char_code] : 0;
129 tt_cmap0_char_next(
TT_CMap cmap,
139 while ( ++charcode < 256 )
141 gindex = table[charcode];
155 tt_cmap0_get_info(
TT_CMap cmap,
276 #ifdef TT_CONFIG_CMAP_FORMAT_2 290 if (
table + length > valid->limit || length < 6 + 512 )
298 for ( n = 0; n < 256; n++ )
309 if ( idx > max_subs )
316 glyph_ids = subs + (max_subs + 1) * 8;
317 if ( glyph_ids > valid->limit )
321 for ( n = 0; n <= max_subs; n++ )
334 if ( code_count == 0 )
340 if ( first_code >= 256 || first_code + code_count > 256 )
363 idx = ( idx + delta ) & 0xFFFFU;
385 if ( char_code < 0x10000UL )
430 tt_cmap2_char_index(
TT_CMap cmap,
438 subheader = tt_cmap2_get_subheader( table, char_code );
454 if ( idx < count && offset != 0 )
456 p += offset + 2 *
idx;
460 result = (
FT_UInt)( idx + delta ) & 0xFFFFU;
468 tt_cmap2_char_next(
TT_CMap cmap,
478 while ( charcode < 0x10000UL )
480 subheader = tt_cmap2_get_subheader( table, charcode );
495 if ( char_lo < start )
501 pos = (
FT_UInt)( char_lo - start );
503 p += offset + pos * 2;
506 for ( ; pos <
count; pos++, charcode++ )
512 gindex = ( idx + delta ) & 0xFFFFU;
535 tt_cmap2_get_info(
TT_CMap cmap,
641 #ifdef TT_CONFIG_CMAP_FORMAT_4 643 typedef struct TT_CMap4Rec_
656 } TT_CMap4Rec, *TT_CMap4;
660 tt_cmap4_init( TT_CMap4 cmap,
670 cmap->cur_charcode = (
FT_UInt32)0xFFFFFFFFUL;
671 cmap->cur_gindex = 0;
678 tt_cmap4_set_range( TT_CMap4 cmap,
683 FT_UInt num_ranges = cmap->num_ranges;
686 while ( range_index < num_ranges )
691 p = table + 14 + range_index * 2;
694 p += 2 + num_ranges * 2;
705 if ( range_index >= num_ranges - 1 &&
706 cmap->cur_start == 0xFFFFU &&
707 cmap->cur_end == 0xFFFFU )
713 if ( offset && p + offset + 2 >
limit )
720 if ( offset != 0xFFFFU )
722 cmap->cur_values = offset ? p +
offset :
NULL;
723 cmap->cur_range = range_index;
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;
757 FT_Int delta = cmap->cur_delta;
760 if ( charcode <= end )
764 FT_Byte*
p = values + 2 * ( charcode - cmap->cur_start );
774 gindex = (
FT_UInt)( ( gindex + delta ) & 0xFFFFU );
777 cmap->cur_charcode = charcode;
778 cmap->cur_gindex = gindex;
782 }
while ( ++charcode <= end );
793 cmap->cur_charcode = charcode;
794 cmap->cur_gindex = gindex;
797 }
while ( ++charcode <= end );
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;
821 FT_Byte *ends, *starts, *offsets, *deltas, *glyph_ids;
831 if (
table + length > valid->limit )
851 if ( length < 16 + num_segs * 2 * 4 )
864 if ( ( search_range | range_shift ) & 1 )
872 if ( search_range > num_segs ||
873 search_range * 2 < num_segs ||
874 search_range + range_shift != num_segs ||
875 search_range != ( 1U << entry_selector ) )
880 starts =
table + 16 + num_segs * 2;
881 deltas = starts + num_segs * 2;
882 offsets = deltas + num_segs * 2;
883 glyph_ids = offsets + num_segs * 2;
888 p = ends + ( num_segs - 1 ) * 2;
895 FT_UInt last_start = 0, last_end = 0;
903 for ( n = 0; n < num_segs; n++ )
927 if ( last_start > start || last_end > end )
934 if ( offset && offset != 0xFFFFU )
941 if ( p < glyph_ids ||
942 p + ( end - start + 1 ) * 2 >
table + length )
955 else if ( n != num_segs - 1 ||
956 !( start == 0xFFFFU && end == 0xFFFFU ) )
958 if ( p < glyph_ids ||
959 p + ( end - start + 1 ) * 2 > valid->limit )
969 for ( i = start; i <
end; i++ )
974 idx = (
FT_UInt)( idx + delta ) & 0xFFFFU;
982 else if ( offset == 0xFFFFU )
989 !( start == 0xFFFFU && end == 0xFFFFU ) )
1003 tt_cmap4_char_map_linear(
TT_CMap cmap,
1018 num_segs = num_segs2 >> 1;
1027 for ( ; charcode <= 0xFFFFU; charcode++ )
1032 p = cmap->
data + 14;
1033 q = cmap->
data + 16 + num_segs2;
1035 for ( i = 0; i < num_segs; i++ )
1040 if ( charcode >= start && charcode <= end )
1042 p = q - 2 + num_segs2;
1049 if ( i >= num_segs - 1 &&
1050 start == 0xFFFFU && end == 0xFFFFU )
1056 if ( offset && p + offset + 2 >
limit )
1063 if ( offset == 0xFFFFU )
1068 p += offset + ( charcode -
start ) * 2;
1071 gindex = (
FT_UInt)( gindex + delta ) & 0xFFFFU;
1074 gindex = (
FT_UInt)( charcode + delta ) & 0xFFFFU;
1080 if ( !next || gindex )
1084 if ( next && gindex )
1085 *pcharcode = charcode;
1092 tt_cmap4_char_map_binary(
TT_CMap cmap,
1110 num_segs = num_segs2 >> 1;
1125 mid = ( min +
max ) >> 1;
1126 p = cmap->
data + 14 + mid * 2;
1131 if ( charcode < start )
1133 else if ( charcode > end )
1144 if ( mid >= num_segs - 1 &&
1145 start == 0xFFFFU && end == 0xFFFFU )
1151 if ( offset && p + offset + 2 >
limit )
1167 if ( offset == 0xFFFFU )
1171 for ( i = max ; i > 0; i-- )
1178 p = cmap->
data + 14 + ( i - 1 ) * 2;
1181 if ( charcode > prev_end )
1195 if ( offset != 0xFFFFU )
1200 if ( mid == max + 1 )
1204 p = cmap->
data + 14 + max * 2;
1217 for ( i = max + 1; i < num_segs; i++ )
1222 p = cmap->
data + 14 + i * 2;
1227 if ( charcode < next_start )
1237 if ( offset != 0xFFFFU )
1254 p = cmap->
data + 14 + mid * 2;
1266 if ( offset == 0xFFFFU )
1272 p += offset + ( charcode -
start ) * 2;
1275 gindex = (
FT_UInt)( gindex + delta ) & 0xFFFFU;
1278 gindex = (
FT_UInt)( charcode + delta ) & 0xFFFFU;
1286 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1293 if ( charcode > end )
1296 if ( mid == num_segs )
1300 if ( tt_cmap4_set_range( cmap4, mid ) )
1303 *pcharcode = charcode;
1307 cmap4->cur_charcode = charcode;
1310 cmap4->cur_gindex = gindex;
1313 cmap4->cur_charcode = charcode;
1314 tt_cmap4_next( cmap4 );
1315 gindex = cmap4->cur_gindex;
1319 *pcharcode = cmap4->cur_charcode;
1328 tt_cmap4_char_index(
TT_CMap cmap,
1331 if ( char_code >= 0x10000UL )
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,
1348 if ( *pchar_code >= 0xFFFFU )
1352 gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );
1355 TT_CMap4 cmap4 = (TT_CMap4)cmap;
1359 if ( *pchar_code == cmap4->cur_charcode )
1361 tt_cmap4_next( cmap4 );
1362 gindex = cmap4->cur_gindex;
1364 *pchar_code = cmap4->cur_charcode;
1367 gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );
1375 tt_cmap4_get_info(
TT_CMap cmap,
1390 sizeof ( TT_CMap4Rec ),
1435 #ifdef TT_CONFIG_CMAP_FORMAT_6 1445 if (
table + 10 > valid->limit )
1454 if (
table + length > valid->limit || length < 10 + count * 2 )
1463 for ( ; count > 0; count-- )
1476 tt_cmap6_char_index(
TT_CMap cmap,
1497 tt_cmap6_char_next(
TT_CMap cmap,
1511 if ( char_code >= 0x10000UL )
1514 if ( char_code < start )
1517 idx = (
FT_UInt)( char_code - start );
1520 for ( ; idx <
count; idx++ )
1538 tt_cmap6_get_info(
TT_CMap cmap,
1627 #ifdef TT_CONFIG_CMAP_FORMAT_8 1639 if (
table + 16 + 8192 > valid->limit )
1643 if ( length > (
FT_UInt32)( valid->limit -
table ) || length < 8192 + 16 )
1650 if ( p + num_groups * 12 > valid->limit )
1658 for ( n = 0; n < num_groups; n++ )
1670 if ( n > 0 && start <= last )
1680 if ( start & ~0xFFFFU )
1684 for ( ; count > 0; count--, start++ )
1686 hi = (
FT_UInt)( start >> 16 );
1687 lo = (
FT_UInt)( start & 0xFFFFU );
1689 if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )
1692 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )
1702 if ( end & ~0xFFFFU )
1705 for ( ; count > 0; count--, start++ )
1707 lo = (
FT_UInt)( start & 0xFFFFU );
1709 if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )
1724 tt_cmap8_char_index(
TT_CMap cmap,
1734 for ( ; num_groups > 0; num_groups-- )
1740 if ( char_code < start )
1743 if ( char_code <= end )
1745 result = (
FT_UInt)( start_id + char_code - start );
1754 tt_cmap8_char_next(
TT_CMap cmap,
1768 for ( ; num_groups > 0; num_groups-- )
1774 if ( char_code < start )
1777 if ( char_code <= end )
1779 gindex = (
FT_UInt)( char_code - start + start_id );
1795 tt_cmap8_get_info(
TT_CMap cmap,
1855 #ifdef TT_CONFIG_CMAP_FORMAT_10 1865 if (
table + 20 > valid->limit )
1873 length < 20 + count * 2 )
1882 for ( ; count > 0; count-- )
1895 tt_cmap10_char_index(
TT_CMap cmap,
1916 tt_cmap10_char_next(
TT_CMap cmap,
1928 if ( char_code < start )
1934 for ( ; idx <
count; idx++ )
1942 *pchar_code = char_code;
1948 tt_cmap10_get_info(
TT_CMap cmap,
1962 tt_cmap10_class_rec,
2012 #ifdef TT_CONFIG_CMAP_FORMAT_12 2014 typedef struct TT_CMap12Rec_
2023 } TT_CMap12Rec, *TT_CMap12;
2027 tt_cmap12_init( TT_CMap12 cmap,
2050 if (
table + 16 > valid->limit )
2060 length < 16 + 12 * num_groups )
2068 for ( n = 0; n < num_groups; n++ )
2077 if ( n > 0 && start <= last )
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;
2120 if ( char_code < start )
2123 for ( ; char_code <=
end; char_code++ )
2125 gindex = (
FT_UInt)( start_id + char_code - start );
2129 cmap->cur_charcode = char_code;;
2130 cmap->cur_gindex = gindex;
2131 cmap->cur_group =
n;
2144 tt_cmap12_char_map_binary(
TT_CMap cmap,
2172 mid = ( min +
max ) >> 1;
2173 p = cmap->
data + 16 + 12 * mid;
2178 if ( char_code < start )
2180 else if ( char_code > end )
2185 gindex = (
FT_UInt)( start_id + char_code - start );
2193 TT_CMap12 cmap12 = (TT_CMap12)cmap;
2200 if ( char_code > end )
2203 if ( mid == num_groups )
2208 cmap12->cur_charcode = char_code;
2209 cmap12->cur_group = mid;
2213 tt_cmap12_next( cmap12 );
2215 if ( cmap12->valid )
2216 gindex = cmap12->cur_gindex;
2219 cmap12->cur_gindex = gindex;
2222 *pchar_code = cmap12->cur_charcode;
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;
2245 if ( cmap12->cur_charcode >= 0xFFFFFFFFUL )
2249 if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )
2251 tt_cmap12_next( cmap12 );
2252 if ( cmap12->valid )
2254 gindex = cmap12->cur_gindex;
2258 *pchar_code = (
FT_UInt32)cmap12->cur_charcode;
2264 gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
2272 tt_cmap12_get_info(
TT_CMap cmap,
2286 tt_cmap12_class_rec,
2287 sizeof ( TT_CMap12Rec ),
2336 #ifdef TT_CONFIG_CMAP_FORMAT_13 2338 typedef struct TT_CMap13Rec_
2347 } TT_CMap13Rec, *TT_CMap13;
2351 tt_cmap13_init( TT_CMap13 cmap,
2374 if (
table + 16 > valid->limit )
2384 length < 16 + 12 * num_groups )
2392 for ( n = 0; n < num_groups; n++ )
2401 if ( n > 0 && start <= last )
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;
2444 if ( char_code < start )
2447 if ( char_code <= end )
2453 cmap->cur_charcode = char_code;;
2454 cmap->cur_gindex = gindex;
2455 cmap->cur_group =
n;
2468 tt_cmap13_char_map_binary(
TT_CMap cmap,
2496 mid = ( min +
max ) >> 1;
2497 p = cmap->
data + 16 + 12 * mid;
2502 if ( char_code < start )
2504 else if ( char_code > end )
2516 TT_CMap13 cmap13 = (TT_CMap13)cmap;
2522 if ( char_code > end )
2525 if ( mid == num_groups )
2530 cmap13->cur_charcode = char_code;
2531 cmap13->cur_group = mid;
2535 tt_cmap13_next( cmap13 );
2537 if ( cmap13->valid )
2538 gindex = cmap13->cur_gindex;
2541 cmap13->cur_gindex = gindex;
2544 *pchar_code = cmap13->cur_charcode;
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;
2567 if ( cmap13->cur_charcode >= 0xFFFFFFFFUL )
2571 if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )
2573 tt_cmap13_next( cmap13 );
2574 if ( cmap13->valid )
2576 gindex = cmap13->cur_gindex;
2578 *pchar_code = cmap13->cur_charcode;
2584 gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );
2591 tt_cmap13_get_info(
TT_CMap cmap,
2605 tt_cmap13_class_rec,
2606 sizeof ( TT_CMap13Rec ),
2687 #ifdef TT_CONFIG_CMAP_FORMAT_14 2689 typedef struct TT_CMap14Rec_
2702 } TT_CMap14Rec, *TT_CMap14;
2706 tt_cmap14_done( TT_CMap14 cmap )
2711 cmap->max_results = 0;
2712 if ( memory !=
NULL && cmap->results !=
NULL )
2718 tt_cmap14_ensure( TT_CMap14 cmap,
2726 if ( num_results > cmap->max_results )
2728 cmap->memory = memory;
2733 cmap->max_results = num_results;
2741 tt_cmap14_init( TT_CMap14 cmap,
2748 cmap->max_results = 0;
2749 cmap->results =
NULL;
2765 length < 10 + 11 * num_selectors )
2776 for ( n = 0; n < num_selectors; n++ )
2783 if ( defOff >= length || nondefOff >= length )
2786 if ( varSel < lastVarSel )
2789 lastVarSel = varSel + 1;
2801 if ( defp + numRanges * 4 > valid->limit )
2804 for ( i = 0; i < numRanges; ++
i )
2810 if ( base + cnt >= 0x110000UL )
2813 if ( base < lastBase )
2816 lastBase = base + cnt + 1U;
2821 if ( nondefOff != 0 )
2828 if ( numMappings * 4 > (
FT_ULong)( valid->limit - ndp ) )
2831 for ( i = 0; i < numMappings; ++
i )
2837 if ( uni >= 0x110000UL )
2840 if ( uni < lastUni )
2858 tt_cmap14_char_index(
TT_CMap cmap,
2870 tt_cmap14_char_next(
TT_CMap cmap,
2882 tt_cmap14_get_info(
TT_CMap cmap,
2889 cmap_info->
language = 0xFFFFFFFFUL;
2896 tt_cmap14_char_map_def_binary(
FT_Byte *base,
2917 if ( char_code < start )
2919 else if ( char_code > start+cnt )
2930 tt_cmap14_char_map_nondef_binary(
FT_Byte *base,
2950 if ( char_code < uni )
2952 else if ( char_code > uni )
2963 tt_cmap14_find_variant(
FT_Byte *base,
2983 if ( variantCode < varSel )
2985 else if ( variantCode > varSel )
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 ) )
3020 if ( nondefOff != 0 )
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 ) )
3048 if ( nondefOff != 0 &&
3049 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3058 tt_cmap14_variants(
TT_CMap cmap,
3061 TT_CMap14 cmap14 = (TT_CMap14)cmap;
3068 if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )
3071 result = cmap14->results;
3072 for ( i = 0; i <
count; ++
i )
3084 tt_cmap14_char_variants(
TT_CMap cmap,
3088 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3094 if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )
3097 for ( q = cmap14->results; count > 0; --count )
3104 if ( ( defOff != 0 &&
3105 tt_cmap14_char_map_def_binary( cmap->
data + defOff,
3108 tt_cmap14_char_map_nondef_binary( cmap->
data + nondefOff,
3117 return cmap14->results;
3122 tt_cmap14_def_char_count(
FT_Byte *
p )
3129 for ( ; numRanges > 0; numRanges-- )
3140 tt_cmap14_get_def_chars(
TT_CMap cmap,
3144 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3150 cnt = tt_cmap14_def_char_count(
p );
3153 if ( tt_cmap14_ensure( cmap14, ( cnt + 1 ), memory ) )
3156 for ( q = cmap14->results; numRanges > 0; --numRanges )
3168 }
while ( --cnt != 0 );
3172 return cmap14->results;
3177 tt_cmap14_get_nondef_chars(
TT_CMap cmap,
3181 TT_CMap14 cmap14 = (TT_CMap14) cmap;
3189 if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ), memory ) )
3192 ret = cmap14->results;
3193 for ( i = 0; i < numMappings; ++
i )
3205 tt_cmap14_variant_chars(
TT_CMap cmap,
3223 if ( defOff == 0 && nondefOff == 0 )
3227 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3229 else if ( nondefOff == 0 )
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;
3250 dcnt = tt_cmap14_def_char_count( dp );
3253 if ( numMappings == 0 )
3254 return tt_cmap14_get_def_chars( cmap, cmap->
data + defOff,
3257 return tt_cmap14_get_nondef_chars( cmap, cmap->
data + nondefOff,
3260 if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ), memory ) )
3263 ret = cmap14->results;
3274 if ( nuni > duni + dcnt )
3276 for ( k = 0; k <= dcnt; ++k )
3277 ret[i++] = duni + k;
3281 if ( di > numRanges )
3294 if ( ni > numMappings )
3302 if ( ni <= numMappings )
3308 while ( ni < numMappings )
3315 else if ( di <= numRanges )
3320 for ( k = 0; k <= dcnt; ++k )
3321 ret[i++] = duni + k;
3323 while ( di < numRanges )
3328 for ( k = 0; k <= dcnt; ++k )
3329 ret[i++] = duni + k;
3342 tt_cmap14_class_rec,
3343 sizeof ( TT_CMap14Rec ),
3364 #ifndef FT_CONFIG_OPTION_PIC 3368 #define TTCMAPCITEM( a ) &a, 3388 FT_Create_Class_tt_cmap_classes(
FT_Library library,
3399 #define TTCMAPCITEM( a ) i++; 3404 if (
FT_ALLOC( clazz,
sizeof ( *clazz ) * ( i + 1 ) +
3410 sizeof ( *clazz ) * ( i + 1 ) );
3414 #define TTCMAPCITEM( a ) \ 3415 FT_Init_Class_ ## a( &recs[i] ); \ 3416 clazz[i] = &recs[i]; \ 3422 *output_class = clazz;
3452 " unsupported `cmap' table format = %d\n",
3459 #ifdef FT_MAX_CHARMAP_CACHEABLE 3460 if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE )
3461 FT_ERROR((
"tt_face_build_cmaps: too many cmap subtables (%d)\n" 3462 " subtable #%d and higher are loaded" 3463 " but cannot be searched\n",
3464 num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
3467 for ( ; num_cmaps > 0 &&
p + 8 <=
limit; num_cmaps-- )
3476 charmap.
encoding = FT_ENCODING_NONE;
3487 for ( ; *pclazz; pclazz++ )
3490 if ( clazz->
format == format )
3517 cmap, &charmap, &ttcmap ) )
3527 " broken cmap sub-table ignored\n" ));
3533 if ( *pclazz ==
NULL )
3536 " unsupported cmap sub-table ignored\n" ));
GLenum GLuint GLenum GLsizei length
#define FT_ALLOC(ptr, size)
#define FT_QRENEW_ARRAY(ptr, curcnt, newcnt)
FT_UInt(* FT_CMap_CharIndexFunc)(FT_CMap cmap, FT_UInt32 char_code)
FT_Error(* TT_CMap_ValidateFunc)(FT_Byte *data, FT_Validator valid)
tt_face_build_cmaps(TT_Face face)
GLdouble GLdouble GLdouble GLdouble q
FT_UInt32 *(* FT_CMap_VariantCharListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 variant_selector)
return FT_THROW(Missing_Property)
tt_cmap_init(TT_CMap cmap, FT_Byte *table)
void(* FT_CMap_DoneFunc)(FT_CMap cmap)
#define FT_NEXT_BYTE(buffer)
#define FT_INVALID_TOO_SHORT
#define FT_PAD_FLOOR(x, n)
TT_CMap_ValidateFunc validate
tt_get_cmap_info(FT_CharMap charmap, TT_CMapInfo *cmap_info)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
TT_CMap_Info_GetFunc get_cmap_info
#define FT_ERROR(varformat)
const struct TT_CMap_ClassRec_ * TT_CMap_Class
#define FT_ASSERT(condition)
FT_CMap_CharIndexFunc char_index
struct FT_CMapRec_ * FT_CMap
FT_UInt32 *(* FT_CMap_VariantListFunc)(FT_CMap cmap, FT_Memory mem)
struct TT_FaceRec_ * TT_Face
float min(float a, float b)
typedefFT_BEGIN_HEADER struct FT_ValidatorRec_ volatile * FT_Validator
#define FT_CALLBACK_DEF(x)
FT_ValidatorRec validator
#define FT_PEEK_USHORT(p)
#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_)
GLboolean GLenum GLenum GLvoid * values
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_NEXT_USHORT(buffer)
FT_Error(* TT_CMap_Info_GetFunc)(FT_CharMap charmap, TT_CMapInfo *cmap_info)
if(!abbox) return FT_THROW(Invalid_Argument)
struct TT_CMapRec_ * TT_CMap
#define FT_INVALID_OFFSET
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
#define TT_VALID_GLYPH_COUNT(x)
#define TT_CMAP_FLAG_UNSORTED
ft_validator_init(FT_Validator valid, const FT_Byte *base, const FT_Byte *limit, FT_ValidationLevel level)
#define TT_CMAP_FLAG_OVERLAPPING
FT_UInt(* FT_CMap_CharNextFunc)(FT_CMap cmap, FT_UInt32 *achar_code)
GLuint GLuint GLsizei count
#define TT_CMAP_CLASSES_GET
#define FT_INVALID_GLYPH_ID
FT_TRACE0(("cff_property_set: missing property `%s'\, property_name))
#define FT_FACE_LIBRARY(x)
GLenum GLsizei GLenum GLenum const GLvoid * table
FT_Error(* FT_CMap_InitFunc)(FT_CMap cmap, FT_Pointer init_data)
FT_UInt32 *(* FT_CMap_CharVariantListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 char_code)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
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)