[latex3-commits] [git/LaTeX3-latex3-latex3] main: Leave Greek spacing diacritics unchanged in uppercasing (f0054d33a)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Mar 9 08:37:42 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/f0054d33ae29e47b9b9b6d0f9508043df7521a7b

>---------------------------------------------------------------

commit f0054d33ae29e47b9b9b6d0f9508043df7521a7b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Mar 9 07:35:22 2023 +0000

    Leave Greek spacing diacritics unchanged in uppercasing


>---------------------------------------------------------------

f0054d33ae29e47b9b9b6d0f9508043df7521a7b
 l3kernel/CHANGELOG.md                   |  1 +
 l3kernel/l3text-case.dtx                | 94 ++++++++++++++++++++++++++++++++-
 l3kernel/testfiles/m3text002.luatex.tlg |  2 +
 l3kernel/testfiles/m3text002.lvt        |  1 +
 l3kernel/testfiles/m3text002.ptex.tlg   |  2 +
 l3kernel/testfiles/m3text002.tlg        |  2 +
 l3kernel/testfiles/m3text002.uptex.tlg  |  2 +
 l3kernel/testfiles/m3text002.xetex.tlg  |  2 +
 8 files changed, 104 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 8041e8547..ad5a39c8f 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
 ### Changed
 - Allow non-integer values in color expressions
 - Restrict color expressions values to the range [0, 100]
+- Leave Greek spacing diacritics unchanged in uppercasing
 
 ## [2023-02-22]
 
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index 3ec9fab41..10cc2d53a 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -885,6 +885,8 @@
 % \begin{macro}[EXP,pTF]{\@@_change_case_if_greek:n}
 % \begin{macro}[EXP]{\@@_change_case_if_greek:n}
 % \begin{macro}[EXP,pTF]{\@@_change_case_if_greek:n}
+% \begin{macro}[EXP,pTF]{\@@_change_case_if_greek_spacing_diacritic:n}
+% \begin{macro}[EXP]{\@@_change_case_if_greek_spacing_diacritic:n}
 % \begin{macro}[EXP,pTF]{\@@_change_case_if_greek_accent:n}
 % \begin{macro}[EXP]{\@@_change_case_if_greek_accent:n}
 % \begin{macro}[EXP,pTF]{\@@_change_case_if_greek_diacritic:n}
@@ -912,9 +914,17 @@
       { \@@_change_case_if_greek_p:n {#4} }
       { ! \@@_codepoint_compare_p:nNn {#4} = { "0374 } }
       {
-        \exp_args:Ne \@@_change_case_upper_el:nnn
+        \@@_change_case_if_greek_spacing_diacritic:nTF {#4}
           {
-            \codepoint_to_nfd:n { \@@_codepoint_from_chars:Nw #4 }
+            \@@_change_case_store:n {#4}
+            \@@_change_case_loop:nnw
+          }
+          {
+            \exp_args:Ne \@@_change_case_upper_el:nnn
+              {
+                \codepoint_to_nfd:n
+                  { \@@_codepoint_from_chars:Nw #4 }
+              }
           }
             {#2} {#3}
       }
@@ -1247,6 +1257,84 @@
       \fi:
     \fi:
   }
+\prg_new_conditional:Npnn \@@_change_case_if_greek_spacing_diacritic:n
+  #1 { TF }
+  {
+    \exp_args:Nf \@@_change_case_if_greek_spacing_diacritic:n
+      { \int_eval:n { \@@_codepoint_from_chars:Nw #1 } }
+  }
+\cs_new:Npn \@@_change_case_if_greek_spacing_diacritic:n #1
+  {
+    \if_int_compare:w #1 < "1FBD \exp_stop_f:
+      \if_int_compare:w #1 = "037A \exp_stop_f:
+        \prg_return_true:
+      \else:
+        \prg_return_false:
+      \fi:
+    \else:
+      \if_int_compare:w #1 = "1FBD \exp_stop_f:
+        \prg_return_true:
+      \else:
+        \if_int_compare:w #1 = "1FBF \exp_stop_f:
+          \prg_return_true:
+        \else:
+          \if_int_compare:w #1 = "1FC0 \exp_stop_f:
+            \prg_return_true:
+          \else:
+            \if_int_compare:w #1 = "1FC1 \exp_stop_f:
+              \prg_return_true:
+            \else:
+              \if_int_compare:w #1 = "1FCD \exp_stop_f:
+                \prg_return_true:
+              \else:
+                \if_int_compare:w #1 = "1FCE \exp_stop_f:
+                  \prg_return_true:
+                \else:
+                  \if_int_compare:w #1 = "1FCF \exp_stop_f:
+                    \prg_return_true:
+                   \else:
+                    \if_int_compare:w #1 = "1FDD \exp_stop_f:
+                      \prg_return_true:
+                    \else:
+                      \if_int_compare:w #1 = "1FDE \exp_stop_f:
+                        \prg_return_true:
+                      \else:
+                        \if_int_compare:w #1 = "1FDF \exp_stop_f:
+                          \prg_return_true:
+                        \else:
+                          \if_int_compare:w #1 = "1FED \exp_stop_f:
+                            \prg_return_true:
+                          \else:
+                            \if_int_compare:w #1 = "1FEE \exp_stop_f:
+                              \prg_return_true:
+                            \else:
+                              \if_int_compare:w #1 = "1FEF \exp_stop_f:
+                                \prg_return_true:
+                              \else:
+                                \if_int_compare:w #1 = "1FFD \exp_stop_f:
+                                  \prg_return_true:
+                                \else:
+                                  \if_int_compare:w #1 = "1FFE \exp_stop_f:
+                                    \prg_return_true:
+                                  \else:
+                                    \prg_return_false:
+                                  \fi:
+                                \fi:
+                              \fi:
+                            \fi:
+                          \fi:
+                        \fi:
+                      \fi:
+                    \fi:
+                  \fi:
+                \fi:
+              \fi:
+            \fi:
+          \fi:
+        \fi:
+      \fi:
+    \fi:
+  }
 \prg_new_conditional:Npnn \@@_change_case_if_greek_diacritic:n
   #1 { TF , p }
   {
@@ -1351,6 +1439,8 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 % \begin{macro}[EXP]
 %   {\@@_change_case_boundary_upper_el:Nnnw, \@@_change_case_boundary_upper_el-x-iota:Nnnw}
 % \begin{macro}[EXP]{\@@_change_case_boundary_upper_el:nnN}
diff --git a/l3kernel/testfiles/m3text002.luatex.tlg b/l3kernel/testfiles/m3text002.luatex.tlg
index 75f3a4e08..fc068180b 100644
--- a/l3kernel/testfiles/m3text002.luatex.tlg
+++ b/l3kernel/testfiles/m3text002.luatex.tlg
@@ -225,6 +225,8 @@ TEST 17: Greek
 ʹ
 ΤΟ ΈΝΑ Ή ΤΟ ΆΛΛΟ
 ΤΟ ΕΝΑ Ή ΤΟ ΑΛΛΟ
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭΅῁
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭^^a8῁
 ============================================================
 ============================================================
 TEST 18: Turkish/Azeri
diff --git a/l3kernel/testfiles/m3text002.lvt b/l3kernel/testfiles/m3text002.lvt
index f2a33e557..532cf7a5d 100644
--- a/l3kernel/testfiles/m3text002.lvt
+++ b/l3kernel/testfiles/m3text002.lvt
@@ -223,6 +223,7 @@
     \greektestiota:n { ᾠᾡᾢᾣᾤᾦᾧᾥ }                         \NEWLINE
     \greektest:n { ʹ }                                    \NEWLINE
     \greektest:n { Το~ένα~Ή~το~άλλο }                     \NEWLINE
+    \greektest:n { ͺ ῀ ` ´ ῾ ᾽ ᾿ ῍ ῎ ῝ ῞ ῟ ῏ ῭ ΅ ῁ }      \NEWLINE
   }
 
 \TESTEXP { Turkish/Azeri }
diff --git a/l3kernel/testfiles/m3text002.ptex.tlg b/l3kernel/testfiles/m3text002.ptex.tlg
index c6cbe0cc6..ce5501d9d 100644
--- a/l3kernel/testfiles/m3text002.ptex.tlg
+++ b/l3kernel/testfiles/m3text002.ptex.tlg
@@ -225,6 +225,8 @@ TEST 17: Greek
 ^^cd^^b4
 Το ^^ce^^88να ^^ce^^89 το ^^ce^^86λλο
 Το ^^ce^^95να ^^ce^^89 το ^^ce^^91λλο
+^^cd^^ba^^e1^^bf^^80`^^b4^^e1^^bf^^be^^e1^^be^^bd^^e1^^be^^bf^^e1^^bf^^8d^^e1^^bf^^8e^^e1^^bf^^9d^^e1^^bf^^9e^^e1^^bf^^9f^^e1^^bf^^8f^^e1^^bf^^ad^^ce^^85^^e1^^bf^^81
+^^cd^^ba^^e1^^bf^^80`^^b4^^e1^^bf^^be^^e1^^be^^bd^^e1^^be^^bf^^e1^^bf^^8d^^e1^^bf^^8e^^e1^^bf^^9d^^e1^^bf^^9e^^e1^^bf^^9f^^e1^^bf^^8f^^e1^^bf^^ad^^c2^^a8^^e1^^bf^^81
 ============================================================
 ============================================================
 TEST 18: Turkish/Azeri
diff --git a/l3kernel/testfiles/m3text002.tlg b/l3kernel/testfiles/m3text002.tlg
index 8ae450208..ec9ea596f 100644
--- a/l3kernel/testfiles/m3text002.tlg
+++ b/l3kernel/testfiles/m3text002.tlg
@@ -225,6 +225,8 @@ TEST 17: Greek
 ^^cd^^b4
 ^^ce^^a4^^ce^^9f ^^ce^^88^^ce^^9d^^ce^^91 ^^ce^^89 ^^ce^^a4^^ce^^9f ^^ce^^86^^ce^^9b^^ce^^9b^^ce^^9f
 ^^ce^^a4^^ce^^9f ^^ce^^95^^ce^^9d^^ce^^91 ^^ce^^89 ^^ce^^a4^^ce^^9f ^^ce^^91^^ce^^9b^^ce^^9b^^ce^^9f
+^^cd^^ba^^e1^^bf^^80`^^c2^^b4^^e1^^bf^^be^^e1^^be^^bd^^e1^^be^^bf^^e1^^bf^^8d^^e1^^bf^^8e^^e1^^bf^^9d^^e1^^bf^^9e^^e1^^bf^^9f^^e1^^bf^^8f^^e1^^bf^^ad^^ce^^85^^e1^^bf^^81
+^^cd^^ba^^e1^^bf^^80`^^c2^^b4^^e1^^bf^^be^^e1^^be^^bd^^e1^^be^^bf^^e1^^bf^^8d^^e1^^bf^^8e^^e1^^bf^^9d^^e1^^bf^^9e^^e1^^bf^^9f^^e1^^bf^^8f^^e1^^bf^^ad^^c2^^a8^^e1^^bf^^81
 ============================================================
 ============================================================
 TEST 18: Turkish/Azeri
diff --git a/l3kernel/testfiles/m3text002.uptex.tlg b/l3kernel/testfiles/m3text002.uptex.tlg
index 7e1153cca..9009f455c 100644
--- a/l3kernel/testfiles/m3text002.uptex.tlg
+++ b/l3kernel/testfiles/m3text002.uptex.tlg
@@ -225,6 +225,8 @@ TEST 17: Greek
 ʹ
 Τ^^ce^^9f ^^ce^^88^^ce^^9d^^ce^^91 Ή ^^ce^^a4^^ce^^9f ^^ce^^86^^ce^^9b^^ce^^9b^^ce^^9f
 ^^ce^^a4^^ce^^9f ^^ce^^95^^ce^^9d^^ce^^91 ^^ce^^89 ^^ce^^a4^^ce^^9f ^^ce^^91^^ce^^9b^^ce^^9b^^ce^^9f
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭΅῁
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭^^c2^^a8῁
 ============================================================
 ============================================================
 TEST 18: Turkish/Azeri
diff --git a/l3kernel/testfiles/m3text002.xetex.tlg b/l3kernel/testfiles/m3text002.xetex.tlg
index 75f3a4e08..fc068180b 100644
--- a/l3kernel/testfiles/m3text002.xetex.tlg
+++ b/l3kernel/testfiles/m3text002.xetex.tlg
@@ -225,6 +225,8 @@ TEST 17: Greek
 ʹ
 ΤΟ ΈΝΑ Ή ΤΟ ΆΛΛΟ
 ΤΟ ΕΝΑ Ή ΤΟ ΑΛΛΟ
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭΅῁
+ͺ῀`^^b4῾᾽᾿῍῎῝῞῟῏῭^^a8῁
 ============================================================
 ============================================================
 TEST 18: Turkish/Azeri





More information about the latex3-commits mailing list.