texlive[72254] Master/texmf-dist: fontscale (11sep24)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 11 22:25:40 CEST 2024


Revision: 72254
          https://tug.org/svn/texlive?view=revision&revision=72254
Author:   karl
Date:     2024-09-11 22:25:40 +0200 (Wed, 11 Sep 2024)
Log Message:
-----------
fontscale (11sep24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
    trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-09-11 20:25:40 UTC (rev 72254)
@@ -7,6 +7,13 @@
 
 ## [Unreleased]
 
+## [v2.4.0] - 2024-09-10
+
+### Changed
+- `\fontscalesetup` no longer issues a warning if the lengths of the font
+  baselineskips are not ordered from `\tiny` to `\Huge`.
+- Code improvements.
+
 ## [v2.3.0] - 2024-09-06
 
 ### Changed

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-09-11 20:25:40 UTC (rev 72254)
@@ -4,7 +4,7 @@
 \NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplClass
   {beery}
-  {2024-09-06}
+  {2024-09-10}
   {}
   {}
 

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	2024-09-11 20:25:40 UTC (rev 72254)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-classic.tex}
-  [2024-09-06]
+  [2024-09-10]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	2024-09-11 20:25:40 UTC (rev 72254)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-font-steps.tex}
-  [2024-09-06]
+  [2024-09-10]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	2024-09-11 20:25:40 UTC (rev 72254)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-musical.tex}
-  [2024-09-06]
+  [2024-09-10]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	2024-09-11 20:25:40 UTC (rev 72254)
@@ -14,7 +14,7 @@
 
 Oliver Beery
 
-Version 2.3.0\quad{}6 September 2024
+Version 2.4.0\quad{}10 September 2024
 
 
 \section{Introduction}
@@ -101,7 +101,7 @@
 
 This section documents the keys provided by the \pkg{fontscale} package.
 This package has no package options.
-Set the package keys using \cs{fontscalesetup}\marg{key-value list} (\S\ref{subsec:fontscalesetup}).
+Set the package keys using \cs{fontscalesetup}\marg{key\-/value list} (\S\ref{subsec:fontscalesetup}).
 
 \subsection{The typographic scale}
 \label{subsec:typographicscale}
@@ -181,7 +181,7 @@
 \KeepNextPar*
 
 Sets the font baselineskip of each font size command from \cs{tiny} to \cs{Huge} equal to its font size \texttimes{} the result of computing the \meta{floating point expression}.
-Sets the font baselineskip set by \cs{SetFontStep}, \cs{SetFontScale}, and \cs{SetFontSize} (\S\ref{subsec:fontsize}) equal to the new font size \texttimes{} the result of computing the \meta{floating point expression}.
+Sets the font baselineskip set by \cs{SetFontStep}, \cs{SetFontScale}, and \cs{SetFontSize} equal to the new font size \texttimes{} the result of computing the \meta{floating point expression} (\S\ref{subsec:fontsize}).
 
 
 \subsection{Overwriting the previous keys}
@@ -188,9 +188,10 @@
 \label{subsec:overwriting}
 
 This subsection documents keys for directly setting the font scales, font sizes, and font baselineskips of the font size commands from \cs{tiny} to \cs{Huge}.
-When doing so, the user should take care to ensure that the lengths of the font sizes and font baselineskips remain correctly ordered from \cs{tiny} to \cs{Huge}.
+
+The user should take care to ensure that the lengths of the font sizes remain correctly ordered from \cs{tiny} to \cs{Huge}.
 This is important for typographic and syntactic consistency.
-If the font size commands are in the wrong order, this package will issue a warning and some package features may not work correctly.
+If the font sizes are in the wrong order, \cs{fontscalesetup} will issue a warning and some package features may not work correctly.
 
 \Key{\meta{font size command}/scale}[\meta{floating point expression}][\meta{not set}]
 \KeepNextPar*
