Make `FT_Get_CMap_Language_ID' work with CFF. Bug reported by Steve Hartwell <shspamsink@comcast.net>. * src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H. (cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP. (cff_get_cmap_info): New function. (cff_service_get_cmap_info) New entry for cff_services. * src/sfnt/ttcmap0.c: Exit loop after a format match has been found. Suggested by Steve Hartwell <shspamsink@comcast.net>.
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
diff --git a/ChangeLog b/ChangeLog
index 3710b45..343bd79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-01-10 Masatake YAMATO <jet@gyve.org>
+
+ Make `FT_Get_CMap_Language_ID' work with CFF. Bug reported by
+ Steve Hartwell <shspamsink@comcast.net>.
+
+ * src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H.
+ (cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP.
+ (cff_get_cmap_info): New function.
+ (cff_service_get_cmap_info) New entry for cff_services.
+
+ * src/sfnt/ttcmap0.c: Exit loop after a format match has been found.
+ Suggested by Steve Hartwell <shspamsink@comcast.net>.
+
2004-01-03 Masatake YAMATO <jet@gyve.org>
* src/base/ftobjs.c (destroy_charmaps): New function.
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 9ddb379..3a24a5d 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,7 @@
#include FT_TRUETYPE_IDS_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
+#include FT_SERVICE_TT_CMAP_H
#include "cffdrivr.h"
#include "cffgload.h"
@@ -338,6 +339,32 @@
};
+ /*
+ * (empty) TT CMAP INFO
+ *
+ * Hide TT CMAP INFO service defined in SFNT module;
+ * just return 0.
+ *
+ */
+
+ static FT_Error
+ cff_get_cmap_info( FT_CharMap charmap,
+ TT_CMapInfo *cmap_info )
+ {
+ FT_UNUSED( charmap );
+
+ cmap_info->language = 0;
+
+ return CFF_Err_Ok;
+ }
+
+
+ static const FT_Service_TTCMapsRec cff_service_get_cmap_info =
+ {
+ (TT_CMap_Info_GetFunc)cff_get_cmap_info
+ };
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -357,6 +384,7 @@
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
{ FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict },
#endif
+ { FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info },
{ NULL, NULL }
};
diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c
index ae39413..dd1c76a 100644
--- a/src/sfnt/ttcmap0.c
+++ b/src/sfnt/ttcmap0.c
@@ -1966,6 +1966,7 @@
FT_ERROR(( "tt_face_build_cmaps:" ));
FT_ERROR(( " broken cmap sub-table ignored!\n" ));
}
+ break;
}
}
}