From: handa Date: Tue, 10 Dec 2002 00:35:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: REL-0-9-1~118 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d2d08fb28376772848e47529685fd997822bb8;p=m17n%2Flibotf.git *** empty log message *** --- diff --git a/src/otfdrive.c b/src/otfdrive.c index a075184..3f6d328 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -492,22 +492,62 @@ otf_drive_gdef (OTF *otf, OTF_GlyphString *gstring) int -otf_drive_gsub (OTF *otf, OTF_Tag script_tag, OTF_Tag langsys_tag, +otf_drive_gsub (OTF *otf, char *script, char *language, char *features, OTF_GlyphString *gstring) { OTF_GSUB *gsub; - OTF_LangSys *langsys; + OTF_LangSys *LangSys; int i, j; + OTF_Tag script_tag, layngsys_tag; if (! otf->gsub && otf_get_table (otf, "GSUB") < 0) return -1; gsub = otf->gsub; + script_tag = otf_tag (script); + langsys_tag = otf_tag (language); langsys = get_langsys (&gsub->ScriptList, script_tag, langsys_tag); if (! langsys) return -1; + if (features) + { + int len = strlen (features); + char name[5]; + int i = 0; + OTF_Tag tag; + + while (*features) + { + if (i == 4 || *features == ':') + { + name[i] = '\0'; + tag = otf_tag (name); + if (tag) + { + feature_tags[nfeatures++] = tag; + if (nfeatures == langsys->FeatureCount) + break; + } + i = 0; + if (*features == ':') + features++; + } + else + name[i++] = *features++; + } + if (i > 0 + && (tag = otf_tag (name))) + feature_tags[nfeatures++] = tag; + } + else + { + for (i = 0; i < langsys->FeatureCount; i++) + feature_tags[nfeatures++] = + + + for (i = 0; i < langsys->FeatureCount; i++) { OTF_Feature *feature