@@ -215,9 +216,12 @@
 \nopagebreak\newline
 \Key{\meta{font size command}}[\meta{dimen expression}/\meta{skip expression}]
 
-Sets the keys \Key{\meta{font size command}\slash{}size}[\meta{dimen expression}] or \Key{\meta{font size command}\slash{}baselineskip}[\meta{skip expression}] in a condensed format.
-The latter format resembles traditional typographic notation where the size and leading of a text can be expressed as, for example, \num{10}/\num{12} or \num{11}/\num{13}.
-The number before\slash{}after the slash is the size\slash{}leading in units of \unit{pt}.
+Sets the keys \Key{\meta{font size command}\slash{}size}[\meta{dimen expression}] or \Key{\meta{font size command}\slash{}baselineskip}[\meta{skip expression}] in a condensed format.%
+\footnote
+  {%
+    The latter format resembles traditional typographic notation where the size and leading of a text can be expressed as, for example, \num{10}/\num{12} or \num{11}/\num{13}.
+    The number before\slash{}after the slash is the size\slash{}leading in units of \unit{pt}.%
+  }
 
 
 \section{Commands}
@@ -271,7 +275,7 @@
 If so, expands to the name of that font size command.
 This omits the backslash character and leaves only letters with catcode \num{11}.
 If not, expands to nothing.
-This package also provides a similar command \cs{PrintFontSizeCommand} (\S\ref{subsec:debug}), which is not expandable and includes the backslash character.
+This package also provides a similar command \cs{PrintFontSizeCommand}, which is not expandable and includes the backslash character (\S\ref{subsec:debug}).
 
 \subsection{More font size commands}
 \label{subsec:fontsize}
@@ -362,7 +366,7 @@
 Prints \meta{text} in each font size ordered from \cs{tiny} to \cs{Huge} each followed by a paragraph break.
 \meta{text} can contain \cs{par} tokens.
 Adding the optional star reverses the order of the font sizes.
-One useful way of printing example text is \cs{PrintSampleText}\allowbreak\texttt{\{\cs{PrintFontSizeCommand}:\allowbreak\textvisiblespace\allowbreak\cs{PrintFontSizeParameters}\}}.
+One useful way of printing sample text is \cs{PrintSampleText}\allowbreak\texttt{\{\cs{PrintFontSizeCommand}:\allowbreak\textvisiblespace\allowbreak\cs{PrintFontSizeParameters}\}}.
 
 \cs{PrintFontSizeCommand}
 \KeepNextPar*
@@ -370,7 +374,7 @@
 Tests if the current font size and current font baselineskip equal the font size and font baselineskip, respectively, of any font size command from \cs{tiny} to \cs{Huge}.
 If so, prints the name of that font size command, including the backslash character.
 If not, prints \enquote{\string\undefined}.
-This package also provides a similar command \cs{CurrentFontSizeCommand} (\S\ref{subsec:expandable}), which is expandable and omits the backslash character.
+This package also provides a similar command \cs{CurrentFontSizeCommand}, which is expandable and omits the backslash character (\S\ref{subsec:expandable}).
 
 
 \section{Programming}

Modified: trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-09-10 23:41:58 UTC (rev 72253)
+++ trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-09-11 20:25:40 UTC (rev 72254)
@@ -8,8 +8,8 @@
 \NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplPackage
   {fontscale}
-  {2024-09-06}
-  {2.3.0}
+  {2024-09-10}
+  {2.4.0}
   {A flexible interface for setting font sizes}
 
 % l3kernel version 2023-10-10 added many 'e'-variants.
@@ -142,19 +142,12 @@
     \q_stop
   }
 \cs_generate_variant:Nn \__fontscale_skip_set_default_pt:Nn { c }
