}
// If this font includes arabic script, we want to specify
// substitutions for initial, medial, terminal & isolated
// cases.
GsubTable gsub = (GsubTable) font.getTable(Table.GSUB);
SingleSubst initialSubst = null;
SingleSubst medialSubst = null;
SingleSubst terminalSubst = null;
if (gsub != null) {
Script s = gsub.getScriptList().findScript(SCRIPT_TAG_ARAB);
if (s != null) {
LangSys ls = s.getDefaultLangSys();
if (ls != null) {
Feature init = gsub.getFeatureList().findFeature(ls, FEATURE_TAG_INIT);
Feature medi = gsub.getFeatureList().findFeature(ls, FEATURE_TAG_MEDI);
Feature fina = gsub.getFeatureList().findFeature(ls, FEATURE_TAG_FINA);
initialSubst = (SingleSubst)
gsub.getLookupList().getLookup(init, 0).getSubtable(0);
medialSubst = (SingleSubst)
gsub.getLookupList().getLookup(medi, 0).getSubtable(0);
terminalSubst = (SingleSubst)
gsub.getLookupList().getLookup(fina, 0).getSubtable(0);
}
}
}
// Include the missing glyph