(update_seq_area): Drive features of the
authorhanda <handa>
Fri, 10 Jul 2009 06:35:57 +0000 (06:35 +0000)
committerhanda <handa>
Fri, 10 Jul 2009 06:35:57 +0000 (06:35 +0000)
correct script and langsys.

example/otfview.c

index 153b141..a6585a4 100644 (file)
@@ -368,8 +368,20 @@ update_seq_area ()
   XDrawLine (display, seq_pixmap, gc_set, 0, glyph_y, render_width, glyph_y);
   if (otf)
     {
+      char *script_name = NULL, *langsys_name = NULL, buf[10];
       char *str;
 
+      if (script_tag)
+       {
+         script_name = buf;
+         OTF_tag_name (script_tag, script_name);
+       }
+      if (langsys_tag)
+       {
+         langsys_name = buf + 5;
+         OTF_tag_name (langsys_tag, langsys_name);
+       }
+
       OTF_drive_gdef (otf, &gstring);
       OTF_drive_cmap (otf, &gstring);
       if (otf->gsub)
@@ -378,9 +390,10 @@ update_seq_area ()
          if (str)
            {
              if (do_alternate_subst)
-               OTF_drive_gsub_alternate (otf, &gstring, NULL, NULL, str);
+               OTF_drive_gsub_alternate (otf, &gstring,
+                                         script_name, langsys_name, str);
              else
-               OTF_drive_gsub (otf, &gstring, NULL, NULL, str);
+               OTF_drive_gsub (otf, &gstring, script_name, langsys_name, str);
              free (str);
            }
        }
@@ -389,7 +402,7 @@ update_seq_area ()
          str = get_features (&otf->gpos->FeatureList, &gpos);
          if (str)
            {
-             OTF_drive_gpos2 (otf, &gstring, NULL, NULL, str);
+             OTF_drive_gpos2 (otf, &gstring, script_name, langsys_name, str);
              free (str);
            }
        }