(check_cmap_uvs): New function. Not yet completed.
authorhanda <handa>
Mon, 22 Dec 2008 05:53:15 +0000 (05:53 +0000)
committerhanda <handa>
Mon, 22 Dec 2008 05:53:15 +0000 (05:53 +0000)
(UVS_P): New macro.
(OTF_drive_cmap): Check UVS (Unicode Variation Sequences).

src/otfdrive.c

index a32f6a4..7d0824d 100644 (file)
@@ -1336,10 +1336,31 @@ lookup_encoding_12 (OTF_EncodingSubtable12 *sub12, OTF_GlyphString *gstring)
   return 0;
 }
 
+static void
+check_cmap_uvs (OTF_cmap *cmap, OTF_GlyphString *gstring, int idx)
+{  
+  OTF_EncodingSubtable14 *sub14;
+  int c1 = gstring->glyphs[idx - 1].c;
+  int c2 = gstring->glyphs[idx].c;
+  int i;
+
+  gstring->glyphs[idx].glyph_id = 0;
+  for (i = 0; i < cmap->numTables; i++)
+    if (cmap->EncodingRecord[i].subtable.format == 14)
+      break;
+  if (i == cmap->numTables)
+    return;
+  sub14 = cmap->EncodingRecord[i].subtable.f.f14;
+  /*  */
+}
+
 \f
 
 /* API */
 
+#define UVS_P(C)       \
+  (((C) >= 0xFE00 && (C) <= 0xFE0F) || ((C) >= 0xE0100 && (C) <= 0xE01EF))
+
 int
 OTF_drive_cmap (OTF *otf, OTF_GlyphString *gstring)
 {
@@ -1357,6 +1378,8 @@ OTF_drive_cmap (OTF *otf, OTF_GlyphString *gstring)
        int c = gstring->glyphs[i].c;
        if (c < 32 || ! cmap->unicode_table)
          gstring->glyphs[i].glyph_id = 0;
+       else if (UVS_P (c) && i > 0)
+         check_cmap_uvs (cmap, gstring, i);
        else
          gstring->glyphs[i].glyph_id = cmap->unicode_table[c];
       }