From: Ben Harris Date: Wed, 1 Jan 2025 23:18:13 +0000 (+0000) Subject: Emit AlternateSets for 'aalt' overrides X-Git-Tag: bedstead-3.251~50 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=3b65b970cb929e94dfc41862f0a0c386d0569b13;p=bedstead.git Emit AlternateSets for 'aalt' overrides These are just emitted after the standard AlternateSets, and because of how TTX works, they end up overriding the standard ones. This seems a bit dodgy to me, so I might try to do better later. --- diff --git a/bedstead.c b/bedstead.c index f351431..e2410d6 100644 --- a/bedstead.c +++ b/bedstead.c @@ -2764,7 +2764,8 @@ static void domosaic4(struct glyph *g); static void dopanose(void); static void docmap(int pid, int eid, int format); static void dogsub(void); -static void doaltsubs(void); +static void doaltsubs(int noverrides, + const struct alt_sub_override[noverrides]); static void dosinglesubs(char const *suffix); static void dogpos(void); static void glyph_complement(void); @@ -3639,7 +3640,8 @@ dogsub(void) TTXI("LookupType", 3); TTXI("LookupFlag", 0); printf(" \n"); - doaltsubs(); + doaltsubs(gsub_features[i].noverrides, + gsub_features[i].overrides); printf(" \n"); } printf(" \n"); @@ -3651,9 +3653,9 @@ dogsub(void) /* Find all the mappings from normal to alternative glyphs. */ static void -doaltsubs(void) +doaltsubs(int noverrides, const struct alt_sub_override overrides[noverrides]) { - int i; + int i, j; for (i = 1; i < nglyphs; i++) { #define HASDOT(x) (strchr(glyphs_by_name[x]->name, '.') != NULL) @@ -3673,6 +3675,15 @@ doaltsubs(void) printf("\n"); } } + + for (i = 0; i < noverrides; i++) { + printf(" ", overrides[i].base); + for (j = 0; j < MAX_ALT_SUB_OVERRIDE && + overrides[i].alt[j] != NULL; j++) + printf("", + overrides[i].alt[j]); + printf("\n"); + } } /* Find all mappings for a single feature. */