[latex3-commits] [git/LaTeX3-latex3-latex3] master: Extend case changer to cover all of Greek with pdfTeX (4b783c7f9)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Oct 12 11:18:59 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/4b783c7f9ff77de6e742c17e764676fd417553c8

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

commit 4b783c7f9ff77de6e742c17e764676fd417553c8
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sat Oct 10 17:42:42 2020 +0100

    Extend case changer to cover all of Greek with pdfTeX


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

4b783c7f9ff77de6e742c17e764676fd417553c8
 l3kernel/CHANGELOG.md    |   3 +
 l3kernel/l3text-case.dtx | 255 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 252 insertions(+), 6 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index a15d3e766..d2968ee5d 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Extend case changer to cover all of Greek with pdfTeX
+
 ### Fixed
 - Some aspects of `cctab` setup with 8-bit engines(issue #814)
 
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index 32b1581ed..7ef49a932 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -1454,9 +1454,18 @@
         { 042E } { 044E }
         { 042F } { 044F }
 %    \end{macrocode}
-% Core Greek support: there may need to be a little more work here to
-% deal completely with accents.
+% Greek support: everything in the two-octet range.
 %    \begin{macrocode}
+        { 0370 } { 0371 }
+        { 0372 } { 0373 }
+        { 0376 } { 0377 }
+        { 03FD } { 037B }
+        { 03FE } { 037C }
+        { 03FF } { 037D }
+        { 0386 } { 03AC }
+        { 0388 } { 03AD }
+        { 0389 } { 03AE }
+        { 038A } { 03AF }
         { 0391 } { 03B1 }
         { 0392 } { 03B2 }
         { 0393 } { 03B3 }
@@ -1481,20 +1490,39 @@
         { 03A7 } { 03C7 }
         { 03A8 } { 03C8 }
         { 03A9 } { 03C9 }
+        { 03AA } { 03CA }
+        { 03AB } { 03CB }
+        { 038C } { 03CC }
+        { 038E } { 03CD }
+        { 038F } { 03CE }
+        { 03CF } { 03D7 }
         { 03D8 } { 03D9 }
         { 03DA } { 03DB }
         { 03DC } { 03DD }
         { 03DE } { 03DF }
         { 03E0 } { 03E1 }
+        { 03E2 } { 03E3 }
+        { 03E4 } { 03E5 }
+        { 03E6 } { 03E7 }
+        { 03E8 } { 03E9 }
+        { 03EA } { 03EB }
+        { 03EC } { 03ED }
+        { 03EE } { 03EF }
+        { 03F9 } { 03F2 }
+        { 037F } { 03F3 }
+        { 03F7 } { 03F8 }
+        { 03FA } { 03FB }
         \q_recursion_tail ?
         \q_recursion_stop
 %    \end{macrocode}
-% Odds and ends that are not simple one-to-one mappings.
+% Odds and ends for Greek; mainly symbols that are for compatiblity,
+% but also things like the terminal sigma. Almost all are uppercase
+% mappings, but there is one that is not!
 %    \begin{macrocode}
       \cs_set_protected:Npn \@@_tmp:w #1#2#3
         {
           \group_begin:
-            \cs_set_protected:Npn \@@_tmp:w ##1##2##3##4
+            \cs_set_protected:Npn \@@_tmp:w ##1##2##3##4##5##6##7##8
               {
                 \tl_const:cx
                   {
@@ -1503,6 +1531,47 @@
                     \char_generate:nn {##2} { 12 }
                     _tl
                   }
+                  {
+                    \exp_after:wN \exp_after:wN \exp_after:wN
+                      \exp_not:N \char_generate:nn {##5} { 13 }
+                    \exp_after:wN \exp_after:wN \exp_after:wN
+                      \exp_not:N \char_generate:nn {##6} { 13 }
+                  }
+              }
+            \use:x
+              {
+                \@@_tmp:w
+                  \char_to_utfviii_bytes:n { "#1 }
+                  \char_to_utfviii_bytes:n { "#2 }
+              }
+          \group_end:
+        }
+      \@@_tmp:w { 0345 } { 0399 } { upper }
+      \@@_tmp:w { 03C2 } { 03A3 } { upper }
+      \@@_tmp:w { 03D0 } { 0392 } { upper }
+      \@@_tmp:w { 03D1 } { 0398 } { upper }
+      \@@_tmp:w { 03D5 } { 03A6 } { upper }
+      \@@_tmp:w { 03D6 } { 03A0 } { upper }
+      \@@_tmp:w { 03F0 } { 039A } { upper }
+      \@@_tmp:w { 03F1 } { 03A1 } { upper }
+      \@@_tmp:w { 03F4 } { 03B8 } { lower }
+      \@@_tmp:w { 03F5 } { 0395 } { upper }
+%    \end{macrocode}
+% Odds and ends that are not simple one-to-one mappings. These
+% are still two-octet codepoints.
+%    \begin{macrocode}
+      \cs_set_protected:Npn \@@_tmp:w #1#2#3
+        {
+          \group_begin:
+            \cs_set_protected:Npn \@@_tmp:w ##1##2##3##4
+              {
+                \tl_const:cn
+                  {
+                    c_@@_ #3 case_
+                    \char_generate:nn {##1} { 12 }
+                    \char_generate:nn {##2} { 12 }
+                    _tl
+                  }
                     {#2}
               }
             \use:x
@@ -1512,8 +1581,182 @@
       \@@_tmp:w { 00DF } { SS } { upper }
       \@@_tmp:w { 00DF } { Ss } { title }
       \@@_tmp:w { 0131 } { I }  { upper }
-    }
-  \group_end:
+%    \end{macrocode}
+% Greek support: the three-octet codepoints.
+%    \begin{macrocode}
+      \cs_set_protected:Npn \@@_tmp:nnnnnn #1#2#3#4#5#6#7
+        {
+          \tl_const:cx
+            {
+              c_@@_ #1 case_
+              \char_generate:nn {#2} { 12 }
+              \char_generate:nn {#3} { 12 }
+              \char_generate:nn {#4} { 12 }
+              _tl
+            }
+            {
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#5} { 13 }
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#6} { 13 }
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#7} { 13 }
+            }
+        }
+      \cs_set_protected:Npn \@@_tmp:w #1#2#3#4#5#6#7#8
+        {
+          \tl_const:cx
+            {
+              c_@@_lowercase_
+              \char_generate:nn {#1} { 12 }
+              \char_generate:nn {#2} { 12 }
+              \char_generate:nn {#3} { 12 }
+              _tl
+            }
+            {
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#5} { 13 }
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#6} { 13 }
+              \exp_after:wN \exp_after:wN \exp_after:wN
+                \exp_not:N \char_generate:nn {#7} { 13 }
+            }
+          \@@_tmp:nnnnnn { upper } {#5} {#6} {#7} {#1} {#2} {#3}
+          \@@_tmp:nnnnnn { title } {#5} {#6} {#7} {#1} {#2} {#3}
+        }
+      \@@_loop:nn
+        { 1F08 } { 1F00 }
+        { 1F09 } { 1F01 }
+        { 1F0A } { 1F02 }
+        { 1F0B } { 1F03 }
+        { 1F0C } { 1F04 }
+        { 1F0D } { 1F05 }
+        { 1F0E } { 1F06 }
+        { 1F0F } { 1F07 }
+        { 1F18 } { 1F10 }
+        { 1F19 } { 1F11 }
+        { 1F1A } { 1F12 }
+        { 1F1B } { 1F13 }
+        { 1F1C } { 1F14 }
+        { 1F1D } { 1F15 }
+        { 1F28 } { 1F20 }
+        { 1F29 } { 1F21 }
+        { 1F2A } { 1F22 }
+        { 1F2B } { 1F23 }
+        { 1F2C } { 1F24 }
+        { 1F2D } { 1F25 }
+        { 1F2E } { 1F26 }
+        { 1F2F } { 1F27 }
+        { 1F38 } { 1F30 }
+        { 1F39 } { 1F31 }
+        { 1F3A } { 1F32 }
+        { 1F3B } { 1F33 }
+        { 1F3C } { 1F34 }
+        { 1F3D } { 1F35 }
+        { 1F3E } { 1F36 }
+        { 1F3F } { 1F37 }
+        { 1F48 } { 1F40 }
+        { 1F49 } { 1F41 }
+        { 1F4A } { 1F42 }
+        { 1F4B } { 1F43 }
+        { 1F4C } { 1F44 }
+        { 1F4D } { 1F45 }
+        { 1F59 } { 1F51 }
+        { 1F5B } { 1F53 }
+        { 1F5D } { 1F55 }
+        { 1F5F } { 1F57 }
+        { 1F68 } { 1F60 }
+        { 1F69 } { 1F61 }
+        { 1F6A } { 1F62 }
+        { 1F6B } { 1F63 }
+        { 1F6C } { 1F64 }
+        { 1F6D } { 1F65 }
+        { 1F6E } { 1F66 }
+        { 1F6F } { 1F67 }
+        { 1FBA } { 1F70 }
+        { 1FBB } { 1F71 }
+        { 1FC8 } { 1F72 }
+        { 1FC9 } { 1F73 }
+        { 1FCA } { 1F74 }
+        { 1FCB } { 1F75 }
+        { 1FDA } { 1F76 }
+        { 1FDB } { 1F77 }
+        { 1FF8 } { 1F78 }
+        { 1FF9 } { 1F79 }
+        { 1FEA } { 1F7A }
+        { 1FEB } { 1F7B }
+        { 1FFA } { 1F7C }
+        { 1FFB } { 1F7D }
+        { 1F88 } { 1F80 }
+        { 1F89 } { 1F81 }
+        { 1F8A } { 1F82 }
+        { 1F8B } { 1F83 }
+        { 1F8C } { 1F84 }
+        { 1F8D } { 1F85 }
+        { 1F8E } { 1F86 }
+        { 1F8F } { 1F87 }
+        { 1F98 } { 1F90 }
+        { 1F99 } { 1F91 }
+        { 1F9A } { 1F92 }
+        { 1F9B } { 1F93 }
+        { 1F9C } { 1F94 }
+        { 1F9D } { 1F95 }
+        { 1F9E } { 1F96 }
+        { 1F9F } { 1F97 }
+        { 1FA8 } { 1FA0 }
+        { 1FA9 } { 1FA1 }
+        { 1FAA } { 1FA2 }
+        { 1FAB } { 1FA3 }
+        { 1FAC } { 1FA4 }
+        { 1FAD } { 1FA5 }
+        { 1FAE } { 1FA6 }
+        { 1FAF } { 1FA7 }
+        { 1FB8 } { 1FB0 }
+        { 1FB9 } { 1FB1 }
+        { 1FBC } { 1FB3 }
+        { 1FCC } { 1FC3 }
+        { 1FD8 } { 1FD0 }
+        { 1FD9 } { 1FD1 }
+        { 1FE8 } { 1FE0 }
+        { 1FE9 } { 1FE1 }
+        { 1FEC } { 1FE5 }
+        { 1FFC } { 1FF3 }
+        \q_recursion_tail ?
+        \q_recursion_stop
+%    \begin{macrocode}
+% One three-octet special case for Greek: it also moves to two-octets!
+%    \end{macrocode}
+      \cs_set_protected:Npn \@@_tmp:w #1#2#3
+        {
+          \group_begin:
+            \cs_set_protected:Npn \@@_tmp:w ##1##2##3##4##5##6##7##8
+              {
+                \tl_const:cx
+                  {
+                    c_@@_ #3 case_
+                    \char_generate:nn {##1} { 12 }
+                    \char_generate:nn {##2} { 12 }
+                    \char_generate:nn {##3} { 12 }
+                    _tl
+                  }
+                  {
+                    \exp_after:wN \exp_after:wN \exp_after:wN
+                      \exp_not:N \char_generate:nn {##5} { 13 }
+                    \exp_after:wN \exp_after:wN \exp_after:wN
+                      \exp_not:N \char_generate:nn {##6} { 13 }
+                  }
+              }
+            \use:x
+              {
+                \@@_tmp:w
+                  \char_to_utfviii_bytes:n { "#1 }
+                  \char_to_utfviii_bytes:n { "#2 }
+              }
+          \group_end:
+        }
+    \@@_tmp:w { 1FBE } { 0399 } { upper }
+  }
+\group_end:
 %    \end{macrocode}
 %
 % The (fixed) look-up mappings for letter-like control sequences.





More information about the latex3-commits mailing list.