additionnal backwards-compatibility hacks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 71944b8..6f1b8ea 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -316,8 +316,40 @@
query.char_code = (FT_UInt32)cmap_index;
break;
+ case FTC_OLD_CMAP_BY_ENCODING:
+ case FTC_OLD_CMAP_BY_ID:
+ {
+ FT_Face face;
+ FT_Int nn;
+
+ error = FTC_Manager_LookupFace( cache->manager, desc->face_id,
+ &face );
+ if ( error )
+ return error;
+
+ if ( desc->type == FTC_OLD_CMAP_BY_ENCODING )
+ {
+ for ( nn = 0; nn < face->num_charmaps; nn++ )
+ if ( face->charmaps[nn]->encoding == desc->u.encoding )
+ break;
+ }
+ else
+ {
+ for ( nn = 0; nn < face->num_charmaps; nn++ )
+ if ( face->charmaps[nn]->platform_id == desc->u.id.platform &&
+ face->charmaps[nn]->encoding_id == desc->u.id.encoding )
+ break;
+ }
+
+ if ( nn >= face->num_charmaps )
+ return 0;
+
+ query.cmap_index = (FT_UInt)nn;
+ }
+ break;
+
default:
- return FT_Err_Unimplemented_Feature;
+ return 0;
}
}
else