chiark / gitweb /
Add 'rtlm' (right-to-left mirrored) lookup
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 2 Jun 2024 12:39:43 +0000 (13:39 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 2 Jun 2024 13:21:57 +0000 (14:21 +0100)
This implements the Bidi_Mirrored Unicode property for those characters
that don't have a Bidi_Mirroring_Glyph.  These are the characters listed
at the end of BidiMirroring-15.1.0.txt.  I haven't yet assigned them PUA
code-points.  The characters with a Bidi_Mirroring_Glyph that don't
appear in the OpenType Mirroring Pairs List (OMPL) still need aliases
added.

bedstead.c

index 099c520f3606824c84e1a82d3d2734f6afaa9273..e301987c319112d8936c86e2d16267f4ed9d5516 100644 (file)
@@ -1345,7 +1345,9 @@ static struct glyph {
  /* Mathematical operators */
  {{021,021,037,021,012,012,004,000,000}, 0x2200, "universal" },
  {{016,021,001,017,021,021,016,000,000}, 0x2202, "partialdiff" },
+ {{016,021,020,036,021,021,016,000,000}, -1, "partialdiff.rtlm" },
  {{037,001,001,017,001,001,037,000,000}, 0x2203, "existential" },
+ {{037,020,020,036,020,020,037,000,000}, -1, "existential.rtlm" },
  {{000,015,022,025,011,026,000,000,000}, 0x2205, "emptyset" },
  {{004,004,012,012,021,021,037,000,000}, 0x2206, "Delta" },
  {{037,021,021,012,012,004,004,000,000}, 0x2207, "gradient" },
@@ -1356,18 +1358,24 @@ static struct glyph {
  {{037,021,021,021,021,021,021,021,021}, 0x220f, "product" },
  {{021,021,021,021,021,021,021,021,037}, U(2210) }, /* n-ary coproduct */
  {{037,020,010,004,002,004,010,020,037}, 0x2211, "summation" },
+ {{037,001,002,004,010,004,002,001,037}, -1, "summation.rtlm" },
  {{000,000,000,037,000,000,000,000,000}, 0x2212, "minus" },
  {{037,000,004,004,037,004,004,000,000}, U(2213) }, /* minusplus */
  {{004,000,004,004,037,004,004,000,000}, U(2214) }, /* dot plus */
  {{000,001,002,004,010,020,000,000,000}, U(2215) }, /* division slash */
  {{000,020,010,004,002,001,000,000,000}, U(2216) }, /* set minus */
+ ALIAS("uni2216.rtlm", "uni2215"),
  {{004,025,016,004,016,025,004,000,000}, 0x2217, "asteriskmath" },
  {{000,000,004,012,012,004,000,000,000}, U(2218) }, /* ring operator */
  {{000,000,004,016,004,000,000,000,000}, U(2219) }, /* bulletoperator */
  {{007,004,004,004,024,014,004,000,000}, 0x221a, "radical" },
+ {{034,004,004,004,005,006,004,000,000}, -1, "radical.rtlm" },
  {{023,012,022,012,022,006,002,000,000}, U(221B) }, /* cube root */
+ {{022,021,022,021,022,030,020,000,000}, -1, "uni221B.rtlm" },
  {{015,025,035,005,001,003,001,000,000}, U(221C) }, /* fourth root */
+ {{023,025,027,021,020,030,020,000,000}, -1, "uni221C.rtlm" },
  {{000,012,025,024,025,012,000,000,000}, 0x221d, "proportional" },
+ {{000,012,025,005,025,012,000,000,000}, -1, "proportional.rtlm" },
  {{000,012,025,025,025,012,000,000,000}, 0x221e, "infinity" },
  {{000,020,020,020,020,037,000,000,000}, 0x221f, "orthogonal" },
  {{004,004,004,004,004,004,004,000,000}, U(2223) }, /* divides */
@@ -1377,7 +1385,9 @@ static struct glyph {
  {{000,016,021,021,021,021,000,000,000}, 0x2229, "intersection" },
  {{000,021,021,021,021,016,000,000,000}, 0x222a, "union" },
  {{002,005,004,004,004,004,004,024,010}, 0x222b, "integral" },
+ {{010,024,004,004,004,004,004,005,002}, -1, "integral.rtlm" },
  {{002,005,004,016,025,016,004,024,010}, U(222E) }, /* contour integral */
+ {{010,024,004,016,025,016,004,005,002}, -1, "uni222E.rtlm" },
  {{000,004,000,000,000,021,000,000,000}, 0x2234, "therefore" },
  {{000,021,000,000,000,004,000,000,000}, U(2235) }, /* because */
  {{000,004,000,000,000,004,000,000,000}, U(2236) }, /* ratio */
@@ -1386,11 +1396,15 @@ static struct glyph {
  {{000,000,010,025,002,000,000,000,000}, 0x223c, "similar" },
  {{000,000,002,025,010,000,000,000,000}, U(223D) }, /* reversed tilde */
  {{000,002,011,025,022,010,000,000,000}, U(223E) }, /* inverted lazy S */
+ {{000,010,022,025,011,002,000,000,000}, -1, "uni223E.rtlm" },
  {{000,010,024,025,005,002,000,000,000}, U(223F) }, /* sinewave */
+ {{000,002,005,025,024,010,000,000,000}, -1, "uni223F.rtlm" },
  {{000,037,000,010,025,002,000,000,000}, U(2242) }, /* minus tilde */
+ {{000,037,000,002,025,010,000,000,000}, -1, "uni2242.rtlm" },
  {{000,010,025,002,000,037,000,000,000}, U(2243) }, /* asymptotically equal */
  {{010,025,002,000,037,000,037,000,000}, 0x2245, "congruent" },
  {{000,010,025,002,010,025,002,000,000}, 0x2248, "approxequal" },
+ {{000,002,025,010,002,025,010,000,000}, -1, "approxequal.rtlm" },
  {{002,025,010,000,037,000,037,000,000}, U(224C) }, /* all equal to */
  {{000,021,016,000,016,021,000,000,000}, U(224D) }, /* equivalent to */
  {{000,004,033,000,033,004,000,000,000}, U(224E) }, /* geom equiv to */
@@ -1402,8 +1416,10 @@ static struct glyph {
  {{016,021,000,037,000,037,000,000,000}, U(2258) }, /* corresponds to */
  {{032,025,025,000,037,000,037,000,000}, U(225E) }, /* measured by */
  {{000,002,037,004,037,010,000,000,000}, 0x2260, "notequal" },
+ {{000,010,037,004,037,002,000,000,000}, -1, "notequal.rtlm" },
  {{000,037,000,037,000,037,000,000,000}, 0x2261, "equivalence" },
  {{002,037,004,037,004,037,010,000,000}, U(2262) }, /* not identical */
+ {{010,037,004,037,004,037,002,000,000}, -1, "uni2262.rtlm" },
  {{003,014,020,014,003,030,007,000,000}, 0x2264, "lessequal" },
  {{030,006,001,006,030,003,034,000,000}, 0x2265, "greaterequal" },
  {{012,004,012,012,012,004,012,000,000}, U(226C) }, /* between */
@@ -1433,6 +1449,7 @@ static struct glyph {
  {{000,004,004,004,004,037,000,000,000}, 0x22a5, "perpendicular" },
  {{000,010,010,016,010,010,000,000,000}, U(22A6) }, /* assertion */
  {{000,010,016,010,016,010,000,000,000}, U(22A7) }, /* models */
+ {{000,002,016,002,016,002,000,000,000}, -1, "uni22A7.rtlm" },
  {{000,020,037,020,037,020,000,000,000}, U(22A8) }, /* true */
  {{000,024,024,027,024,024,000,000,000}, U(22A9) }, /* forces */
  {{000,024,027,024,027,024,000,000,000}, U(22AB) }, /* dbl v dbl rt tstile */
@@ -1460,6 +1477,7 @@ static struct glyph {
  {{000,020,000,004,000,001,000,000,000}, U(22F1) }, /* \-diagonal ellipsis */
  {{037,000,017,020,037,020,017,000,000}, U(22F7) }, /* small element overbar */
  {{017,020,020,037,020,020,017,000,037}, U(22F8) }, /* element of underbar */
+ {{036,001,001,037,001,001,036,000,037}, -1, "uni22F8.rtlm" },
  {{037,000,036,001,037,001,036,000,000}, U(22FE) }, /* small contains o'bar */
 
  /* Miscellaneous technical */
@@ -1474,7 +1492,9 @@ static struct glyph {
  {{000,000,020,020,020,020,037,000,000}, U(231E) }, /* bottom left corner */
  {{000,000,001,001,001,001,037,000,000}, U(231F) }, /* bottom right corner */
  {{000,000,002,005,004,004,004,004,004}, 0x2320, "integraltp" },
+ {{000,000,010,024,004,004,004,004,004}, -1, "integraltp.rtlm" },
  {{004,004,004,004,004,024,010,000,000}, 0x2321, "integralbt" },
+ {{004,004,004,004,004,005,002,000,000}, -1, "integralbt.rtlm" },
  {{002,002,004,010,004,002,002,000,000}, 0x2329, "angleleft" },
  {{010,010,004,002,004,010,010,000,000}, 0x232a, "angleright" },
  {{000,037,004,004,004,037,000,000,000}, U(2336) }, /* APL I-beam */
@@ -1886,10 +1906,15 @@ static struct glyph {
  {{021,021,021,021,025,021,021,021,016}, U(2A03) }, /* n-ary union dot */
  {{021,021,025,025,037,025,025,021,016}, U(2A04) }, /* n-ary union plus */
  {{002,005,004,004,037,004,004,024,010}, U(2A0D) }, /* integral with bar */
+ {{010,024,004,004,037,004,004,005,002}, -1, "uni2A0D.rtlm" },
  {{002,005,004,037,004,037,004,024,010}, U(2A0E) }, /* integral w/dbl bar */
+ {{010,024,004,037,004,037,004,005,002}, -1, "uni2A0E.rtlm" },
  {{002,005,004,037,025,037,004,024,010}, U(2A16) }, /* integral w/square */
+ {{010,024,004,037,025,037,004,005,002}, -1, "uni2A16.rtlm" },
  {{002,005,004,016,025,025,004,024,010}, U(2A19) }, /* integral w/cap */
+ {{010,024,004,016,025,025,004,005,002}, -1, "uni2A19.rtlm" },
  {{002,005,004,025,025,016,004,024,010}, U(2A1A) }, /* integral w/cup */
+ {{010,024,004,025,025,016,004,005,002}, -1, "uni2A1A.rtlm" },
  {{004,004,037,004,004,000,004,000,000}, U(2A25) }, /* plus dot */
  {{000,000,000,037,000,004,000,000,000}, U(2A2A) }, /* minus dot */
  {{000,020,000,037,000,001,000,000,000}, U(2A2B) }, /* minus falling dots */
@@ -1906,8 +1931,11 @@ static struct glyph {
  {{000,000,037,000,037,000,004,000,000}, U(2A66) }, /* equals dot */
  {{004,000,037,000,037,000,037,000,000}, U(2A67) }, /* dot identical */
  {{004,000,010,025,002,000,000,000,000}, U(2A6A) }, /* dot tilde */
+ {{004,000,002,025,010,000,000,000,000}, -1, "uni2A6A.rtlm" },
  {{000,001,010,025,002,020,000,000,000}, U(2A6B) }, /* tilde rising dots */
+ {{000,020,002,025,010,001,000,000,000}, -1, "uni2A6B.rtlm" },
  {{037,000,037,000,010,025,002,000,000}, U(2A73) }, /* equals tilde */
+ {{037,000,037,000,002,025,010,000,000}, -1, "uni2A73.rtlm" },
  {{012,000,037,000,037,000,012,000,000}, U(2A77) }, /* equals with four dots */
  {{004,033,000,037,000,037,000,000,000}, U(2AAE) }, /* bumpy equals */
  {{000,017,020,024,020,017,000,000,000}, U(2ABD) }, /* subset with dot */
@@ -1937,10 +1965,12 @@ static struct glyph {
  {{000,000,037,004,004,000,000,000,000}, U(2ADF) }, /* short down tack */
  {{000,000,004,004,037,000,000,000,000}, U(2AE0) }, /* short up tack */
  {{020,037,020,037,020,037,020,000,000}, U(2AE2) }, /* triple rt turnstile */
+ {{001,037,001,037,001,037,001,000,000}, -1, "uni2AE2.rtlm" },
  {{000,005,005,035,005,005,000,000,000}, U(2AE3) }, /* dbl vert left tstile */
  {{000,001,037,001,037,001,000,000,000}, U(2AE4) }, /* dbl left turnstile */
  {{000,005,035,005,035,005,000,000,000}, U(2AE5) }, /* dbl v dbl left tstile */
  {{000,024,024,037,024,024,000,000,000}, U(2AE6) },
+ {{000,005,005,037,005,005,000,000,000}, -1, "uni2AE6.rtlm" },
  {{000,037,000,037,004,004,000,000,000}, U(2AE7) }, /* short down tack o'bar */
  {{000,004,004,037,000,037,000,000,000}, U(2AE8) }, /* short up tack u'bar */
  {{004,004,037,000,037,004,004,000,000}, U(2AE9) }, /* short up down tacks */
@@ -2562,6 +2592,9 @@ main(int argc, char **argv)
        printf("Lookup: 1 0 0 \"c2sc: upper-case to small caps\" "
            "{\"c2sc\" (\"c2sc\")} "
            "['c2sc' ('latn' <'dflt'>)]\n");
+       printf("Lookup: 1 0 0 \"rtlm: right-to-left mirrored forms\" "
+           "{\"rtlm\" (\"rtlm\")} "
+           "['rtlm' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n");
        printf("BeginChars: %d %d\n", 0x110000 + extraglyphs, nglyphs);
        extraglyphs = 0;
        for (i = 0; i < nglyphs; i++)
@@ -2779,6 +2812,8 @@ dolookups(struct glyph const *g)
                        printf("Substitution2: \"smcp\" %s\n", (*gp)->name);
                if (strcmp((*gp)->name + plen, "c2sc") == 0)
                        printf("Substitution2: \"c2sc\" %s\n", (*gp)->name);
+               if (strcmp((*gp)->name + plen, "rtlm") == 0)
+                       printf("Substitution2: \"rtlm\" %s\n", (*gp)->name);
        }
        if (any_alt) {
                printf("AlternateSubs2: \"aalt\"");