-% Similar to \@setfontsize. Used to define \tiny to \Huge. Need \dim_use:N for
-% compatibility with the microtype package.
+% Used to define \tiny to \Huge. Sets \@currsize only for compatibility. Need
+% \dim_use:N only for compatibility with the microtype package.
 \cs_new_protected:Npn \__fontscale_fontsize:NNN #1#2#3
   {
-    \mode_if_math:TF
-      {
-        \msg_warning:nne { fontscale } { math-mode-warning }
-          { \token_to_str:N #1 }
-      }
-      {
-        \cs_set_eq:NN \@currsize #1
-        \fontsize { \dim_use:N #2 } #3 \selectfont
-      }
+    \cs_set_eq:NN \@currsize #1
+    \fontsize { \dim_use:N #2 } #3 \selectfont
   }
 % Similar to \fontsize + \selectfont, except that it:
 % (1) Takes dimen and skip expressions as arguments.
@@ -238,20 +231,12 @@
     The~ font~ size~ set~ by~ the~ key~ '#1 / scale'~
     has~ been~ overwritten~ by~ the~ key~ '#1 / size'~ \msg_line_context:.
   }
-\msg_new:nnn { fontscale } { key-font-sizes-out-of-order }
+\msg_new:nnn { fontscale } { font-sizes-out-of-order }
   {
-    The~ font~ sizes~
-    are~ not~ in~ the~ correct~ order~ \msg_line_context:. \\
+    The~ font~ sizes~ are~ not~ in~ the~ correct~ order~ \msg_line_context:. \\
     The~ lengths~ of~ the~ font~ sizes~
     should~ be~ ordered~ from~ \iow_char:N \\tiny~ to~ \iow_char:N \\Huge.
   }
-\msg_new:nnn { fontscale } { key-font-baselineskips-out-of-order }
-  {
-    The~ font~ baselineskips~
-    are~ not~ in~ the~ correct~ order~ \msg_line_context:. \\
-    The~ lengths~ of~ the~ font~ baselineskips~
-    should~ be~ ordered~ from~ \iow_char:N \\tiny~ to~ \iow_char:N \\Huge.
-  }
 
 \msg_new:nnn { fontscale } { math-mode-warning }
   { '#1'~ does~ nothing~ if~ used~ in~ math~ mode~ \msg_line_context:. }
@@ -323,6 +308,14 @@
     , notes .int_set:N = \l__fontscale_musical_notes_int
     , notes .value_required:n = true
   }
+\keys_define:nn { fontscale / normalsize }
+  {
+      size .tl_set:N = \l__fontscale_normalsize_size_tl
+    , size .value_required:n = true
+
+    , baselineskip .tl_set:N = \l__fontscale_normalsize_baselineskip_tl
+    , baselineskip .value_required:n = true
+  }
 \keys_define:nn { fontscale / tiny }
   {
       scale .tl_set:N = \l__fontscale_tiny_scale_tl
@@ -367,14 +360,6 @@
     , baselineskip .tl_set:N = \l__fontscale_small_baselineskip_tl
     , baselineskip .value_required:n = true
   }
-\keys_define:nn { fontscale / normalsize }
-  {
-      size .tl_set:N = \l__fontscale_normalsize_size_tl
-    , size .value_required:n = true
-
-    , baselineskip .tl_set:N = \l__fontscale_normalsize_baselineskip_tl
-    , baselineskip .value_required:n = true
-  }
 \keys_define:nn { fontscale / large }
   {
       scale .tl_set:N = \l__fontscale_large_scale_tl
@@ -466,7 +451,8 @@
 % INITIALIZE AND PRE-COMPILE KEYS
 
 % Pre-compiles the keys with their initial values and then sets the keys to
-% their initial values. This is done by hand for speed.
+% their initial values. This is significantly faster than using .initial:n and
+% \keys_precompile:nnN.
 \cs_new_protected:Npn \__fontscale_keys_set_initial:
   {
     \fp_set:Nn  \l__fontscale_baselineskip_size_ratio_fp { 1.2 }
@@ -475,37 +461,41 @@
     \fp_set:Nn  \l__fontscale_musical_ratio_fp           { 2 }
     \int_set:Nn \l__fontscale_musical_notes_int          { 5 }
 
-    \tl_set:Nn \l__fontscale_tiny_scale_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_scriptsize_scale_tl   { \q_no_value }
-    \tl_set:Nn \l__fontscale_footnotesize_scale_tl { \q_no_value }
-    \tl_set:Nn \l__fontscale_small_scale_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_large_scale_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_Large_scale_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_LARGE_scale_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_huge_scale_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_Huge_scale_tl         { \q_no_value }
+    \tl_map_inline:nn
+      {
+        \l__fontscale_tiny_scale_tl
+        \l__fontscale_scriptsize_scale_tl
+        \l__fontscale_footnotesize_scale_tl
+        \l__fontscale_small_scale_tl
+        \l__fontscale_large_scale_tl
+        \l__fontscale_Large_scale_tl
+        \l__fontscale_LARGE_scale_tl
+        \l__fontscale_huge_scale_tl
+        \l__fontscale_Huge_scale_tl
 
-    \tl_set:Nn \l__fontscale_tiny_size_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_scriptsize_size_tl   { \q_no_value }
-    \tl_set:Nn \l__fontscale_footnotesize_size_tl { \q_no_value }
-    \tl_set:Nn \l__fontscale_small_size_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_normalsize_size_tl   { \q_no_value }
-    \tl_set:Nn \l__fontscale_large_size_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_Large_size_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_LARGE_size_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_huge_size_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_Huge_size_tl         { \q_no_value }
+        \l__fontscale_tiny_size_tl
+        \l__fontscale_scriptsize_size_tl
+        \l__fontscale_footnotesize_size_tl
+        \l__fontscale_small_size_tl
+        \l__fontscale_normalsize_size_tl
+        \l__fontscale_large_size_tl
+        \l__fontscale_Large_size_tl
+        \l__fontscale_LARGE_size_tl
+        \l__fontscale_huge_size_tl
+        \l__fontscale_Huge_size_tl
 
-    \tl_set:Nn \l__fontscale_tiny_baselineskip_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_scriptsize_baselineskip_tl   { \q_no_value }
-    \tl_set:Nn \l__fontscale_footnotesize_baselineskip_tl { \q_no_value }
-    \tl_set:Nn \l__fontscale_small_baselineskip_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_normalsize_baselineskip_tl   { \q_no_value }
-    \tl_set:Nn \l__fontscale_large_baselineskip_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_Large_baselineskip_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_LARGE_baselineskip_tl        { \q_no_value }
-    \tl_set:Nn \l__fontscale_huge_baselineskip_tl         { \q_no_value }
-    \tl_set:Nn \l__fontscale_Huge_baselineskip_tl         { \q_no_value }
+        \l__fontscale_tiny_baselineskip_tl
+        \l__fontscale_scriptsize_baselineskip_tl
+        \l__fontscale_footnotesize_baselineskip_tl
+        \l__fontscale_small_baselineskip_tl
+        \l__fontscale_normalsize_baselineskip_tl
+        \l__fontscale_large_baselineskip_tl
+        \l__fontscale_Large_baselineskip_tl
+        \l__fontscale_LARGE_baselineskip_tl
+        \l__fontscale_huge_baselineskip_tl
+        \l__fontscale_Huge_baselineskip_tl
+      }
+      { \tl_set:Nn ##1 { \q_no_value } }
   }
 \__fontscale_keys_set_initial:
 
@@ -766,8 +756,7 @@
           { \use:c { l__fontscale_#1_baselineskip_tl } }
       }
   }
-% Issues a warning if the font sizes or font baselineskips are not in the
-% correct order.
+% Issues a warning if the font sizes are not in the correct order.
 \cs_new_protected:Npn \__fontscale_keys_process_check_order:
   {
     \dim_compare:nF
@@ -783,74 +772,152 @@
         < \l_fontscale_huge_size_dim
         < \l_fontscale_Huge_size_dim
       }
-      { \msg_warning:nn { fontscale } { key-font-sizes-out-of-order } }
-    \dim_compare:nF
-      {
-          \l_fontscale_tiny_baselineskip_skip
-        < \l_fontscale_scriptsize_baselineskip_skip
-        < \l_fontscale_footnotesize_baselineskip_skip
-        < \l_fontscale_small_baselineskip_skip
-        < \l_fontscale_normalsize_baselineskip_skip
-        < \l_fontscale_large_baselineskip_skip
-        < \l_fontscale_Large_baselineskip_skip
-        < \l_fontscale_LARGE_baselineskip_skip
-        < \l_fontscale_huge_baselineskip_skip
-        < \l_fontscale_Huge_baselineskip_skip
-      }
-      { \msg_warning:nn { fontscale } { key-font-baselineskips-out-of-order } }
+      { \msg_warning:nn { fontscale } { font-sizes-out-of-order } }
   }
 
 % DOCUMENT COMMANDS
 
 % Defines the standard LaTeX font size commands from \tiny to \Huge and
-% initializes to \normalsize.
+% initializes to \normalsize. The corresponding internal functions are not used
+% elsewhere in the code for compatibility with hooks such as
+% \AddToHook{cmd/<font size command>/after}{<code>}.
 \DeclareDocumentCommand \tiny { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \tiny }
+      }
+      { \__fontscale_tiny: }
+  }
+\cs_new_protected:Npn \__fontscale_tiny:
+  {
     \__fontscale_fontsize:NNN \tiny \l_fontscale_tiny_size_dim
       \l_fontscale_tiny_baselineskip_skip
   }
 \DeclareDocumentCommand \scriptsize { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \scriptsize }
