changeset 99108:411ea0d5dade

(ftfont_otf_features): Fix previous change. (ftfont_otf_capability): Check FeatureList.FeatureCount before calling ftfont_otf_features.
author Kenichi Handa <handa@m17n.org>
date Fri, 24 Oct 2008 13:11:56 +0000
parents 83e9dcef8ef7
children 8b53f3fcb473
files src/ftfont.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ftfont.c	Fri Oct 24 09:44:46 2008 +0000
+++ b/src/ftfont.c	Fri Oct 24 13:11:56 2008 +0000
@@ -1360,7 +1360,7 @@
 	  for (features = Qnil, k = otf_langsys->FeatureCount - 1; k >= 0; k--)
 	    {
 	      l = otf_langsys->FeatureIndex[k];
-	      if (l > gsub_gpos->FeatureList.FeatureCount)
+	      if (l >= gsub_gpos->FeatureList.FeatureCount)
 		continue;
 	      OTF_TAG_SYM (sym, gsub_gpos->FeatureList.Feature[l].FeatureTag);
 	      features = Fcons (sym, features);
@@ -1391,9 +1391,11 @@
   if (! otf)
     return Qnil;
   gsub_gpos = Fcons (Qnil, Qnil);
-  if (OTF_get_table (otf, "GSUB") == 0)
+  if (OTF_get_table (otf, "GSUB") == 0
+      && otf->gsub->FeatureList.FeatureCount > 0)
     XSETCAR (gsub_gpos, ftfont_otf_features (otf->gsub));
-  if (OTF_get_table (otf, "GPOS") == 0)
+  if (OTF_get_table (otf, "GPOS") == 0
+      && otf->gpos->FeatureList.FeatureCount > 0)
     XSETCDR (gsub_gpos, ftfont_otf_features (otf->gpos));
   return gsub_gpos;
 }