mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-10 14:03:06 -04:00
Don't emit AlternateSets that will be overridden
Just in case TTX changes its behaviour in this area in the future.
This commit is contained in:
parent
ad5c574321
commit
1be864fb48
13
bedstead.c
13
bedstead.c
@ -3668,7 +3668,7 @@ dogsub(void)
|
||||
static void
|
||||
doaltsubs(int noverrides, const struct alt_sub_override overrides[noverrides])
|
||||
{
|
||||
int i, j;
|
||||
int i, j, next_override = 0;
|
||||
|
||||
for (i = 1; i < nglyphs; i++) {
|
||||
#define HASDOT(x) (strchr(glyphs_by_name[x]->name, '.') != NULL)
|
||||
@ -3680,15 +3680,22 @@ doaltsubs(int noverrides, const struct alt_sub_override overrides[noverrides])
|
||||
* name comes immediately after the unqualified one.
|
||||
*/
|
||||
if (HASDOT(i)) {
|
||||
printf(" <AlternateSet glyph='%s'>",
|
||||
bool overridden = next_override < noverrides &&
|
||||
strcmp(glyphs_by_name[i-1]->name,
|
||||
overrides[next_override].base) == 0;
|
||||
printf(" %s<AlternateSet glyph='%s'>",
|
||||
overridden ? "<!-- " : "",
|
||||
glyphs_by_name[i-1]->name);
|
||||
for (; i < nglyphs && HASDOT(i); i++)
|
||||
printf("<Alternate glyph='%s'/>",
|
||||
glyphs_by_name[i]->name);
|
||||
printf("</AlternateSet>\n");
|
||||
printf("</AlternateSet>%s\n",
|
||||
overridden ? " -->" : "");
|
||||
next_override += overridden;
|
||||
}
|
||||
}
|
||||
|
||||
printf(" <!-- overrides -->\n");
|
||||
for (i = 0; i < noverrides; i++) {
|
||||
printf(" <AlternateSet glyph='%s'>", overrides[i].base);
|
||||
for (j = 0; j < MAX_ALT_SUB_OVERRIDE &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user