+2008-12-23 Kenichi Handa <handa@m17n.org>
+
+ * example/otfdump.c (dump_cmap_table): Fix previous change.
+
+ * src/otfdrive.c (lookup_encoding_4): Fix typo.
+
+ * src/otfopen.c (READ_UINT24): New macro.
+ (read_cmap_uvs_table): Argument changed. Complete the code.
+ (read_cmap_table): Adjusted for the above change. Fix typo.
+
+ * src/otf.h (OTF_cmapSegment): Fix typo.
+ (OTF_EncodingSubtable4): Fix typo.
+ (OTF_UVSMapping): New type.
+ (OTF_UnicodeValueRange): New type.
+ (OTF_VariationSelectorRecord): New type.
+ (OTF_EncodingSubtable14): Fix previous change.
+
2008-12-22 Kenichi Handa <handa@m17n.org>
* example/otfdump.c (dump_cmap_table): Handle format 14.
* src/otfdrive.c (check_cmap_uvs): New function. Not yet completed.
(UVS_P): New macro.
(OTF_drive_cmap): Check UVS (Unicode Variation Sequences).
+ (get_uvs_glyph): New function.
* src/otfopen.c (read_cmap_uvs_table): New function.
(read_cmap_table): Handle format 14 (Unicode Variation Sequences).
(stream)->pos += 2; \
} while (0)
-#define READ_UINT24(stream, var) \
+#define READ_UINT24(stream, var) \
do { \
STREAM_CHECK_SIZE ((stream), 3); \
(var) = (((stream)->buf[(stream)->pos ] << 16) \
- | ((stream)->buf[(stream)->pos + 1] << 8) \
- | (stream)->buf[(stream)->pos + 2]); \
+ | ((stream)->buf[(stream)->pos + 1] << 8) \
+ | (stream)->buf[(stream)->pos + 2]); \
(stream)->pos += 3; \
} while (0)
for (i = 0; i < sub14->nRecords; i++)
{
unsigned varSelector=0, defaultUVSOffset, nonDefaultUVSOffset;
+
READ_UINT24 (stream, varSelector);
- sub14->Records[i].varSelector=varSelector;
+ sub14->Records[i].varSelector = varSelector;
READ_ULONG (stream, defaultUVSOffset);
- sub14->Records[i].defaultUVSOffset=defaultUVSOffset;
+ sub14->Records[i].defaultUVSOffset = defaultUVSOffset;
READ_ULONG (stream, nonDefaultUVSOffset);
- sub14->Records[i].nonDefaultUVSOffset=nonDefaultUVSOffset;
+ sub14->Records[i].nonDefaultUVSOffset = nonDefaultUVSOffset;
}
for (i = 0; i < sub14->nRecords; i++)
{
- OTF_VariationSelectorRecord *record=&sub14->Records[i];
+ OTF_VariationSelectorRecord *record = &sub14->Records[i];
unsigned defaultUVSOffset = record->defaultUVSOffset;
unsigned nonDefaultUVSOffset = record->nonDefaultUVSOffset;
+
if (defaultUVSOffset)
{
unsigned numUnicodeValueRanges;
+
SEEK_STREAM (stream, offset+defaultUVSOffset);
READ_ULONG (stream, numUnicodeValueRanges);
record->numUnicodeValueRanges = numUnicodeValueRanges;
= &record->unicodeValueRanges[j];
unsigned startUnicodeValue;
char additionalCount;
+
READ_UINT24 (stream, startUnicodeValue);
unicodeValueRange->startUnicodeValue=startUnicodeValue;
READ_BYTES (stream, &additionalCount, 1);
- unicodeValueRange->additionalCount = (unsigned short) additionalCount;
+ unicodeValueRange->additionalCount
+ = (unsigned short) additionalCount;
}
}
if (nonDefaultUVSOffset)
{
unsigned numUVSMappings;
+
SEEK_STREAM (stream, offset+nonDefaultUVSOffset);
READ_ULONG (stream, numUVSMappings);
record->numUVSMappings = numUVSMappings;
OTF_UVSMapping *uvsMapping = &record->uvsMappings[j];
unsigned unicodeValue;
unsigned short glyphID;
+
READ_UINT24 (stream, unicodeValue);
uvsMapping->unicodeValue = unicodeValue;
READ_USHORT (stream, glyphID);
uvsMapping->glyphID = glyphID;
}
}
- }
+ }
return sub14;
}