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