[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] crash in FT_Get_CMap_Language_ID for synth Adobe charmaps
From: |
Masatake YAMATO |
Subject: |
Re: [Devel] crash in FT_Get_CMap_Language_ID for synth Adobe charmaps |
Date: |
Fri, 09 Jan 2004 16:36:56 +0900 (JST) |
> Lately I've been getting a repeatable crash working with
> CourierStd.otf, an OpenType/CFF font distributed with Adobe Reader.
> ...
How about the attachd patch?
I've defined a almost empty method to cff's FT_SERVICE_ID_TT_CMAP.
I don't know well about cff however, if cff(ps?) supports something
like language ID, you can hack the empty method.
2004-01-09 Masatake YAMATO <address@hidden>
* 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.
Fix a bug reported by Steve Hartwell <address@hidden> on the
devel list.
* src/sfnt/ttcmap0.c: Suggested by Steve Hartwell <address@hidden>.
break if p.s. in ttcmap0.c, it might be better to break out of the
for ( ; *pclazz; pclazz++ ) loop once the formats match so that we
don't keep looking for it after we've found it.
Index: src/sfnt/ttcmap0.c
===================================================================
RCS file: /cvsroot/freetype2/src/sfnt/ttcmap0.c,v
retrieving revision 1.36
diff -u -r1.36 ttcmap0.c
--- ttcmap0.c 2003/12/24 13:37:58 1.36
+++ ttcmap0.c 2004/01/09 07:29:40
@@ -1966,6 +1966,7 @@
FT_ERROR(( "tt_face_build_cmaps:" ));
FT_ERROR(( " broken cmap sub-table ignored!\n" ));
}
+ break;
}
}
}
Index: src/cff/cffdrivr.c
===================================================================
RCS file: /cvsroot/freetype2/src/cff/cffdrivr.c,v
retrieving revision 1.48
diff -u -r1.48 cffdrivr.c
--- cffdrivr.c 2003/12/13 18:42:31 1.48
+++ cffdrivr.c 2004/01/09 07:29:40
@@ -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"
@@ -337,6 +338,24 @@
(PS_HasGlyphNamesFunc)cff_ps_has_glyph_names
};
+ /*
+ * (Empty)TT CMAP INFO
+ *
+ * Hide TT CMAP INFO service defined in SFNT module; and
+ * just return 0.
+ */
+ static FT_Error
+ cff_get_cmap_info( FT_CharMap charmap,
+ TT_CMapInfo *cmap_info )
+ {
+ cmap_info->language = 0;
+ return CFF_Err_Ok;
+ }
+
+ static const FT_Service_TTCMapsRec cff_service_get_cmap_info =
+ {
+ cff_get_cmap_info
+ };
/*************************************************************************/
/*************************************************************************/
@@ -357,6 +376,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 }
};