chiark / gitweb /
Make the 'smcp' lookup work like the stylistic sets
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 28 Mar 2020 10:05:35 +0000 (10:05 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 28 Mar 2020 10:05:35 +0000 (10:05 +0000)
The SC flag is no longer applied to lower-case letters.  Instead,
dolookups() automatically searches for suitably-names glyphs.

bedstead.c

index e94cc001ed41a230c8c5794efe9a676f9245d720..1df776f5f36480c1e99a7af76d2be40ca6fd19f9 100644 (file)
@@ -300,32 +300,32 @@ static struct glyph {
  {{004,012,021,000,000,000,000,000,000}, 0x005e, "asciicircum" },
  {{000,000,000,000,000,000,037,000,000}, 0x005f, "underscore" },
  {{004,004,002,000,000,000,000,000,000}, 0x201b, "quotereversed" },
- {{000,000,016,001,017,021,017,000,000}, 0x0061, "a", SC },
- {{020,020,036,021,021,021,036,000,000}, 0x0062, "b", SC },
- {{000,000,017,020,020,020,017,000,000}, 0x0063, "c", SC },
- {{001,001,017,021,021,021,017,000,000}, 0x0064, "d", SC },
- {{000,000,016,021,037,020,016,000,000}, 0x0065, "e", SC },
- {{002,004,004,016,004,004,004,000,000}, 0x0066, "f", SC },
- {{000,000,017,021,021,021,017,001,016}, 0x0067, "g", SC },
- {{020,020,036,021,021,021,021,000,000}, 0x0068, "h", SC },
- {{004,000,014,004,004,004,016,000,000}, 0x0069, "i", SC },
- {{004,000,004,004,004,004,004,004,010}, 0x006a, "j", SC },
- {{010,010,011,012,014,012,011,000,000}, 0x006b, "k", SC },
- {{014,004,004,004,004,004,016,000,000}, 0x006c, "l", SC },
- {{000,000,032,025,025,025,025,000,000}, 0x006d, "m", SC },
- {{000,000,036,021,021,021,021,000,000}, 0x006e, "n", SC },
- {{000,000,016,021,021,021,016,000,000}, 0x006f, "o", SC },
- {{000,000,036,021,021,021,036,020,020}, 0x0070, "p", SC },
- {{000,000,017,021,021,021,017,001,001}, 0x0071, "q", SC },
- {{000,000,013,014,010,010,010,000,000}, 0x0072, "r", SC },
- {{000,000,017,020,016,001,036,000,000}, 0x0073, "s", SC },
- {{004,004,016,004,004,004,002,000,000}, 0x0074, "t", SC },
- {{000,000,021,021,021,021,017,000,000}, 0x0075, "u", SC },
- {{000,000,021,021,012,012,004,000,000}, 0x0076, "v", SC },
- {{000,000,021,021,025,025,012,000,000}, 0x0077, "w", SC },
- {{000,000,021,012,004,012,021,000,000}, 0x0078, "x", SC },
- {{000,000,021,021,021,021,017,001,016}, 0x0079, "y", SC },
- {{000,000,037,002,004,010,037,000,000}, 0x007a, "z", SC },
+ {{000,000,016,001,017,021,017,000,000}, 0x0061, "a" },
+ {{020,020,036,021,021,021,036,000,000}, 0x0062, "b" },
+ {{000,000,017,020,020,020,017,000,000}, 0x0063, "c" },
+ {{001,001,017,021,021,021,017,000,000}, 0x0064, "d" },
+ {{000,000,016,021,037,020,016,000,000}, 0x0065, "e" },
+ {{002,004,004,016,004,004,004,000,000}, 0x0066, "f" },
+ {{000,000,017,021,021,021,017,001,016}, 0x0067, "g" },
+ {{020,020,036,021,021,021,021,000,000}, 0x0068, "h" },
+ {{004,000,014,004,004,004,016,000,000}, 0x0069, "i" },
+ {{004,000,004,004,004,004,004,004,010}, 0x006a, "j" },
+ {{010,010,011,012,014,012,011,000,000}, 0x006b, "k" },
+ {{014,004,004,004,004,004,016,000,000}, 0x006c, "l" },
+ {{000,000,032,025,025,025,025,000,000}, 0x006d, "m" },
+ {{000,000,036,021,021,021,021,000,000}, 0x006e, "n" },
+ {{000,000,016,021,021,021,016,000,000}, 0x006f, "o" },
+ {{000,000,036,021,021,021,036,020,020}, 0x0070, "p" },
+ {{000,000,017,021,021,021,017,001,001}, 0x0071, "q" },
+ {{000,000,013,014,010,010,010,000,000}, 0x0072, "r" },
+ {{000,000,017,020,016,001,036,000,000}, 0x0073, "s" },
+ {{004,004,016,004,004,004,002,000,000}, 0x0074, "t" },
+ {{000,000,021,021,021,021,017,000,000}, 0x0075, "u" },
+ {{000,000,021,021,012,012,004,000,000}, 0x0076, "v" },
+ {{000,000,021,021,025,025,012,000,000}, 0x0077, "w" },
+ {{000,000,021,012,004,012,021,000,000}, 0x0078, "x" },
+ {{000,000,021,021,021,021,017,001,016}, 0x0079, "y" },
+ {{000,000,037,002,004,010,037,000,000}, 0x007a, "z" },
  {{003,004,004,010,004,004,003,000,000}, 0x007b, "braceleft" },
  {{004,004,004,000,004,004,004,000,000}, 0x00a6, "brokenbar" },
  {{030,004,004,002,004,004,030,000,000}, 0x007d, "braceright" },
@@ -358,7 +358,7 @@ static struct glyph {
  {{012,000,016,001,017,021,017,000,000}, 0x00e4, "adieresis" },
  {{000,012,000,016,021,021,016,000,000}, 0x00f6, "odieresis" },
  {{000,012,000,021,021,021,017,000,000}, 0x00fc, "udieresis" },
- {{014,022,022,026,021,021,026,020,020}, 0x00df, "germandbls", SC },
+ {{014,022,022,026,021,021,026,020,020}, 0x00df, "germandbls" },
 
  /* Extra characters found in the Swedish (SAA5052) character set */
  {{000,000,021,016,012,016,021,000,000}, 0x00a4, "currency" },
@@ -1859,7 +1859,8 @@ main(int argc, char **argv)
            "['aalt' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
        printf("Lookup: 257 0 0 \"palt: proportional metrics\" {\"palt\"} "
            "['palt' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
-       printf("Lookup: 1 0 0 \"smcp: lower-case to small caps\" {\"smcp\"} "
+       printf("Lookup: 1 0 0 \"smcp: lower-case to small caps\" "
+            "{\"smcp\" (\"sc\")} "
            "['smcp' ('latn' <'dflt'>)]\n");
        printf("Lookup: 1 0 0 \"c2sc: upper-case to small caps\" {\"c2sc\"} "
            "['c2sc' ('latn' <'dflt'>)]\n");
@@ -2069,13 +2070,15 @@ dolookups(struct glyph const *g)
                        if (strcmp(glyphs[i].name + plen, "saa5054") == 0)
                                printf("Substitution2: \"ss04\" %s\n",
                                       glyphs[i].name);
+                       if (strcmp(glyphs[i].name + plen, "sc") == 0)
+                               printf("Substitution2: \"smcp\" %s\n",
+                                      glyphs[i].name);
                        printf("AlternateSubs2: \"aalt\" %s\n",
                               glyphs[i].name);
                }
        }
        if ((g->flags & SC))
-               printf("Substitution2: \"%s\" %c%ssc\n",
-                   isupper((unsigned char)prefix[0]) ? "c2sc" : "smcp",
+               printf("Substitution2: \"%s\" %c%ssc\n", "c2sc",
                    tolower((unsigned char)prefix[0]), prefix + 1);
        dopalt(g);
 }