{ "ugrave", { "ugrave.roundjoined", "ugrave.sc" } },
};
-#define MAXSUBS 10
static struct gsub_feature {
char const *tag;
#define SCRIPT_DFLT 0x01
#define SCRIPT_ALL 0x03
unsigned int scripts;
char const *suffix; /* NULL for all alternative glyphs. */
- char const *subs[MAXSUBS]; /* Individual character substitutions. */
+ char const *xml; /* Individual character substitutions. */
char const *name;
struct alt_sub_override const *overrides;
int noverrides;
{ "smcp", SCRIPT_LATN, .suffix = ".sc" },
{ "c2sc", SCRIPT_LATN, .suffix = ".c2sc" },
{ "rtlm", SCRIPT_ALL, .suffix = ".rtlm" },
+#define SINGLESUB(in, out) "<Substitution in='" in "' out='" out "'/>\n"
+#define SUFFIXSUB(base, suffix) SINGLESUB(base, base suffix)
{ "ss01", SCRIPT_ALL, .name = "SAA5051",
- .subs = { "comma.left", "period.large", "colon.leftsmall",
- "semicolon.left", "question.open",
- "D.serif", "J.narrow", "L.narrow",
- "j.serif", "t.small" } },
+ .xml = "<SingleSubst>\n" SUFFIXSUB("comma", ".left")
+ SUFFIXSUB("period", ".large") SUFFIXSUB("colon", ".leftsmall")
+ SUFFIXSUB("semicolon", ".left") SUFFIXSUB("question", ".open")
+ SUFFIXSUB("D", ".serif") SUFFIXSUB("J", ".narrow")
+ SUFFIXSUB("L", ".narrow") SUFFIXSUB("j", ".serif")
+ SUFFIXSUB("t", ".small") "</SingleSubst>\n" },
{ "ss02", SCRIPT_ALL, .name = "SAA5052",
- .subs = { "comma.left", "period.large", "colon.leftsmall",
- "semicolon.left", "question.open",
- "D.narrow", "J.narrow", "L.narrow",
- "j.serif", "t.small" } },
+ .xml = "<SingleSubst>\n" SUFFIXSUB("comma", ".left")
+ SUFFIXSUB("period", ".large") SUFFIXSUB("colon", ".leftsmall")
+ SUFFIXSUB("semicolon", ".left") SUFFIXSUB("question", ".open")
+ SUFFIXSUB("D", ".narrow") SUFFIXSUB("J", ".narrow")
+ SUFFIXSUB("L", ".narrow") SUFFIXSUB("j", ".serif")
+ SUFFIXSUB("t", ".small") "</SingleSubst>\n" },
{ "ss04", SCRIPT_ALL, .name = "SAA5054",
- .subs = { "ugrave.roundjoined", "ocircumflex.large",
- "ccedilla.angular" } },
+ .xml = "<SingleSubst>\n" SUFFIXSUB("ugrave", ".roundjoined")
+ SUFFIXSUB("ocircumflex", ".large") SUFFIXSUB("ccedilla", ".angular")
+ "</SingleSubst>\n" },
{ "ss14", SCRIPT_ALL, ".sep4", .name = "4-cell separated graphics" },
{ "ss16", SCRIPT_ALL, ".sep6", .name = "6-cell separated graphics" },
};
printf(" <SingleSubst>\n");
dosinglesubs(gsub_features[i].suffix);
printf(" </SingleSubst>\n");
- } else if (gsub_features[i].subs[0] != NULL) {
- /* Stylistic set of pick and mix glyphs. */
+ } else if (gsub_features[i].xml != NULL) {
+ /* Raw XML for a substitution. */
TTXI("LookupType", 1);
TTXI("LookupFlag", 0);
- printf(" <SingleSubst>\n");
- for (int j = 0; j < MAXSUBS; j++) {
- char const *sub = gsub_features[i].subs[j];
- if (sub == NULL) break;
- char *dot = strchr(sub, '.');
- assert(dot != NULL);
- printf(" "
- "<Substitution in='%.*s' out='%s'/>\n",
- (int)(dot - sub), sub, sub);
- }
- printf(" </SingleSubst>\n");
+ printf("%s", gsub_features[i].xml);
} else {
/* All possible alternative glyphs. */
TTXI("LookupType", 3);