+      }
+      { \__fontscale_scriptsize: }
+  }
+\cs_new_protected:Npn \__fontscale_scriptsize:
+  {
     \__fontscale_fontsize:NNN \scriptsize \l_fontscale_scriptsize_size_dim
       \l_fontscale_scriptsize_baselineskip_skip
   }
 \DeclareDocumentCommand \footnotesize { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \footnotesize }
+      }
+      { \__fontscale_footnotesize: }
+  }
+\cs_new_protected:Npn \__fontscale_footnotesize:
+  {
     \__fontscale_fontsize:NNN \footnotesize \l_fontscale_footnotesize_size_dim
       \l_fontscale_footnotesize_baselineskip_skip
   }
 \DeclareDocumentCommand \small { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \small }
+      }
+      { \__fontscale_small: }
+  }
+\cs_new_protected:Npn \__fontscale_small:
+  {
     \__fontscale_fontsize:NNN \small \l_fontscale_small_size_dim
       \l_fontscale_small_baselineskip_skip
   }
 \DeclareDocumentCommand \normalsize { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \normalsize }
+      }
+      { \__fontscale_normalsize: }
+  }
+\cs_new_protected:Npn \__fontscale_normalsize:
+  {
     \__fontscale_fontsize:NNN \normalsize \l_fontscale_normalsize_size_dim
       \l_fontscale_normalsize_baselineskip_skip
   }
 \DeclareDocumentCommand \large { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \large }
