From 87d2d08fb28376772848e47529685fd997822bb8 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 10 Dec 2002 00:35:37 +0000 Subject: [PATCH] *** empty log message *** --- src/otfdrive.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) 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 -- 1.7.10.4