chiark / gitweb /
Add a flag to explicitly mark compatibility aliases
authorBen Harris <bjh21@bjh21.me.uk>
Tue, 26 Nov 2024 14:34:15 +0000 (14:34 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 26 Nov 2024 14:34:15 +0000 (14:34 +0000)
Only used on a few characters for now, though.

bedstead.c

index 38e5ef47da9955824f6e717d5367529b2693a439..c1eb877306986236a64ad65ceb5954008a48d804 100644 (file)
@@ -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