[latex3-commits] [latex3/latex3] gh1595: Add \sys_if_engine_opentype:TF (1b0d0ba2b)
github at latex-project.org
github at latex-project.org
Wed Nov 6 08:06:24 CET 2024
Repository : https://github.com/latex3/latex3
On branch : gh1595
Link : https://github.com/latex3/latex3/commit/1b0d0ba2b6b1d884a20d74ade62276b143929016
>---------------------------------------------------------------
commit 1b0d0ba2b6b1d884a20d74ade62276b143929016
Author: Joseph Wright <joseph at texdev.net>
Date: Wed Nov 6 07:06:24 2024 +0000
Add \sys_if_engine_opentype:TF
>---------------------------------------------------------------
1b0d0ba2b6b1d884a20d74ade62276b143929016
l3kernel/CHANGELOG.md | 3 +++
l3kernel/l3cctab.dtx | 6 ++----
l3kernel/l3doc.dtx | 3 +--
l3kernel/l3str-convert.dtx | 4 +---
l3kernel/l3sys.dtx | 22 ++++++++++++++++++++++
l3kernel/l3text-case.dtx | 8 ++------
l3kernel/l3text.dtx | 8 ++------
l3kernel/l3unicode.dtx | 8 ++------
l3kernel/testfiles/m3text006.lvt | 4 +---
9 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 80629d5ef..43fd6e351 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Added
+- `\sys_if_engine_opentype:(TF)`
+
## [2024-11-02]
### Added
diff --git a/l3kernel/l3cctab.dtx b/l3kernel/l3cctab.dtx
index 53db15109..476d15623 100644
--- a/l3kernel/l3cctab.dtx
+++ b/l3kernel/l3cctab.dtx
@@ -866,8 +866,7 @@
\group_begin:
\int_set:Nn \tex_endlinechar:D { 32 }
\char_set_catcode_invalid:n { 0 }
- \bool_lazy_or:nnTF
- { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: }
+ \sys_if_engine_opentype:TF
{ \int_step_function:nN { 31 } \char_set_catcode_invalid:n }
{ \int_step_function:nN { 31 } \char_set_catcode_active:n }
\int_step_function:nnN { 33 } { 64 } \char_set_catcode_other:n
@@ -892,8 +891,7 @@
\char_set_catcode_group_end:n { 125 } % right brace
\char_set_catcode_space:n { 126 } % tilde
\char_set_catcode_invalid:n { 127 } % ^^?
- \bool_lazy_or:nnF
- { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: }
+ \sys_if_engine_opentype:F
{ \int_step_function:nnN { 128 } { 255 } \char_set_catcode_active:n }
\@@_gset:n { \c_code_cctab }
\group_end:
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 1f7a29efa..61c67870a 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1531,8 +1531,7 @@ and all files in that bundle must be distributed together.
% \begin{macrocode}
\bool_if:NT \g_@@_lmodern_bool
{
- \bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }{ \sys_if_engine_xetex_p: }
+ \sys_if_engine_opentype:TF
{
\group_begin:
\ttfamily
diff --git a/l3kernel/l3str-convert.dtx b/l3kernel/l3str-convert.dtx
index 1976b092b..2cc2b7441 100644
--- a/l3kernel/l3str-convert.dtx
+++ b/l3kernel/l3str-convert.dtx
@@ -2624,9 +2624,7 @@
\exp_args:Ne \tl_to_str:n
{ \str_map_function:nN {#1} \@@_convert_pdfname:n }
}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+ \sys_if_engine_opentype:TF
{
\cs_new:Npn \@@_convert_pdfname:n #1
{
diff --git a/l3kernel/l3sys.dtx b/l3kernel/l3sys.dtx
index 4a600987d..ec9b7d297 100644
--- a/l3kernel/l3sys.dtx
+++ b/l3kernel/l3sys.dtx
@@ -107,6 +107,16 @@
% |\sys_if_engine_ptex_p:| is true for \epTeX{} but false for \eupTeX{}.
% \end{function}
%
+% \begin{function}[added = 2024-11-05, EXP, pTF]{\sys_if_engine_opentype:}
+% \begin{syntax}
+% \cs{sys_if_engine_opentype_p:}
+% \cs{sys_if_engine_opentype:TF} \Arg{true code} \Arg{false code}
+% \end{syntax}
+% Conditional which allows functionality-specific code to be used.
+% The test is true for engines which can use OpenType fonts and
+% thus full Unicode typesetting: currently \XeTeX{} and \LuaTeX{}.
+% \end{function}
+%
% \begin{variable}[added = 2015-09-19]{\c_sys_engine_str}
% The current engine given as a lower case string: one of
% |luatex|, |pdftex|, |ptex|, |uptex| or |xetex|.
@@ -514,6 +524,18 @@
% \end{variable}
% \end{macro}
%
+% \begin{variable}[pTF]{\sys_if_engine_opentype:}
+% \begin{macrocode}
+\@@_const:nn
+ { sys_if_engine_opentype }
+ {
+ \bool_lazy_or_p:nn
+ { \sys_if_engine_luatex_p: }
+ { \sys_if_engine_xetex_p: }
+ }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\c_sys_engine_exec_str,\c_sys_engine_format_str}
% Take the functions defined above, and set up the engine and format
% names. \cs{c_sys_engine_exec_str} differs from \cs{c_sys_engine_str}
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index a9847bf90..53c81127e 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -801,9 +801,7 @@
% the standard catcode. If neither are true, we set as 13 on the grounds that
% this will be what is used anyway!
% \begin{macrocode}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\sys_if_engine_opentype:TF
{
\cs_new:Npn \@@_change_case_catcode:nn #1#2
{ \@@_char_catcode:N #1 }
@@ -2319,9 +2317,7 @@
% A few adjustments to case mapping for combining chars: these are not needed
% for the Unicode engines
% \begin{macrocode}
-\bool_lazy_or:nnF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\sys_if_engine_opentype:F
{
\text_declare_uppercase_mapping:nn { "01F0 } { \v { J } }
}
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 559bc158a..d827f4f64 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -654,9 +654,7 @@
% Grab a codepoint and apply some code to it: here |#1| should expect one
% following \emph{balanced text}.
% \begin{macrocode}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\sys_if_engine_opentype:TF
{
\cs_new:Npn \@@_codepoint_process:nN #1#2 { #1 {#2} }
}
@@ -710,9 +708,7 @@
% Allows comparison for all engines using a first \enquote{character} followed
% by a codepoint.
% \begin{macrocode}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\sys_if_engine_opentype:TF
{
\prg_new_conditional:Npnn
\@@_codepoint_compare:nNn #1#2#3 { TF , p }
diff --git a/l3kernel/l3unicode.dtx b/l3kernel/l3unicode.dtx
index 570899280..dae62c5d9 100644
--- a/l3kernel/l3unicode.dtx
+++ b/l3kernel/l3unicode.dtx
@@ -162,9 +162,7 @@
% can generate character tokens for document use: those are defined below,
% in the data recovery setup.
% \begin{macrocode}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\sys_if_engine_opentype:TF
{
\cs_new:Npn \codepoint_str_generate:n #1
{
@@ -390,9 +388,7 @@
{ \exp_args:Ne \@@_to_nfd:n { \int_eval:n {#1} } }
\cs_new:Npn \@@_to_nfd:n #1
{ \@@_to_nfd:nn {#1} { \char_value_catcode:n {#1} } }
-\bool_lazy_or:nnF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+ \sys_if_engine_opentype:F
{
\cs_gset:Npn \@@_to_nfd:n #1
{
diff --git a/l3kernel/testfiles/m3text006.lvt b/l3kernel/testfiles/m3text006.lvt
index 8b12cb315..8dd2dfeeb 100644
--- a/l3kernel/testfiles/m3text006.lvt
+++ b/l3kernel/testfiles/m3text006.lvt
@@ -113,9 +113,7 @@
}
}
\cs_set:Npn \test_auxvii:n #1 { (#1) }
- \bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+ \sys_if_engine_opentype:TF
{
\cs_set:Npn \test_generate:n #1
{
More information about the latex3-commits
mailing list.