summaryrefslogtreecommitdiff
path: root/src/ftfont.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-10-24 13:12:55 +0000
committerKenichi Handa <handa@m17n.org>2008-10-24 13:12:55 +0000
commit064766f2e8c5393c16fd2e95f81d3a6c3afd9014 (patch)
tree782895c19a2399ac5393634c216c54afe3406f20 /src/ftfont.c
parent091b0137bf6839a3ba61dcc7ea35214c7ecd868b (diff)
downloademacs-064766f2e8c5393c16fd2e95f81d3a6c3afd9014.tar.gz
emacs-064766f2e8c5393c16fd2e95f81d3a6c3afd9014.tar.bz2
emacs-064766f2e8c5393c16fd2e95f81d3a6c3afd9014.zip
(ftfont_otf_features): Fix previous change.
(ftfont_otf_capability): Check FeatureList.FeatureCount before calling ftfont_otf_features.
Diffstat (limited to 'src/ftfont.c')
-rw-r--r--src/ftfont.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index cc78e29ebbd..6d1033555d3 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1360,7 +1360,7 @@ ftfont_otf_features (gsub_gpos)
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 @@ ftfont_otf_capability (font)
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;
}