+      }
+      { \__fontscale_large: }
+  }
+\cs_new_protected:Npn \__fontscale_large:
+  {
     \__fontscale_fontsize:NNN \large \l_fontscale_large_size_dim
       \l_fontscale_large_baselineskip_skip
   }
 \DeclareDocumentCommand \Large { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \Large }
+      }
+      { \__fontscale_Large: }
+  }
+\cs_new_protected:Npn \__fontscale_Large:
+  {
     \__fontscale_fontsize:NNN \Large \l_fontscale_Large_size_dim
       \l_fontscale_Large_baselineskip_skip
   }
 \DeclareDocumentCommand \LARGE { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \LARGE }
+      }
+      { \__fontscale_LARGE: }
+  }
+\cs_new_protected:Npn \__fontscale_LARGE:
+  {
     \__fontscale_fontsize:NNN \LARGE \l_fontscale_LARGE_size_dim
       \l_fontscale_LARGE_baselineskip_skip
   }
 \DeclareDocumentCommand \huge { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \huge }
+      }
+      { \__fontscale_huge: }
+  }
+\cs_new_protected:Npn \__fontscale_huge:
+  {
     \__fontscale_fontsize:NNN \huge \l_fontscale_huge_size_dim
       \l_fontscale_huge_baselineskip_skip
   }
 \DeclareDocumentCommand \Huge { }
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \Huge }
+      }
+      { \__fontscale_Huge: }
+  }
+\cs_new_protected:Npn \__fontscale_Huge:
+  {
     \__fontscale_fontsize:NNN \Huge \l_fontscale_Huge_size_dim
       \l_fontscale_Huge_baselineskip_skip
   }
