]> Savannah Git Hosting - gnulib.git/commitdiff
uniwidth/width: Assign width 1 to prepended concatenation marks.
authorBruno Haible <bruno@clisp.org>
Mon, 12 Feb 2024 17:50:13 +0000 (18:50 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Feb 2024 17:57:17 +0000 (18:57 +0100)
Suggested by Jules Bertholet <julesbertholet@quoi.xyz> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00093.html>.

* lib/gen-uni-tables.c (is_nonspacing): For characters with property
Prepended_Concatenation_Mark, return false instead of true.
* lib/uniwidth/width0.h: Regenerated. This assigns width 1 to the
characters U+0600..U+0605, U+06DD, U+070F, U+0890..U+0891, U+08E2,
U+110BD, U+110CD.
* modules/uniwidth/width (configure.ac): Bump required libunistring
version.
* modules/uniwidth/u8-width (configure.ac): Likewise.
* modules/uniwidth/u8-strwidth (configure.ac): Likewise.
* modules/uniwidth/u16-width (configure.ac): Likewise.
* modules/uniwidth/u16-strwidth (configure.ac): Likewise.
* modules/uniwidth/u32-width (configure.ac): Likewise.
* modules/uniwidth/u32-strwidth (configure.ac): Likewise.

ChangeLog
lib/gen-uni-tables.c
lib/uniwidth/width0.h
modules/uniwidth/u16-strwidth
modules/uniwidth/u16-width
modules/uniwidth/u32-strwidth
modules/uniwidth/u32-width
modules/uniwidth/u8-strwidth
modules/uniwidth/u8-width
modules/uniwidth/width

index 019ccf0c7b6e3df8b05822cd9113f1835b9e0604..80d3ec562f222b1b5ca8b4cd3af0a60e14c283bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2024-02-12  Bruno Haible  <bruno@clisp.org>
+
+       uniwidth/width: Assign width 1 to prepended concatenation marks.
+       Suggested by Jules Bertholet <julesbertholet@quoi.xyz> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00093.html>.
+       * lib/gen-uni-tables.c (is_nonspacing): For characters with property
+       Prepended_Concatenation_Mark, return false instead of true.
+       * lib/uniwidth/width0.h: Regenerated. This assigns width 1 to the
+       characters U+0600..U+0605, U+06DD, U+070F, U+0890..U+0891, U+08E2,
+       U+110BD, U+110CD.
+       * modules/uniwidth/width (configure.ac): Bump required libunistring
+       version.
+       * modules/uniwidth/u8-width (configure.ac): Likewise.
+       * modules/uniwidth/u8-strwidth (configure.ac): Likewise.
+       * modules/uniwidth/u16-width (configure.ac): Likewise.
+       * modules/uniwidth/u16-strwidth (configure.ac): Likewise.
+       * modules/uniwidth/u32-width (configure.ac): Likewise.
+       * modules/uniwidth/u32-strwidth (configure.ac): Likewise.
+
 2024-02-12  Bruno Haible  <bruno@clisp.org>
 
        Implement a new property, added by Unicode 9.0.0.
index bc228105b4cd3ec960a229ca3a3ab6a859cdbfad..c73ce06d645e6be29f981d09494371cad3c4eaac 100644 (file)
@@ -6669,8 +6669,13 @@ fill_width (const char *width_filename)
 /* The non-spacing attribute table consists of:
    * Non-spacing characters; generated from PropList.txt or
      "grep '^[^;]*;[^;]*;[^;]*;[^;]*;NSM;' UnicodeData.txt"
-   * Format control characters; generated from
-     "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt"
+   * Format control characters, except for characters with property
+     Prepended_Concatenation_Mark; generated from
+     "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt" and from
+     "grep Prepended_Concatenation_Mark PropList.txt".
+     Rationale for the Prepended_Concatenation_Mark exception:
+     The Unicode standard says "Unlike most other format characters,
+     however, they should be rendered with a visible glyph".
    * Zero width characters; generated from
      "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt"
    * Hangul Jamo characters that have conjoining behaviour:
@@ -6695,7 +6700,9 @@ is_nonspacing (unsigned int ch)
 {
   return (unicode_attributes[ch].name != NULL
           && (get_bidi_category (ch) == UC_BIDI_NSM
-              || is_category_Cc (ch) || is_category_Cf (ch)
+              || is_category_Cc (ch)
+              || (is_category_Cf (ch)
+                  && !is_property_prepended_concatenation_mark (ch))
               || strncmp (unicode_attributes[ch].name, "ZERO WIDTH ", 11) == 0
               || (ch >= 0x1160 && ch <= 0x11A7) || (ch >= 0xD7B0 && ch <= 0xD7C6) /* jungseong */
               || (ch >= 0x11A8 && ch <= 0x11FF) || (ch >= 0xD7CB && ch <= 0xD7FB) /* jongseong */
index 77954eb4d86cf0a767d5d9e0cdaae1862dfe9e95..6cc35536ad585302381f171dcab0c0bddb447e5e 100644 (file)
@@ -46,19 +46,19 @@ static const unsigned char nonspacing_table_data[48*64] = {
   0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */
   0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */
   /* 0x0600-0x07ff */
-  0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
+  0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
   0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */
-  0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
-  0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
+  0x00, 0x00, 0xc0, 0x9f, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
+  0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */
   0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */
   0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x20, /* 0x07c0-0x07ff */
   /* 0x0800-0x09ff */
   0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */
   0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */
-  0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
-  0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
+  0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
+  0x00, 0xfc, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */
   0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */
   0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */
@@ -273,8 +273,8 @@ static const unsigned char nonspacing_table_data[48*64] = {
   /* 0x11000-0x111ff */
   0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */
   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x80, /* 0x11040-0x1107f */
-  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */
-  0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
+  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x06, /* 0x11080-0x110bf */
+  0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
   0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */
   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */
index 1a4ea001e9e7a4d0a70e9f9b87efe7786fadc4d7..f7ceb9272c9de64c86e9164f29d29485766622a9 100644 (file)
@@ -10,7 +10,7 @@ uniwidth/u16-width
 unistr/u16-strlen
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u16-strwidth])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u16-strwidth])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U16_STRWIDTH
index 161898c93e2e7681cef8cb3a65d276b9570aab99..dfd08e3fec03a30e3e29807a13aaacdb0eb76898 100644 (file)
@@ -10,7 +10,7 @@ uniwidth/width
 unistr/u16-mbtouc-unsafe
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u16-width])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u16-width])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U16_WIDTH
index 9c36df422afa8fd1ab0028ecc52cf2c45ca01929..a13836f1ccdaa637d59751f452232286519ea0ab 100644 (file)
@@ -10,7 +10,7 @@ uniwidth/u32-width
 unistr/u32-strlen
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u32-strwidth])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u32-strwidth])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U32_STRWIDTH
index 34f25fea76357b068d649b7db88d3f9898d6d73b..d90d9b9a20a74c71f33bd99b26d3e4b240a5424e 100644 (file)
@@ -9,7 +9,7 @@ uniwidth/base
 uniwidth/width
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u32-width])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u32-width])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U32_WIDTH
index 303ee5c0107190b148b27989fc5d481ec5f004d5..26857ae4b02b54977b0d0ba6dccd7a0a6297f86c 100644 (file)
@@ -10,7 +10,7 @@ uniwidth/u8-width
 unistr/u8-strlen
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u8-strwidth])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u8-strwidth])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U8_STRWIDTH
index 36df3afe3f79bb3a2123e645773f21616664a0ae..46f5e4e0140926512da9b9765e17aa5a0f907f1d 100644 (file)
@@ -10,7 +10,7 @@ uniwidth/width
 unistr/u8-mbtouc-unsafe
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/u8-width])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/u8-width])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_U8_WIDTH
index 30973445b02de86463eb1a197a2c2150c44b0c91..dc028317a1449f09ccafdd1f474ee637ab419282 100644 (file)
@@ -13,7 +13,7 @@ uniwidth/base
 streq
 
 configure.ac:
-gl_LIBUNISTRING_MODULE([1.1], [uniwidth/width])
+gl_LIBUNISTRING_MODULE([1.2], [uniwidth/width])
 
 Makefile.am:
 if LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH