OTF_Tag script_tag = OTF_tag (script);
OTF_Tag langsys_tag = OTF_tag (language);
int i, j;
+ OTF_Tag dflt_tag = OTF_tag ("DFLT");
+ OTF_Script *dflt = NULL;
for (i = 0; i < script_list->ScriptCount; i++)
- if (! script_tag
- || script_list->Script[i].ScriptTag == script_tag)
- {
- OTF_Script *script = script_list->Script + i;
-
- if (! langsys_tag)
- return &script->DefaultLangSys;
- for (j = 0; j < script->LangSysCount; j++)
- if (script->LangSysRecord[j].LangSysTag == langsys_tag)
- return script->LangSys + j;
- return &script->DefaultLangSys;
- }
+ {
+ OTF_Script *script = script_list->Script + i;
+
+ if (script_list->Script[i].ScriptTag == dflt_tag)
+ dflt = script;
+ if (script_list->Script[i].ScriptTag == script_tag)
+ {
+ if (! langsys_tag)
+ return &script->DefaultLangSys;
+ for (j = 0; j < script->LangSysCount; j++)
+ if (script->LangSysRecord[j].LangSysTag == langsys_tag)
+ return script->LangSys + j;
+ return &script->DefaultLangSys;
+ }
+ }
- return NULL;
+ if (! dflt)
+ dflt = script_list->Script;
+ if (! langsys_tag)
+ return &dflt->DefaultLangSys;
+ for (j = 0; j < dflt->LangSysCount; j++)
+ if (dflt->LangSysRecord[j].LangSysTag == langsys_tag)
+ return dflt->LangSys + j;
+ return &dflt->DefaultLangSys;
}
static int
int *lookup_indices;
int i, n;
+ for (i = 0; i < gstring->used; i++)
+ gstring->glyphs[i].f.index.from = gstring->glyphs[i].f.index.to = i;
+
if (! otf->gsub
&& OTF_get_table (otf, "GSUB") < 0)
return errret;
if (n < 0)
return errret;
- for (i = 0; i < gstring->used; i++)
- gstring->glyphs[i].f.index.from = gstring->glyphs[i].f.index.to = i;
-
for (i = 0; i < n; i++)
{
int index = lookup_indices[i];