[latex3-commits] [git/LaTeX3-latex3-latex3] main: Medieval Latin support in case changing (e18d6883a)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 29 12:43:03 CEST 2022


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

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

commit e18d6883aeede494a5e265a658a3bb31e217a0d6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 29 12:43:03 2022 +0200

    Medieval Latin support in case changing


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

e18d6883aeede494a5e265a658a3bb31e217a0d6
 l3kernel/CHANGELOG.md                   |  1 +
 l3kernel/l3text-case.dtx                | 34 +++++++++++++++++++++++++++++++++
 l3kernel/l3text.dtx                     |  2 ++
 l3kernel/testfiles/m3text002.luatex.tlg | 32 +++++++++++++++++++------------
 l3kernel/testfiles/m3text002.lvt        |  9 +++++++++
 l3kernel/testfiles/m3text002.tlg        | 32 +++++++++++++++++++------------
 l3kernel/testfiles/m3text002.uptex.tlg  | 32 +++++++++++++++++++------------
 l3kernel/testfiles/m3text002.xetex.tlg  | 32 +++++++++++++++++++------------
 8 files changed, 126 insertions(+), 48 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index e35ecb6d5..41623263a 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
   [\#1123](https://github.com/latex3/latex3/issues/1123))
 - `\text_map_function:nN` and `\text_map_inline:nn` for mapping to
   graphemes in textual input
+- Support for medevial Latin case changing
 
 ## [2022-08-23]
 
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index 765a35166..4c62eef9d 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -1435,6 +1435,40 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[EXP]{\@@_change_case_lower_la-x-medieval:nnnN}
+% \begin{macro}[EXP]{\@@_change_case_upper_la-x-medieval:nnnN}
+%   Simply swaps of characters.
+%    \begin{macrocode}
+\cs_new:cpn { @@_change_case_lower_la-x-medieval:nnnN } #1#2#3#4
+  {
+    \int_compare:nNnTF { `#4 } = { `V }
+      {
+        \@@_change_case_store:e
+          {
+            \char_generate:nn { `u } { \@@_char_catcode:N #4 }
+          }
+        \use:c { @@_change_case_char_next_ #2 :nn }
+          {#2} {#3}
+      }
+      { \@@_change_case_char:nnnN {#1} {#2} {#3} #4 }
+  }
+\cs_new:cpn { @@_change_case_upper_la-x-medieval:nnnN } #1#2#3#4
+  {
+    \int_compare:nNnTF { `#4 } = { `u }
+      {
+        \@@_change_case_store:e
+          {
+            \char_generate:nn { `V } { \@@_char_catcode:N #4 }
+          }
+        \use:c { @@_change_case_char_next_ #2 :nn }
+          {#2} {#3}
+      }
+      { \@@_change_case_char:nnnN {#1} {#2} {#3} #4 }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}[EXP]
 %   {
 %     \@@_change_cases_lower_lt:nnnN      ,
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 1f0ba4496..9379642d3 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -184,6 +184,8 @@
 %       combining dot is removed when uppercasing in these cases. Note that
 %       \emph{only} the accents used in Lithuanian are covered: the behaviour
 %       of other accents are not modified.
+%     \item Medieval Latin (\texttt{la-xmedieval}).
+%      The characters |u| and |V| are interchanged on case changing.
 %     \item Dutch (\texttt{nl}).
 %       Capitalisation of \texttt{ij} at the beginning of titlecased
 %       input produces \texttt{IJ} rather than \texttt{Ij}. The output
diff --git a/l3kernel/testfiles/m3text002.luatex.tlg b/l3kernel/testfiles/m3text002.luatex.tlg
index 5cc130a16..cc417fb98 100644
--- a/l3kernel/testfiles/m3text002.luatex.tlg
+++ b/l3kernel/testfiles/m3text002.luatex.tlg
@@ -218,7 +218,15 @@ Ìi̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 İ̀i̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ============================================================
 ============================================================
-TEST 19: Dutch
+TEST 19: Medieval Latin
+============================================================
+lupus
+lvpvs
+LVPVS
+LUPUS
+============================================================
+============================================================
+TEST 20: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -234,13 +242,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 20: Titlecase exceptions
+TEST 21: Titlecase exceptions
 ============================================================
 Ssoo
 Dž!
 ============================================================
 ============================================================
-TEST 21: Case changing braced arguments
+TEST 22: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -252,7 +260,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 22: Expanding content
+TEST 23: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -280,7 +288,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 23: Math-mode escape
+TEST 24: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -296,7 +304,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 24: Nesting
+TEST 25: Nesting
 ============================================================
 HELLO
 hello
@@ -304,7 +312,7 @@ FUSSBALL
 ὈΔΥΣΣΕΎΣ
 ============================================================
 ============================================================
-TEST 25: Letter-like commands
+TEST 26: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -312,7 +320,7 @@ TEST 25: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 26: Accents
+TEST 27: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -320,7 +328,7 @@ TEST 26: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 27: Active chars
+TEST 28: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -328,7 +336,7 @@ TEST 27: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 28: Case changing exclusions
+TEST 29: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -339,7 +347,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 29: Case change switching
+TEST 30: Case change switching
 ============================================================
 lower
 UPPER
@@ -349,7 +357,7 @@ words UPPER
 Words UPPER
 ============================================================
 ============================================================
-TEST 30: Case change replacements
+TEST 31: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.
diff --git a/l3kernel/testfiles/m3text002.lvt b/l3kernel/testfiles/m3text002.lvt
index 838c69e89..cc5048a39 100644
--- a/l3kernel/testfiles/m3text002.lvt
+++ b/l3kernel/testfiles/m3text002.lvt
@@ -243,6 +243,15 @@
     \exp_args:NV  \text_titlecase:n         \l_tmpb_tl
   }
 
+\TESTEXP { Medieval~Latin }
+  {
+    \text_lowercase:nn { la-x-medieval } { LVPVS } \NEWLINE
+    \text_lowercase:n                    { LVPVS }
+    \NEWLINE
+    \text_uppercase:nn { la-x-medieval } { lupus } \NEWLINE
+    \text_uppercase:n                    { lupus }
+  }
+
 \TESTEXP { Dutch }
   {
     \text_lowercase:nn { nl } { IJSSELMEER } \NEWLINE
diff --git a/l3kernel/testfiles/m3text002.tlg b/l3kernel/testfiles/m3text002.tlg
index 0aab0a612..fa954f522 100644
--- a/l3kernel/testfiles/m3text002.tlg
+++ b/l3kernel/testfiles/m3text002.tlg
@@ -214,7 +214,15 @@ TEST 18: Lithuanian
 ^^c3^^8c^^c3^^ad^^c4^^a9
 ============================================================
 ============================================================
-TEST 19: Dutch
+TEST 19: Medieval Latin
+============================================================
+lupus
+lvpvs
+LVPVS
+LUPUS
+============================================================
+============================================================
+TEST 20: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -230,13 +238,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 20: Titlecase exceptions
+TEST 21: Titlecase exceptions
 ============================================================
 Ssoo
 ^^c7^^85!
 ============================================================
 ============================================================
-TEST 21: Case changing braced arguments
+TEST 22: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -248,7 +256,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 22: Expanding content
+TEST 23: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -276,7 +284,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 23: Math-mode escape
+TEST 24: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -292,7 +300,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 24: Nesting
+TEST 25: Nesting
 ============================================================
 HELLO
 hello
@@ -300,7 +308,7 @@ FUSSBALL
 ^^e1^^bd^^88^^ce^^94^^ce^^a5^^ce^^a3^^ce^^a3^^ce^^95^^ce^^8e^^ce^^a3
 ============================================================
 ============================================================
-TEST 25: Letter-like commands
+TEST 26: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -308,7 +316,7 @@ TEST 25: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 26: Accents
+TEST 27: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -316,7 +324,7 @@ TEST 26: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 27: Active chars
+TEST 28: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -324,7 +332,7 @@ TEST 27: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 28: Case changing exclusions
+TEST 29: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -335,7 +343,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 29: Case change switching
+TEST 30: Case change switching
 ============================================================
 lower
 UPPER
@@ -345,7 +353,7 @@ words UPPER
 Words UPPER
 ============================================================
 ============================================================
-TEST 30: Case change replacements
+TEST 31: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.
diff --git a/l3kernel/testfiles/m3text002.uptex.tlg b/l3kernel/testfiles/m3text002.uptex.tlg
index 0c52fd590..b3d6b150a 100644
--- a/l3kernel/testfiles/m3text002.uptex.tlg
+++ b/l3kernel/testfiles/m3text002.uptex.tlg
@@ -214,7 +214,15 @@ TEST 18: Lithuanian
 ^^c3^^8c^^c3^^ad^^c4^^a9
 ============================================================
 ============================================================
-TEST 19: Dutch
+TEST 19: Medieval Latin
+============================================================
+lupus
+lvpvs
+LVPVS
+LUPUS
+============================================================
+============================================================
+TEST 20: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -230,13 +238,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 20: Titlecase exceptions
+TEST 21: Titlecase exceptions
 ============================================================
 Ssoo
 ^^c7^^85!
 ============================================================
 ============================================================
-TEST 21: Case changing braced arguments
+TEST 22: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -248,7 +256,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 22: Expanding content
+TEST 23: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -276,7 +284,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 23: Math-mode escape
+TEST 24: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -292,7 +300,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 24: Nesting
+TEST 25: Nesting
 ============================================================
 HELLO
 hello
@@ -300,7 +308,7 @@ FUSSBALL
 ^^e1^^bd^^88^^ce^^94^^ce^^a5^^ce^^a3^^ce^^a3^^ce^^95^^ce^^8e^^ce^^a3
 ============================================================
 ============================================================
-TEST 25: Letter-like commands
+TEST 26: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -308,7 +316,7 @@ TEST 25: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 26: Accents
+TEST 27: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -316,7 +324,7 @@ TEST 26: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 27: Active chars
+TEST 28: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -324,7 +332,7 @@ TEST 27: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 28: Case changing exclusions
+TEST 29: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -335,7 +343,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 29: Case change switching
+TEST 30: Case change switching
 ============================================================
 lower
 UPPER
@@ -345,7 +353,7 @@ words UPPER
 Words UPPER
 ============================================================
 ============================================================
-TEST 30: Case change replacements
+TEST 31: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.
diff --git a/l3kernel/testfiles/m3text002.xetex.tlg b/l3kernel/testfiles/m3text002.xetex.tlg
index 5cc130a16..cc417fb98 100644
--- a/l3kernel/testfiles/m3text002.xetex.tlg
+++ b/l3kernel/testfiles/m3text002.xetex.tlg
@@ -218,7 +218,15 @@ Ìi̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 İ̀i̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ============================================================
 ============================================================
-TEST 19: Dutch
+TEST 19: Medieval Latin
+============================================================
+lupus
+lvpvs
+LVPVS
+LUPUS
+============================================================
+============================================================
+TEST 20: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -234,13 +242,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 20: Titlecase exceptions
+TEST 21: Titlecase exceptions
 ============================================================
 Ssoo
 Dž!
 ============================================================
 ============================================================
-TEST 21: Case changing braced arguments
+TEST 22: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -252,7 +260,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 22: Expanding content
+TEST 23: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -280,7 +288,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 23: Math-mode escape
+TEST 24: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -296,7 +304,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 24: Nesting
+TEST 25: Nesting
 ============================================================
 HELLO
 hello
@@ -304,7 +312,7 @@ FUSSBALL
 ὈΔΥΣΣΕΎΣ
 ============================================================
 ============================================================
-TEST 25: Letter-like commands
+TEST 26: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -312,7 +320,7 @@ TEST 25: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 26: Accents
+TEST 27: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -320,7 +328,7 @@ TEST 26: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 27: Active chars
+TEST 28: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -328,7 +336,7 @@ TEST 27: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 28: Case changing exclusions
+TEST 29: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -339,7 +347,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 29: Case change switching
+TEST 30: Case change switching
 ============================================================
 lower
 UPPER
@@ -349,7 +357,7 @@ words UPPER
 Words UPPER
 ============================================================
 ============================================================
-TEST 30: Case change replacements
+TEST 31: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.





More information about the latex3-commits mailing list.