From: Ben Harris Date: Tue, 26 Nov 2024 14:34:15 +0000 (+0000) Subject: Add a flag to explicitly mark compatibility aliases X-Git-Tag: bedstead-3.251~89 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=0cb087c5266ce034375f7d3ffe5d1ea836ce2820;p=bedstead.git Add a flag to explicitly mark compatibility aliases Only used on a few characters for now, though. --- diff --git a/bedstead.c b/bedstead.c index 38e5ef4..c1eb877 100644 --- a/bedstead.c +++ b/bedstead.c @@ -221,8 +221,9 @@ static struct glyph { #define JOIN_L 0x08 /* Copy left column leftward to join to next character. */ #define JOIN_U 0x10 /* Copy top row upwards ditto. */ #define JOIN (JOIN_L | JOIN_U) -#define IS_ALIAS 0x20 -#define IS_SUBR 0x40 +#define IS_ALIAS 0x20 /* Set iff .alias_of is valid (and .data is not). */ +#define IS_SUBR 0x40 /* Set iff .subr_idx is valid.(and .data is not). */ +#define COMPAT 0x80 /* Mark as a compatibility alias in complement PDF. */ uint_least16_t left_sidebearing; /* Set when outline generated. */ } glyphs[] = { /* @@ -2625,7 +2626,7 @@ static struct glyph { /* Compatibility aliases for 4-cell separated graphics. */ #define M(x, n) \ - { .alias_of = "u1CC2" #x, 0xf1e ## x, n ".sep4", IS_ALIAS } + { .alias_of = "u1CC2" #x, 0xf1e ## x, n ".sep4", IS_ALIAS | COMPAT } /* */ M(1, "uni2598"), M(2, "uni259D"), M(3, "upblock"), M(4, "uni2596"), M(5, "lfblock"), M(6, "uni259E"), M(7, "uni259B"), M(8, "uni2597"), M(9, "uni259A"), M(A, "rtblock"), M(B, "uni259C"), @@ -4529,8 +4530,10 @@ glyph_complement() printf("()"); printf("/%s ", g->name); printf("exemplify "); - if (g->flags & IS_ALIAS) { - struct glyph *target = get_glyph_by_name(g->alias_of); + if (g->flags & COMPAT) { + struct glyph const *target = g; + while (target->flags & COMPAT) + target = get_glyph_by_name(target->alias_of); if (target->unicode != -1) printf("(USE U+%04lX) sash ", target->unicode); else