unicode: Remove non-starter and compatibility compositions from the table.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-02-17 11:52:24 +01:00
parent ce41b32117
commit 30f298f5db
3 changed files with 80 additions and 86 deletions

View File

@ -4,31 +4,30 @@
#include "windef.h"
static const unsigned int table[2220] =
static const unsigned int table[2208] =
{
/* second chars + offsets */
0x00300, 0x00055, 0x00301, 0x000a9, 0x00302, 0x0011f, 0x00303, 0x0013f,
0x00304, 0x0015b, 0x00306, 0x00187, 0x00307, 0x001a7, 0x00308, 0x001d5,
0x00309, 0x0020b, 0x0030a, 0x00223, 0x0030b, 0x00229, 0x0030c, 0x0022f,
0x0030f, 0x00254, 0x00311, 0x00262, 0x00313, 0x0026e, 0x00314, 0x0027c,
0x0031b, 0x0028c, 0x00323, 0x00290, 0x00324, 0x002ba, 0x00325, 0x002bc,
0x00326, 0x002be, 0x00327, 0x002c2, 0x00328, 0x002d8, 0x0032d, 0x002e2,
0x0032e, 0x002ee, 0x00330, 0x002f0, 0x00331, 0x002f6, 0x00338, 0x00307,
0x00342, 0x00334, 0x00345, 0x00351, 0x005b4, 0x00390, 0x005b7, 0x00391,
0x005b8, 0x00393, 0x005b9, 0x00394, 0x005bc, 0x00395, 0x005bf, 0x003ab,
0x005c1, 0x003ae, 0x005c2, 0x003b0, 0x00653, 0x003b2, 0x00654, 0x003b3,
0x00655, 0x003b9, 0x0093c, 0x003ba, 0x009bc, 0x003c5, 0x009be, 0x003c8,
0x009d7, 0x003c9, 0x00a3c, 0x003ca, 0x00b3c, 0x003d0, 0x00b3e, 0x003d2,
0x00b56, 0x003d3, 0x00b57, 0x003d4, 0x00bbe, 0x003d5, 0x00bd7, 0x003d7,
0x00c56, 0x003d9, 0x00cc2, 0x003da, 0x00cd5, 0x003db, 0x00cd6, 0x003de,
0x00d3e, 0x003df, 0x00d57, 0x003e1, 0x00dca, 0x003e2, 0x00dcf, 0x003e4,
0x00ddf, 0x003e5, 0x00f72, 0x003e6, 0x00f74, 0x003e7, 0x00f80, 0x003e8,
0x00fb5, 0x003eb, 0x00fb7, 0x003ed, 0x0102e, 0x003f7, 0x01b35, 0x003f8,
0x03099, 0x00403, 0x0309a, 0x00433, 0x110ba, 0x0043d, 0x11127, 0x00440,
0x1133e, 0x00442, 0x11357, 0x00443, 0x114b0, 0x00444, 0x114ba, 0x00445,
0x114bd, 0x00446, 0x115af, 0x00447, 0x1d165, 0x00449, 0x1d16e, 0x0044d,
0x1d16f, 0x00450, 0x1d170, 0x00453, 0x1d171, 0x00454, 0x1d172, 0x00455,
0x00000, 0x00456,
0x00300, 0x00053, 0x00301, 0x000a7, 0x00302, 0x0011c, 0x00303, 0x0013c,
0x00304, 0x00158, 0x00306, 0x00184, 0x00307, 0x001a4, 0x00308, 0x001d2,
0x00309, 0x00208, 0x0030a, 0x00220, 0x0030b, 0x00226, 0x0030c, 0x0022c,
0x0030f, 0x00251, 0x00311, 0x0025f, 0x00313, 0x0026b, 0x00314, 0x00279,
0x0031b, 0x00289, 0x00323, 0x0028d, 0x00324, 0x002b7, 0x00325, 0x002b9,
0x00326, 0x002bb, 0x00327, 0x002bf, 0x00328, 0x002d5, 0x0032d, 0x002df,
0x0032e, 0x002eb, 0x00330, 0x002ed, 0x00331, 0x002f3, 0x00338, 0x00304,
0x00342, 0x00331, 0x00345, 0x0034e, 0x005b4, 0x0038d, 0x005b7, 0x0038e,
0x005b8, 0x00390, 0x005b9, 0x00391, 0x005bc, 0x00392, 0x005bf, 0x003a8,
0x005c1, 0x003ab, 0x005c2, 0x003ad, 0x00653, 0x003af, 0x00654, 0x003b0,
0x00655, 0x003b6, 0x0093c, 0x003b7, 0x009bc, 0x003c2, 0x009be, 0x003c5,
0x009d7, 0x003c6, 0x00a3c, 0x003c7, 0x00b3c, 0x003cd, 0x00b3e, 0x003cf,
0x00b56, 0x003d0, 0x00b57, 0x003d1, 0x00bbe, 0x003d2, 0x00bd7, 0x003d4,
0x00c56, 0x003d6, 0x00cc2, 0x003d7, 0x00cd5, 0x003d8, 0x00cd6, 0x003db,
0x00d3e, 0x003dc, 0x00d57, 0x003de, 0x00dca, 0x003df, 0x00dcf, 0x003e1,
0x00ddf, 0x003e2, 0x00f80, 0x003e3, 0x00fb5, 0x003e5, 0x00fb7, 0x003e7,
0x0102e, 0x003f1, 0x01b35, 0x003f2, 0x03099, 0x003fd, 0x0309a, 0x0042d,
0x110ba, 0x00437, 0x11127, 0x0043a, 0x1133e, 0x0043c, 0x11357, 0x0043d,
0x114b0, 0x0043e, 0x114ba, 0x0043f, 0x114bd, 0x00440, 0x115af, 0x00441,
0x1d165, 0x00443, 0x1d16e, 0x00447, 0x1d16f, 0x0044a, 0x1d170, 0x0044d,
0x1d171, 0x0044e, 0x1d172, 0x0044f, 0x00000, 0x00450,
/* 0x0300 */
0x00041, 0x000c0, 0x00045, 0x000c8, 0x00049, 0x000cc, 0x0004e, 0x001f8,
0x0004f, 0x000d2, 0x00055, 0x000d9, 0x00057, 0x01e80, 0x00059, 0x01ef2,
@ -68,20 +67,20 @@ static const unsigned int table[2220] =
0x000f5, 0x01e4d, 0x000f8, 0x001ff, 0x000fc, 0x001d8, 0x00102, 0x01eae,
0x00103, 0x01eaf, 0x00112, 0x01e16, 0x00113, 0x01e17, 0x0014c, 0x01e52,
0x0014d, 0x01e53, 0x00168, 0x01e78, 0x00169, 0x01e79, 0x001a0, 0x01eda,
0x001a1, 0x01edb, 0x001af, 0x01ee8, 0x001b0, 0x01ee9, 0x00308, 0x00344,
0x00391, 0x00386, 0x00395, 0x00388, 0x00397, 0x00389, 0x00399, 0x0038a,
0x0039f, 0x0038c, 0x003a5, 0x0038e, 0x003a9, 0x0038f, 0x003b1, 0x003ac,
0x003b5, 0x003ad, 0x003b7, 0x003ae, 0x003b9, 0x003af, 0x003bf, 0x003cc,
0x003c5, 0x003cd, 0x003c9, 0x003ce, 0x003ca, 0x00390, 0x003cb, 0x003b0,
0x003d2, 0x003d3, 0x00413, 0x00403, 0x0041a, 0x0040c, 0x00433, 0x00453,
0x0043a, 0x0045c, 0x01f00, 0x01f04, 0x01f01, 0x01f05, 0x01f08, 0x01f0c,
0x01f09, 0x01f0d, 0x01f10, 0x01f14, 0x01f11, 0x01f15, 0x01f18, 0x01f1c,
0x01f19, 0x01f1d, 0x01f20, 0x01f24, 0x01f21, 0x01f25, 0x01f28, 0x01f2c,
0x01f29, 0x01f2d, 0x01f30, 0x01f34, 0x01f31, 0x01f35, 0x01f38, 0x01f3c,
0x01f39, 0x01f3d, 0x01f40, 0x01f44, 0x01f41, 0x01f45, 0x01f48, 0x01f4c,
0x01f49, 0x01f4d, 0x01f50, 0x01f54, 0x01f51, 0x01f55, 0x01f59, 0x01f5d,
0x01f60, 0x01f64, 0x01f61, 0x01f65, 0x01f68, 0x01f6c, 0x01f69, 0x01f6d,
0x01fbf, 0x01fce, 0x01ffe, 0x01fde,
0x001a1, 0x01edb, 0x001af, 0x01ee8, 0x001b0, 0x01ee9, 0x00391, 0x00386,
0x00395, 0x00388, 0x00397, 0x00389, 0x00399, 0x0038a, 0x0039f, 0x0038c,
0x003a5, 0x0038e, 0x003a9, 0x0038f, 0x003b1, 0x003ac, 0x003b5, 0x003ad,
0x003b7, 0x003ae, 0x003b9, 0x003af, 0x003bf, 0x003cc, 0x003c5, 0x003cd,
0x003c9, 0x003ce, 0x003ca, 0x00390, 0x003cb, 0x003b0, 0x003d2, 0x003d3,
0x00413, 0x00403, 0x0041a, 0x0040c, 0x00433, 0x00453, 0x0043a, 0x0045c,
0x01f00, 0x01f04, 0x01f01, 0x01f05, 0x01f08, 0x01f0c, 0x01f09, 0x01f0d,
0x01f10, 0x01f14, 0x01f11, 0x01f15, 0x01f18, 0x01f1c, 0x01f19, 0x01f1d,
0x01f20, 0x01f24, 0x01f21, 0x01f25, 0x01f28, 0x01f2c, 0x01f29, 0x01f2d,
0x01f30, 0x01f34, 0x01f31, 0x01f35, 0x01f38, 0x01f3c, 0x01f39, 0x01f3d,
0x01f40, 0x01f44, 0x01f41, 0x01f45, 0x01f48, 0x01f4c, 0x01f49, 0x01f4d,
0x01f50, 0x01f54, 0x01f51, 0x01f55, 0x01f59, 0x01f5d, 0x01f60, 0x01f64,
0x01f61, 0x01f65, 0x01f68, 0x01f6c, 0x01f69, 0x01f6d, 0x01fbf, 0x01fce,
0x01ffe, 0x01fde,
/* 0x0302 */
0x00041, 0x000c2, 0x00043, 0x00108, 0x00045, 0x000ca, 0x00047, 0x0011c,
0x00048, 0x00124, 0x00049, 0x000ce, 0x0004a, 0x00134, 0x0004f, 0x000d4,
@ -347,12 +346,8 @@ static const unsigned int table[2220] =
0x00dd9, 0x00ddc,
/* 0x0ddf */
0x00dd9, 0x00dde,
/* 0x0f72 */
0x00f71, 0x00f73,
/* 0x0f74 */
0x00f71, 0x00f75,
/* 0x0f80 */
0x00f71, 0x00f81, 0x00fb2, 0x00f76, 0x00fb3, 0x00f78,
0x00fb2, 0x00f76, 0x00fb3, 0x00f78,
/* 0x0fb5 */
0x00f40, 0x00f69, 0x00f90, 0x00fb9,
/* 0x0fb7 */
@ -428,7 +423,7 @@ unsigned int DECLSPEC_HIDDEN wine_compose( unsigned int ch1, unsigned int ch2 )
{
int pos;
if ((pos = binary_search( ch2, 0, 84 - 1 )) == -1) return 0;
if ((pos = binary_search( ch2, 0, 82 - 1 )) == -1) return 0;
if ((pos = binary_search( ch1, table[2 * pos + 1], table[2 * pos + 3] - 1 )) == -1) return 0;
return table[2 * pos + 1];
}

View File

@ -4,31 +4,30 @@
#include "windef.h"
static const unsigned int table[2220] =
static const unsigned int table[2208] =
{
/* second chars + offsets */
0x00300, 0x00055, 0x00301, 0x000a9, 0x00302, 0x0011f, 0x00303, 0x0013f,
0x00304, 0x0015b, 0x00306, 0x00187, 0x00307, 0x001a7, 0x00308, 0x001d5,
0x00309, 0x0020b, 0x0030a, 0x00223, 0x0030b, 0x00229, 0x0030c, 0x0022f,
0x0030f, 0x00254, 0x00311, 0x00262, 0x00313, 0x0026e, 0x00314, 0x0027c,
0x0031b, 0x0028c, 0x00323, 0x00290, 0x00324, 0x002ba, 0x00325, 0x002bc,
0x00326, 0x002be, 0x00327, 0x002c2, 0x00328, 0x002d8, 0x0032d, 0x002e2,
0x0032e, 0x002ee, 0x00330, 0x002f0, 0x00331, 0x002f6, 0x00338, 0x00307,
0x00342, 0x00334, 0x00345, 0x00351, 0x005b4, 0x00390, 0x005b7, 0x00391,
0x005b8, 0x00393, 0x005b9, 0x00394, 0x005bc, 0x00395, 0x005bf, 0x003ab,
0x005c1, 0x003ae, 0x005c2, 0x003b0, 0x00653, 0x003b2, 0x00654, 0x003b3,
0x00655, 0x003b9, 0x0093c, 0x003ba, 0x009bc, 0x003c5, 0x009be, 0x003c8,
0x009d7, 0x003c9, 0x00a3c, 0x003ca, 0x00b3c, 0x003d0, 0x00b3e, 0x003d2,
0x00b56, 0x003d3, 0x00b57, 0x003d4, 0x00bbe, 0x003d5, 0x00bd7, 0x003d7,
0x00c56, 0x003d9, 0x00cc2, 0x003da, 0x00cd5, 0x003db, 0x00cd6, 0x003de,
0x00d3e, 0x003df, 0x00d57, 0x003e1, 0x00dca, 0x003e2, 0x00dcf, 0x003e4,
0x00ddf, 0x003e5, 0x00f72, 0x003e6, 0x00f74, 0x003e7, 0x00f80, 0x003e8,
0x00fb5, 0x003eb, 0x00fb7, 0x003ed, 0x0102e, 0x003f7, 0x01b35, 0x003f8,
0x03099, 0x00403, 0x0309a, 0x00433, 0x110ba, 0x0043d, 0x11127, 0x00440,
0x1133e, 0x00442, 0x11357, 0x00443, 0x114b0, 0x00444, 0x114ba, 0x00445,
0x114bd, 0x00446, 0x115af, 0x00447, 0x1d165, 0x00449, 0x1d16e, 0x0044d,
0x1d16f, 0x00450, 0x1d170, 0x00453, 0x1d171, 0x00454, 0x1d172, 0x00455,
0x00000, 0x00456,
0x00300, 0x00053, 0x00301, 0x000a7, 0x00302, 0x0011c, 0x00303, 0x0013c,
0x00304, 0x00158, 0x00306, 0x00184, 0x00307, 0x001a4, 0x00308, 0x001d2,
0x00309, 0x00208, 0x0030a, 0x00220, 0x0030b, 0x00226, 0x0030c, 0x0022c,
0x0030f, 0x00251, 0x00311, 0x0025f, 0x00313, 0x0026b, 0x00314, 0x00279,
0x0031b, 0x00289, 0x00323, 0x0028d, 0x00324, 0x002b7, 0x00325, 0x002b9,
0x00326, 0x002bb, 0x00327, 0x002bf, 0x00328, 0x002d5, 0x0032d, 0x002df,
0x0032e, 0x002eb, 0x00330, 0x002ed, 0x00331, 0x002f3, 0x00338, 0x00304,
0x00342, 0x00331, 0x00345, 0x0034e, 0x005b4, 0x0038d, 0x005b7, 0x0038e,
0x005b8, 0x00390, 0x005b9, 0x00391, 0x005bc, 0x00392, 0x005bf, 0x003a8,
0x005c1, 0x003ab, 0x005c2, 0x003ad, 0x00653, 0x003af, 0x00654, 0x003b0,
0x00655, 0x003b6, 0x0093c, 0x003b7, 0x009bc, 0x003c2, 0x009be, 0x003c5,
0x009d7, 0x003c6, 0x00a3c, 0x003c7, 0x00b3c, 0x003cd, 0x00b3e, 0x003cf,
0x00b56, 0x003d0, 0x00b57, 0x003d1, 0x00bbe, 0x003d2, 0x00bd7, 0x003d4,
0x00c56, 0x003d6, 0x00cc2, 0x003d7, 0x00cd5, 0x003d8, 0x00cd6, 0x003db,
0x00d3e, 0x003dc, 0x00d57, 0x003de, 0x00dca, 0x003df, 0x00dcf, 0x003e1,
0x00ddf, 0x003e2, 0x00f80, 0x003e3, 0x00fb5, 0x003e5, 0x00fb7, 0x003e7,
0x0102e, 0x003f1, 0x01b35, 0x003f2, 0x03099, 0x003fd, 0x0309a, 0x0042d,
0x110ba, 0x00437, 0x11127, 0x0043a, 0x1133e, 0x0043c, 0x11357, 0x0043d,
0x114b0, 0x0043e, 0x114ba, 0x0043f, 0x114bd, 0x00440, 0x115af, 0x00441,
0x1d165, 0x00443, 0x1d16e, 0x00447, 0x1d16f, 0x0044a, 0x1d170, 0x0044d,
0x1d171, 0x0044e, 0x1d172, 0x0044f, 0x00000, 0x00450,
/* 0x0300 */
0x00041, 0x000c0, 0x00045, 0x000c8, 0x00049, 0x000cc, 0x0004e, 0x001f8,
0x0004f, 0x000d2, 0x00055, 0x000d9, 0x00057, 0x01e80, 0x00059, 0x01ef2,
@ -68,20 +67,20 @@ static const unsigned int table[2220] =
0x000f5, 0x01e4d, 0x000f8, 0x001ff, 0x000fc, 0x001d8, 0x00102, 0x01eae,
0x00103, 0x01eaf, 0x00112, 0x01e16, 0x00113, 0x01e17, 0x0014c, 0x01e52,
0x0014d, 0x01e53, 0x00168, 0x01e78, 0x00169, 0x01e79, 0x001a0, 0x01eda,
0x001a1, 0x01edb, 0x001af, 0x01ee8, 0x001b0, 0x01ee9, 0x00308, 0x00344,
0x00391, 0x00386, 0x00395, 0x00388, 0x00397, 0x00389, 0x00399, 0x0038a,
0x0039f, 0x0038c, 0x003a5, 0x0038e, 0x003a9, 0x0038f, 0x003b1, 0x003ac,
0x003b5, 0x003ad, 0x003b7, 0x003ae, 0x003b9, 0x003af, 0x003bf, 0x003cc,
0x003c5, 0x003cd, 0x003c9, 0x003ce, 0x003ca, 0x00390, 0x003cb, 0x003b0,
0x003d2, 0x003d3, 0x00413, 0x00403, 0x0041a, 0x0040c, 0x00433, 0x00453,
0x0043a, 0x0045c, 0x01f00, 0x01f04, 0x01f01, 0x01f05, 0x01f08, 0x01f0c,
0x01f09, 0x01f0d, 0x01f10, 0x01f14, 0x01f11, 0x01f15, 0x01f18, 0x01f1c,
0x01f19, 0x01f1d, 0x01f20, 0x01f24, 0x01f21, 0x01f25, 0x01f28, 0x01f2c,
0x01f29, 0x01f2d, 0x01f30, 0x01f34, 0x01f31, 0x01f35, 0x01f38, 0x01f3c,
0x01f39, 0x01f3d, 0x01f40, 0x01f44, 0x01f41, 0x01f45, 0x01f48, 0x01f4c,
0x01f49, 0x01f4d, 0x01f50, 0x01f54, 0x01f51, 0x01f55, 0x01f59, 0x01f5d,
0x01f60, 0x01f64, 0x01f61, 0x01f65, 0x01f68, 0x01f6c, 0x01f69, 0x01f6d,
0x01fbf, 0x01fce, 0x01ffe, 0x01fde,
0x001a1, 0x01edb, 0x001af, 0x01ee8, 0x001b0, 0x01ee9, 0x00391, 0x00386,
0x00395, 0x00388, 0x00397, 0x00389, 0x00399, 0x0038a, 0x0039f, 0x0038c,
0x003a5, 0x0038e, 0x003a9, 0x0038f, 0x003b1, 0x003ac, 0x003b5, 0x003ad,
0x003b7, 0x003ae, 0x003b9, 0x003af, 0x003bf, 0x003cc, 0x003c5, 0x003cd,
0x003c9, 0x003ce, 0x003ca, 0x00390, 0x003cb, 0x003b0, 0x003d2, 0x003d3,
0x00413, 0x00403, 0x0041a, 0x0040c, 0x00433, 0x00453, 0x0043a, 0x0045c,
0x01f00, 0x01f04, 0x01f01, 0x01f05, 0x01f08, 0x01f0c, 0x01f09, 0x01f0d,
0x01f10, 0x01f14, 0x01f11, 0x01f15, 0x01f18, 0x01f1c, 0x01f19, 0x01f1d,
0x01f20, 0x01f24, 0x01f21, 0x01f25, 0x01f28, 0x01f2c, 0x01f29, 0x01f2d,
0x01f30, 0x01f34, 0x01f31, 0x01f35, 0x01f38, 0x01f3c, 0x01f39, 0x01f3d,
0x01f40, 0x01f44, 0x01f41, 0x01f45, 0x01f48, 0x01f4c, 0x01f49, 0x01f4d,
0x01f50, 0x01f54, 0x01f51, 0x01f55, 0x01f59, 0x01f5d, 0x01f60, 0x01f64,
0x01f61, 0x01f65, 0x01f68, 0x01f6c, 0x01f69, 0x01f6d, 0x01fbf, 0x01fce,
0x01ffe, 0x01fde,
/* 0x0302 */
0x00041, 0x000c2, 0x00043, 0x00108, 0x00045, 0x000ca, 0x00047, 0x0011c,
0x00048, 0x00124, 0x00049, 0x000ce, 0x0004a, 0x00134, 0x0004f, 0x000d4,
@ -347,12 +346,8 @@ static const unsigned int table[2220] =
0x00dd9, 0x00ddc,
/* 0x0ddf */
0x00dd9, 0x00dde,
/* 0x0f72 */
0x00f71, 0x00f73,
/* 0x0f74 */
0x00f71, 0x00f75,
/* 0x0f80 */
0x00f71, 0x00f81, 0x00fb2, 0x00f76, 0x00fb3, 0x00f78,
0x00fb2, 0x00f76, 0x00fb3, 0x00f78,
/* 0x0fb5 */
0x00f40, 0x00f69, 0x00f90, 0x00fb9,
/* 0x0fb7 */
@ -428,7 +423,7 @@ unsigned int DECLSPEC_HIDDEN wine_compose( unsigned int ch1, unsigned int ch2 )
{
int pos;
if ((pos = binary_search( ch2, 0, 84 - 1 )) == -1) return 0;
if ((pos = binary_search( ch2, 0, 82 - 1 )) == -1) return 0;
if ((pos = binary_search( ch1, table[2 * pos + 1], table[2 * pos + 3] - 1 )) == -1) return 0;
return table[2 * pos + 1];
}

View File

@ -490,6 +490,10 @@ sub get_composition($$)
return () unless defined $decomp_table[$ch]; # no decomposition
my @ret = @{$decomp_table[$ch]};
return () if @ret < 2; # singleton decomposition
return () if $combining_class_table[$ch]; # non-starter
return () if $combining_class_table[$ret[0]]; # first char is non-starter
return () if $compat && !defined $decomp_table[$ret[0]] &&
defined $decomp_compat_table[$ret[0]]; # first char has compat decomposition
return @ret;
}