chiark / gitweb /
Implement separated graphics as feature 'ss16'
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 28 Mar 2020 21:03:37 +0000 (21:03 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 28 Mar 2020 21:03:37 +0000 (21:03 +0000)
While Unicode 13 added code points for 6-cell mosaic graphics, it
didn't specify any way to select separated vs contiguous graphics.
This differs fron ZVBI, which used differect code points for separated
and contiguous glyphs.  This means that separated graphics must be a
matter of style, which is consistent with the way that they're
selected by a control character in Teletext.

In OpenType, implement this as a stylistic set, 'ss16', that replaces
the contiguous glyphs with their separated counterparts.  I'm
reserving 'ss14' for the 4-cell equivalent.

bedstead.c

index 82a839e968e86925415c84274ba55b89d11655b3..78c525f4552566abc8217f23701673ebaaac14e1 100644 (file)
@@ -1435,8 +1435,9 @@ static struct glyph {
 
  /* Block elements */
  {{ 3}, 0x2580, "upblock", MOS4 }, {{12}, 0x2584, "dnblock", MOS4 },
- {{15}, 0x2588, "block",   MOS4 },
- {{ 5}, 0x258c, "lfblock", MOS4 }, {{10}, 0x2590, "rtblock", MOS4 },
+ {{15}, 0x2588, "block",   MOS4 }, {{0x7f}, -1, "block.sep6", MOS },
+ {{ 5}, 0x258c, "lfblock", MOS4 }, {{0x35}, -1, "lfblock.sep6", MOS },
+ {{10}, 0x2590, "rtblock", MOS4 }, {{0x6a}, -1, "rtblock.sep6", MOS },
  {{025,000,012,000,025,000,012,000,025}, 0x2591, "ltshade" },
  {{022,011,004,022,011,004,022,011,004}, 0x2592, "shade" },
  {{025,037,012,037,025,037,012,037,025}, 0x2593, "dkshade" },
@@ -1628,7 +1629,7 @@ static struct glyph {
  {{000,007,017,027,037,011,000,000,000}, U(1F69A) }, /* deliverytruck */
 
  /* Graphics for legacy computing */
-#define M(x, u) { {(x)}, U(u), MOS }
+#define M(x, u) { {(x)}, U(u), MOS }, { {(x)|0x20}, -1, "uni" #u ".sep6", MOS }
  /* space */     M(0x01, 1FB00), M(0x02, 1FB01), M(0x03, 1FB02),
  M(0x04, 1FB03), M(0x05, 1FB04), M(0x06, 1FB05), M(0x07, 1FB06),
  M(0x08, 1FB07), M(0x09, 1FB08), M(0x0a, 1FB09), M(0x0b, 1FB0A),
@@ -1914,6 +1915,10 @@ main(int argc, char **argv)
        printf("Lookup: 1 0 0 \"ss04: SAA5054 forms\" {\"ss04\" (\"saa5054\")} "
            "['ss04' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
        printf("OtfFeatName: 'ss04' 1033 \"SAA5054\"\n");
+       printf("Lookup: 1 0 0 \"ss16: 6-cell separated graphics\" "
+              "{\"ss16\" (\"sep6\")} "
+           "['ss16' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
+       printf("OtfFeatName: 'ss14' 1033 \"4-cell separated graphics\"\n");
        printf("Lookup: 3 0 0 \"aalt: all alternates\" {\"aalt\"} "
            "['aalt' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
        printf("Lookup: 257 0 0 \"palt: proportional metrics\" {\"palt\"} "
@@ -2134,6 +2139,9 @@ dolookups(struct glyph const *g)
                        if (strcmp((*found)->name + plen, "saa5054") == 0)
                                printf("Substitution2: \"ss04\" %s\n",
                                       (*found)->name);
+                       if (strcmp((*found)->name + plen, "sep6") == 0)
+                               printf("Substitution2: \"ss16\" %s\n",
+                                      (*found)->name);
                        if (strcmp((*found)->name + plen, "sc") == 0)
                                printf("Substitution2: \"smcp\" %s\n",
                                       (*found)->name);