\f
/*** (1-4) "cmap" table */
+static OTF_EncodingSubtable14 *
+read_cmap_uvs_table (OTF *otf, OTF_Stream *stream, int nbytes)
+{
+ OTF_EncodingSubtable14 *sub14;
+ char *errfmt = "cmap-uvs%s";
+ void *errret = NULL;
+ int i;
+
+ OTF_MALLOC (sub14, 1, " (EncodingSubtable14)");
+ sub14->nbytes = nbytes;
+ OTF_MALLOC (sub14->data, nbytes, " (EncodingSubtable14-Data)");
+ READ_BYTES (stream, sub14->data, nbytes);
+ return sub14;
+}
+
static void *
read_cmap_table (OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
{
SEEK_STREAM (stream, cmap->EncodingRecord[i].offset);
READ_USHORT (stream, format);
cmap->EncodingRecord[i].subtable.format = format;
- READ_USHORT (stream, cmap->EncodingRecord[i].subtable.length);
- if (format == 8 || format == 10 || format == 12)
+ if (format == 14)
{
- READ_ULONG (stream, cmap->EncodingRecord[i].subtable.length);
- READ_ULONG (stream, cmap->EncodingRecord[i].subtable.language);
+ READ_ULONG (stream, cmap->EncodingRecord[i].subtable.length);
+ cmap->EncodingRecord[i].subtable.language = 0;
}
else
{
- READ_USHORT (stream, cmap->EncodingRecord[i].subtable.language);
+ READ_USHORT (stream, cmap->EncodingRecord[i].subtable.length);
+ if (format == 8 || format == 10 || format == 12)
+ {
+ READ_ULONG (stream, cmap->EncodingRecord[i].subtable.length);
+ READ_ULONG (stream, cmap->EncodingRecord[i].subtable.language);
+ }
+ else
+ {
+ READ_USHORT (stream, cmap->EncodingRecord[i].subtable.language);
+ }
}
switch (format)
{
}
break;
+ case 14:
+ {
+ cmap->EncodingRecord[i].subtable.f.f14
+ = read_cmap_uvs_table (otf, stream,
+ cmap->EncodingRecord[i].subtable.length
+ - 6);
+ break;
+ }
+
default:
OTF_ERROR (OTF_ERROR_TABLE, " (invalid Subtable format)");
}