chiark / gitweb /
Tolerable rendering of variation sequences in glyph complement
authorBen Harris <bjh21@bjh21.me.uk>
Thu, 20 Nov 2025 23:22:48 +0000 (23:22 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:55:10 +0000 (21:55 +0000)
I think I probably want a nice way to write "<= 0x10ffff" though.

bedstead.c

index f535969171ebb613040f0be94a85675d065e1a46..684894de1e7d15de5ada7379b815e7724bc36898 100644 (file)
@@ -5263,19 +5263,23 @@ glyph_complement()
                        col = 0;
                        newcol = true;
                }
-               if (newcol && g->unicode != NU) {
+               if (newcol && g->unicode != NU && !(g->unicode & U_HASVS)) {
                        printf("gsave %d 0 translate (%03lX) colnum grestore\n",
                               col * 40, unicol);
                        newcol = false;
                }
                printf("gsave %d %d translate ",
                       (col * 40),
-                      (int)-((g->unicode == NU ?
+                      (int)-((g->unicode == NU || (g->unicode & U_HASVS) ?
                               row++ : (int)(g->unicode % nrow)) * 40));
-               if (g->unicode != NU)
-                       printf("(U+%04lX)", (unsigned long)g->unicode);
-               else
+               if (g->unicode == NU)
                        printf("()");
+               else if (g->unicode & U_HASVS)
+                       printf("(<U+%04lX,U+%04lX>)",
+                              (unsigned long)GET_UV(g->unicode),
+                              (unsigned long)GET_UVS(g->unicode));
+               else
+                       printf("(U+%04lX)", (unsigned long)g->unicode);
                printf("/%s ", g->name);
                printf("exemplify ");
                if (g->flags & COMPAT) {