From 37644550550fa48ec06d0a24dabff234c1e2a70e Mon Sep 17 00:00:00 2001 From: handa Date: Wed, 5 May 2004 00:29:44 +0000 Subject: [PATCH] *** empty log message *** --- src/config.h.in | 91 ------------------------------------------------------- src/otfopen.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 81 insertions(+), 99 deletions(-) delete mode 100644 src/config.h.in diff --git a/src/config.h.in b/src/config.h.in deleted file mode 100644 index f3d67e9..0000000 --- a/src/config.h.in +++ /dev/null @@ -1,91 +0,0 @@ -/* src/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc diff --git a/src/otfopen.c b/src/otfopen.c index 93228f0..e1f9d05 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -457,7 +457,7 @@ read_cmap_table (OTF *otf, OTF_Stream *stream) char *errfmt = "cmap%s"; void *errret = NULL; OTF_cmap *cmap; - int unicode_index = -1; + int unicode_bmp_index = -1, unicode_full_index = -1; int i; OTF_CALLOC (cmap, 1, ""); @@ -466,12 +466,27 @@ read_cmap_table (OTF *otf, OTF_Stream *stream) OTF_MALLOC (cmap->EncodingRecord, cmap->numTables, ""); for (i = 0; i < cmap->numTables; i++) { - READ_USHORT (stream, cmap->EncodingRecord[i].platformID); - READ_USHORT (stream, cmap->EncodingRecord[i].encodingID); + unsigned platformID, encodingID; + + READ_USHORT (stream, platformID); + cmap->EncodingRecord[i].platformID = platformID; + READ_USHORT (stream, encodingID); + cmap->EncodingRecord[i].encodingID = encodingID; READ_ULONG (stream, cmap->EncodingRecord[i].offset); - if (cmap->EncodingRecord[i].platformID == 3 - && cmap->EncodingRecord[i].encodingID == 1) - unicode_index = i; + if (platformID == 0) + { + if (encodingID <= 3) + unicode_bmp_index = i; + else + unicode_full_index = i; + } + else if (platformID == 3) + { + if (encodingID == 1) + unicode_bmp_index = i; + else if (encodingID == 10) + unicode_full_index = i; + } } for (i = 0; i < cmap->numTables; i++) { @@ -503,6 +518,7 @@ read_cmap_table (OTF *otf, OTF_Stream *stream) break; case 2: + OTF_ERROR (OTF_ERROR_TABLE, " (not yet supported)"); break; case 4: @@ -560,12 +576,69 @@ read_cmap_table (OTF *otf, OTF_Stream *stream) for (j = 0; j < sub6->entryCount; j++) READ_USHORT (stream, sub6->glyphIdArray[j]); } + break; + + case 8: + { + OTF_EncodingSubtable8 *sub8; + int j; + + OTF_MALLOC (sub8, 1, " (EncodingSubtable8)"); + cmap->EncodingRecord[i].subtable.f.f8 = sub8; + for (j = 0; j < 8192; j++) + READ_BYTES (stream, sub8->is32, 8192); + READ_ULONG (stream, sub8->nGroups); + OTF_MALLOC (sub8->Groups, sub8->nGroups, " (Groups)"); + for (j = 0; j < sub8->nGroups; j++) + { + READ_ULONG (stream, sub8->Groups[i].startCharCode); + READ_ULONG (stream, sub8->Groups[i].endCharCode); + READ_ULONG (stream, sub8->Groups[i].startGlyphID); + } + } + break; + + case 10: + { + OTF_EncodingSubtable10 *sub10; + int j; + + OTF_MALLOC (sub10, 1, " (EncodingSubtable10)"); + cmap->EncodingRecord[i].subtable.f.f10 = sub10; + READ_ULONG (stream, sub10->startCharCode); + READ_ULONG (stream, sub10->numChars); + OTF_MALLOC (sub10->glyphs, sub10->numChars, " (GlyphCount)"); + for (j = 0; j < sub10->numChars; j++) + READ_USHORT (stream, sub10->glyphs[j]); + } + break; + + case 12: + { + OTF_EncodingSubtable12 *sub12; + int j; + + OTF_MALLOC (sub12, 1, " (EncodingSubtable12)"); + cmap->EncodingRecord[i].subtable.f.f12 = sub12; + READ_ULONG (stream, sub12->nGroups); + OTF_MALLOC (sub12->Groups, sub12->nGroups, " (Groups)"); + for (j = 0; j < sub12->nGroups; j++) + { + READ_ULONG (stream, sub12->Groups[i].startCharCode); + READ_ULONG (stream, sub12->Groups[i].endCharCode); + READ_ULONG (stream, sub12->Groups[i].startGlyphID); + } + } + break; + + default: + OTF_ERROR (OTF_ERROR_TABLE, " (invalid Subtable format)"); } } - if (unicode_index >= 0) + if (unicode_bmp_index >= 0) { - OTF_EncodingRecord *rec = cmap->EncodingRecord + unicode_index; + OTF_EncodingRecord *rec = cmap->EncodingRecord + unicode_bmp_index; OTF_GlyphID glyph_id, max_glyph_id = 0; OTF_CALLOC (cmap->unicode_table, 0x10000, ""); -- 1.7.10.4