@@ -1139,11 +1206,11 @@
       }
       {
         \token_to_str:c {##1} \@ \c_colon_str \c_space_tl
-        step ~=~ \fp_use:c { c_fontscale_##1_step_fp } ,~
-        scale ~=~ \str_if_eq:nnTF {##1} { normalsize }
+        step~ =~ \fp_use:c { c_fontscale_##1_step_fp } ,~
+        scale~ =~ \str_if_eq:nnTF {##1} { normalsize }
           { 1 } { \fp_use:c { l_fontscale_##1_scale_fp } } ,~
-        size ~=~ \dim_use:c { l_fontscale_##1_size_dim } ,~
-        baselineskip ~=~ \skip_use:c { l_fontscale_##1_baselineskip_skip }
+        size~ =~ \dim_use:c { l_fontscale_##1_size_dim } ,~
+        baselineskip~ =~ \skip_use:c { l_fontscale_##1_baselineskip_skip }
         \str_if_eq:nnF {##1} { Huge } { \newline }
       }
   }
@@ -1201,25 +1268,12 @@
 
 % TEXT PURIFY
 
-\cs_new:Npn \__fontscale_remove_arg_spec_sm:n #1
+\NewExpandableDocumentCommand \__fontscale_use_none_sm:w { s m } { }
+\tl_map_inline:nn
   {
-    \bool_lazy_all:nT
-      {
-        { \tl_if_single_p:n {#1} }
-        { \tl_if_single_token_p:n #1 }
-        { \token_if_eq_meaning_p:NN #1 * }
-      }
-      { \use_none:n }
+    \fontscalesetup \SetFontStep \SetFontScale \SetFontSize
+    \SetFontBaselineskip
   }
-\text_declare_purify_equivalent:Nn \fontscalesetup
-  { \__fontscale_remove_arg_spec_sm:n }
-\text_declare_purify_equivalent:Nn \SetFontStep
-  { \__fontscale_remove_arg_spec_sm:n }
-\text_declare_purify_equivalent:Nn \SetFontScale
-  { \__fontscale_remove_arg_spec_sm:n }
-\text_declare_purify_equivalent:Nn \SetFontSize
-  { \__fontscale_remove_arg_spec_sm:n }
+  { \text_declare_purify_equivalent:Nn #1 { \__fontscale_use_none_sm:w } }
 \text_declare_purify_equivalent:Nn \ScaleFont { \use_none:n }
-\text_declare_purify_equivalent:Nn \SetFontSizeBaselineskip { \use_none:nn }
-\text_declare_purify_equivalent:Nn \SetFontBaselineskip
-  { \__fontscale_remove_arg_spec_sm:n }
\ No newline at end of file
+\text_declare_purify_equivalent:Nn \SetFontSizeBaselineskip { \use_none:nn }
\ No newline at end of file



More information about the tex-live-commits mailing list.