*** empty log message ***
authorhanda <handa>
Tue, 23 Dec 2008 01:09:29 +0000 (01:09 +0000)
committerhanda <handa>
Tue, 23 Dec 2008 01:09:29 +0000 (01:09 +0000)
ChangeLog
src/otfopen.c

index 255dd45..2cf2e9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+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.
@@ -5,6 +22,7 @@
        * 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).
index 35ae8a3..7e7cb34 100644 (file)
@@ -199,12 +199,12 @@ free_stream (OTF_Stream *stream)
     (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)
 
@@ -520,21 +520,24 @@ read_cmap_uvs_table (OTF *otf, OTF_Stream *stream, OTF_Offset offset)
   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;
@@ -547,15 +550,18 @@ read_cmap_uvs_table (OTF *otf, OTF_Stream *stream, OTF_Offset offset)
                = &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;
@@ -566,13 +572,14 @@ read_cmap_uvs_table (OTF *otf, OTF_Stream *stream, OTF_Offset offset)
              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;
 }