texlive[71965] Master/texmf-dist: fontscale (3aug24)

commits+karl at tug.org commits+karl at tug.org
Sat Aug 3 22:28:46 CEST 2024


Revision: 71965
          https://tug.org/svn/texlive?view=revision&revision=71965
Author:   karl
Date:     2024-08-03 22:28:46 +0200 (Sat, 03 Aug 2024)
Log Message:
-----------
fontscale (3aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/fontscale/README.txt
    trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
    trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty

Added Paths:
-----------
    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

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-classic.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-font-steps.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-modular-musical.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.pdf
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-08-03 20:28:46 UTC (rev 71965)
@@ -7,6 +7,50 @@
 
 ## [Unreleased]
 
+## [v2.0.0] - 2024-08-02
+
+### Changed
+- This update includes many changes that are backwards incompatible.
+- The documentation has been completely rewritten.
+- Package description changed from "A user interface for setting document font
+  sizes" to "A flexible interface for setting font sizes".
+- The code no longer uses `\@setfontsize`.
+- The font size commands provided by this package now do nothing, except issue
+  a warning, if used in math mode.
+- The base font size of the musical typographic scale is now set by the new key
+  `musical/base`.
+- `\PrintFontParameters` renamed to `\PrintFontSizeParameters`.
+- `\PrintAllFontParameters` renamed to `\PrintAllFontSizeParameters`.
+- `\PrintSampleText` uses a `+m`- instead of an `O`-type argument.
+- `\PrintFontSizeCommand` prints `\undefined` instead of `UNDEFINED`.
+- `\fontscalesetup` is now removed in `\text_purify:n`.
+
+### Removed
+- Keys `typographic-scale=modular` and `modular`.
+- Key `ignore-order` (no support for using `\tiny` to `\Huge` in the wrong
+  order).
+- Key `reset` (very rarely used).
+- Public `prop` variables for each font size command from `\tiny` to `\Huge`.
+  (They are redundant with the other public variables and programmers will very
+  likely prefer using their own `prop` variables.)
+
+### Added
+- `\fontscalesetup` now has an optional starred argument which first resets the
+  keys to their initial values.
+- Key `musical/base` (explained earlier).
+- The package commands now issue a user-friendly error message if the font size
+  is a zero or negative length.
+- The package commands now issue an error if the font baselineskip is less than
+  the font size.
+- The package commands that would produce a low-level error if used in math
+  mode now issue a user-friendly error message instead.
+
+### Fixed
+- Now correctly checks that the package requires `LaTeX2e` version 2023-11-01
+  or newer.
+- The keys `<font size command>` no longer incorrectly treat a `/` within a
+  brace group as the delimiter.
+
 ## [v1.3.0] - 2024-05-17
 
 ### Added
@@ -18,7 +62,7 @@
 ### Changed
 - The code now regularly uses `V`- and `v`-type arguments to get the value of a
   variable.
-- The code now uses private `expl3` wrappers around the LaTeX2e commands
+- The code now uses private `expl3` wrappers around the `LaTeX2e` commands
   `\@setfontsize`, `\fontsize`, and `\selectfont`.
 
 ## [v1.2.2] - 2024-04-29

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/README.txt	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/README.txt	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,4 +1,4 @@
-Package: fontscale -- A user interface for setting document font sizes
+Package: fontscale -- A flexible interface for setting font sizes
 Copyright: 2024 (c) Oliver Beery <beeryoliver at gmail.com>
 CTAN: https://ctan.org/pkg/fontscale
 Repository: https://github.com/beeryoliver/fontscale

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,71 +1,83 @@
-% Note: This documentclass is designed ONLY for the document 'fontscale-manual'. Compiled using LuaLaTeX.
+% Note: This class is designed ONLY for 'fontscale.tex'. Compiled with LuaTeX.
 
-% The 2023-06-01 LaTeX kernel update added the 'shipout' hook.
-\NeedsTeXFormat{LaTeX2e}[2023-06-01]
+% LaTeX2e version 2023-11-01 added \IfExplAtLeastTF.
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplClass
   {beery}
-  {2024-04-21}
+  {2024-08-02}
   {}
   {}
 
-\RequirePackage { fix-cm }
 \LoadClass { article }
+
+\box_new:N \l__beery_tmp_box
+
 \RequirePackage { fontscale }
 \fontscalesetup { musical }
-\RequirePackage [ list-final-separator = { ,~ and~ } ] { siunitx }
+\RequirePackage { siunitx }
+\sisetup { list-final-separator = { ,~ and~ } , mode = match }
 \RequirePackage { mathtools }
 \RequirePackage [ shortcuts , allowbreakbefore ] { extdash }
 \RequirePackage { csquotes }
+\RequirePackage { lmodern }
 
 % CUSTOM MACROS
 
+\NewExpandableDocumentCommand \alphabet { } { abcdefghijklmnopqrstuvwxyz }
 \NewDocumentCommand \Key { m o o }
   {
+    \mode_leave_vertical:
     \group_begin:
       \ttfamily
-      \bool_case:nF
+      \IfNoValueTF {#3}
         {
-          {
-            \bool_lazy_and_p:nn
-              { \tl_if_novalue_p:n {#2} }
-              { \tl_if_novalue_p:n {#3} }
-          }
-          {#1}
-          {
-            \bool_lazy_and_p:nn
-              { ! \tl_if_novalue_p:n {#2} }
-              {   \tl_if_novalue_p:n {#3} }
-          }
-          { #1~ =~ #2 }
-          {
-            \bool_lazy_and_p:nn
-              { ! \tl_if_novalue_p:n {#2} }
-              { ! \tl_if_novalue_p:n {#3} }
-          }
-          { #1~ =~ #2 \hspace* { \fill } \makebox { initial~ =~ #3 } }
+          \IfNoValueTF {#2}
+            {#1}
+            { #1 $\,=\,$ \allowbreak #2 }
         }
-        { \errmessage { invalid } }
+        { #1 $\,=\,$ #2 \hspace* { \fill } \hbox:n { initial $\,=\,$ #3 } }
     \group_end:
   }
+\NewDocumentCommand \Value { m } { \texttt {#1} }
 \NewDocumentCommand \cmd { m } { \texttt { \token_to_str:N #1 } \@ }
 \NewDocumentCommand \cs { m } { \texttt { \token_to_str:c {#1} } \@ }
 \NewDocumentCommand \marg { m }
-  { \allowbreak \texttt { \c_left_brace_str #1 \c_right_brace_str } }
-\NewDocumentCommand \oarg { m } { \allowbreak \texttt { [ #1 ] } }
-\NewDocumentCommand \meta { m } { \texttt { \textlangle #1 \textrangle } }
+  {
+    \allowbreak
+    \texttt { \c_left_brace_str }
+    $\langle$
+    { \normalfont \itshape #1 }
+    $\rangle$
+    \texttt { \c_right_brace_str }
+  }
+\NewDocumentCommand \oarg { m }
+  {
+    \allowbreak
+    \texttt { [ }
+    $\langle$
+    { \normalfont \itshape #1 }
+    $\rangle$
+    \texttt { ] }
+  }
+\NewDocumentCommand \sarg { } { $\langle$ \texttt {*} $\rangle$ }
+\NewDocumentCommand \meta { m }
+  {
+    $\langle$
+    { \normalfont \itshape #1 }
+    $\rangle$
+  }
 \NewDocumentCommand \cls { m } { \textsf {#1} }
 \NewDocumentCommand \env { m } { \texttt {#1} }
 \NewDocumentCommand \pkg { m } { \textsf {#1} }
-\NewDocumentCommand \filex { m } { \texttt {#1} \@ }
 \NewDocumentCommand \latin { m } { \textit {#1} }
 
 % PAGE STYLE
 
-\hbox_set:Nn \l_tmpa_box { abcdefghijklmnopqrstuvwxyz }
-\dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l_tmpa_box }
+\hbox_set:Nn \l__beery_tmp_box { abcdefghijklmnopqrstuvwxyz }
+\dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l__beery_tmp_box }
+\dim_log:N \c_beery_alphabet_dim
 
-\dim_const:Nn \c_beery_big_dim
-  { \fp_to_dim:n { \l_fontscale_normalsize_size_dim * 10 / 7 } }
+\dim_const:Nn \c_beery_big_dim { \l_fontscale_normalsize_baselineskip_skip }
 \dim_const:Nn \c_beery_medium_dim { \c_beery_big_dim / 2 }
 \dim_const:Nn \c_beery_small_dim  { \c_beery_big_dim / 4 }
 \skip_const:Nn \c_beery_big_skip
@@ -85,12 +97,15 @@
 
 \skip_set:Nn \topskip { \l_fontscale_normalsize_size_dim }
 \skip_set_eq:NN \splittopskip \topskip
-\RequirePackage
-  [
-      letterpaper
-    , textwidth = \dim_eval:n { \fp_use:N \c_e_fp \c_beery_alphabet_dim }
+\RequirePackage { geometry }
+\geometry
+  {
+      a4paper
+    , textwidth =
+        \dim_eval:n { \fp_to_dim:n { \c_e_fp * \c_beery_alphabet_dim } }
     , textheight =
-        \dim_eval:n { \fp_eval:n { \c_e_fp * 1.6180 } \c_beery_alphabet_dim }
+        \dim_eval:n
+          { \fp_to_dim:n { 1.6180 * \c_e_fp * \c_beery_alphabet_dim } }
     , heightrounded
     , centering
     , headheight = \l_fontscale_footnotesize_baselineskip_skip
@@ -98,8 +113,7 @@
     , footskip =
         \dim_eval:n
           { \c_beery_big_dim + \l_fontscale_footnotesize_baselineskip_skip }
-  ]
-  { geometry }
+  }
 
 \RequirePackage { fancyhdr }
 \pagestyle { fancy }
@@ -111,14 +125,21 @@
 % PARAGRAPH STYLE
 
 \nonfrenchspacing
-\linespread { \fp_eval:n { 25 / 21 } }
+\linespread { 1 }
 \RequirePackage [ skip = \c_beery_medium_skip ] { parskip }
 \RequirePackage [ raggedrightboxes ] { ragged2e }
 \skip_set:Nn \RaggedRightRightskip { 0pt plus 0.5 \linewidth }
+\dim_zero:N \RaggedRightParindent
+\dim_set_eq:NN \JustifyingParindent \RaggedRightParindent
 \RaggedRight
+\int_set:Nn \pretolerance { -1 }
+\int_set:Nn \tolerance { 200 }
+\dim_zero:N \emergencystretch
 \int_set:Nn \widowpenalty { 10000 }
 \int_set_eq:NN \clubpenalty \widowpenalty
 \int_set_eq:NN \displaywidowpenalty \widowpenalty
+\int_set:Nn \hyphenpenalty { 99 }
+\int_set_eq:NN \exhyphenpenalty \hyphenpenalty
 
 % HEADINGS, TABLE OF CONTENTS
 
@@ -129,9 +150,9 @@
 \titlespacing* \section % section
   { 0pt } % indent
   {
-    \fp_eval:n { 4 / 3 } \c_beery_medium_dim
-    plus  \fp_eval:n { 1 / 2 * 4 } \c_beery_medium_dim
-    minus \fp_eval:n { 1 / 3 / 4 } \c_beery_medium_dim
+    \c_beery_big_dim
+    plus  \fp_eval:n { 1 / 2 * 4 } \c_beery_big_dim
+    minus \fp_eval:n { 1 / 3 / 4 } \c_beery_big_dim
   } % before
   { \c_beery_medium_skip } % after
 \titlespacing* \subsection
@@ -146,15 +167,15 @@
 \titleformat \section % section
   [ block ] % shape
   { \raggedright \large \bfseries } % format
-  { \thesection . } % label
-  { 0.5em } % the horizontal separation between label and title body
+  { \thesection } % label
+  { 1em } % the horizontal separation between label and title body
   { } % before code
   { } % after code
 \titleformat \subsection
   [ block ]
   { \raggedright \normalsize \bfseries }
-  { \thesubsection . }
-  { 0.5em }
+  { \thesubsection }
+  { 1em }
   { }
   { }
 
@@ -215,7 +236,10 @@
 \coffin_new:N \l__beery_footnote_coffin
 % 1.2 = baselineskip-size-ratio
 \dim_const:Nn \c_beery_footnote_baselineheight_dim
-  { \fp_eval:n { 1.2 * \f at linespread - 1 } \l_fontscale_footnotesize_size_dim }
+  {
+    \fp_to_dim:n
+      { ( 1.2 * \f at linespread - 1 ) * \l_fontscale_footnotesize_size_dim }
+  }
 \RenewDocumentCommand \@makefntext { +m }
   {
     \vcoffin_set:Nnn \l__beery_footnote_coffin { \textwidth }
@@ -224,8 +248,10 @@
           {
             \dim_set:Nn \leftmargin
               {
-                \fp_eval:n { ( 1 - \l_fontscale_footnotesize_scale_fp ) / 2 }
-                \textwidth
+                \fp_to_dim:n
+                  {
+                    ( 1 - \l_fontscale_footnotesize_scale_fp ) / 2 * \textwidth
+                  }
               }
             \dim_set_eq:NN \rightmargin \leftmargin
             \dim_set:Nn \labelsep { 0.5em }
@@ -242,4 +268,5 @@
 
 \AddToHook { shipout / lastpage } { \label { LastPage } }
 \RequirePackage { xurl }
-\RequirePackage [ bookmarksnumbered , hidelinks , linktoc = page ] { hyperref }
\ No newline at end of file
+\RequirePackage { hyperref }
+\hypersetup { bookmarksnumbered , hidelinks , linktoc = page }
\ No newline at end of file

Deleted: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-classic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-classic.tex	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-classic.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,39 +0,0 @@
-\ProvidesFile
-  {fontscale-manual-table-classic.tex}
-  [2024-04-15]
-
-\begin{table}
-  \centering
-  \caption
-    {%
-      The size of each font size command in \unit{pt} when using a classic typographic scale.%
-      \label{table:classicscales}%
-    }
-  \bigskip
-  \begin{tblr}
-    {
-        colspec=
-          {
-            l
-            Q[si={table-format=3.2},c]
-            Q[si={table-format=3.2},c]
-            Q[si={table-format=3.2},c]
-          }
-      , cell{1}{2-Z}={guard}
-    }
-    \toprule
-    Command & \Key{classic-10pt} & \Key{classic-11pt} & \Key{classic-12pt} \\
-    \midrule
-    \cs{tiny}         &  6 &  7 &  8 \\
-    \cs{scriptsize}   &  7 &  8 &  9 \\
-    \cs{footnotesize} &  8 &  9 & 10 \\
-    \cs{small}        &  9 & 10 & 11 \\
-    \cs{normalsize}   & 10 & 11 & 12 \\
-    \cs{large}        & 11 & 12 & 14 \\
-    \cs{Large}        & 12 & 14 & 16 \\
-    \cs{LARGE}        & 14 & 16 & 18 \\
-    \cs{huge}         & 16 & 18 & 21 \\
-    \cs{Huge}         & 18 & 21 & 24 \\
-    \bottomrule
-  \end{tblr}
-\end{table}
\ No newline at end of file

Deleted: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-font-steps.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-font-steps.tex	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-font-steps.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,38 +0,0 @@
-\ProvidesFile
-  {fontscale-manual-table-font-steps.tex}
-  [2024-04-15]
-
-\begin{table}
-  \centering
-  \caption
-    {%
-      The step of each font size command.
-      These are constants and cannot be changed.%
-      \label{table:fontsteps}%
-    }
-  \bigskip
-  \begin{tblr}
-    {
-        colspec=
-          {
-            l
-            Q[si={table-format=3.2},c]
-          }
-      , cell{1}{2}={guard}
-    }
-    \toprule
-    Command & Step \\
-    \midrule
-    \cs{tiny}         & -4 \\
-    \cs{scriptsize}   & -3 \\
-    \cs{footnotesize} & -2 \\
-    \cs{small}        & -1 \\
-    \cs{normalsize}   &  0 \\
-    \cs{large}        &  1 \\
-    \cs{Large}        &  2 \\
-    \cs{LARGE}        &  3 \\
-    \cs{huge}         &  4 \\
-    \cs{Huge}         &  5 \\
-    \bottomrule
-  \end{tblr}
-\end{table}
\ No newline at end of file

Deleted: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-modular-musical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-modular-musical.tex	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual-table-modular-musical.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,38 +0,0 @@
-\ProvidesFile
-  {fontscale-manual-table-modular-musical.tex}
-  [2024-04-15]
-
-\begin{table}
-  \centering
-  \caption
-    {%
-      The size of each font size command when using a modular or musical typographic scale with the initial settings.
-      The font sizes are in \unit{pt} and rounded to two decimal places.%
-    }
-  \bigskip
-  \begin{tblr}
-    {
-        colspec=
-          {
-            l
-            Q[si={table-format=3.2},c]
-            Q[si={table-format=3.2},c]
-          }
-      , cell{1}{2-3}={guard}
-    }
-    \toprule
-    Command & \Key{modular} & \Key{musical} \\
-    \midrule
-    \cs{tiny}         & 6.24  & 5.74  \\
-    \cs{scriptsize}   & 7.02  & 6.60  \\
-    \cs{footnotesize} & 7.90  & 7.58  \\
-    \cs{small}        & 8.89  & 8.71  \\
-    \cs{normalsize}   & 10    & 10    \\
-    \cs{large}        & 11.25 & 11.49 \\
-    \cs{Large}        & 12.66 & 13.20 \\
-    \cs{LARGE}        & 14.24 & 15.16 \\
-    \cs{huge}         & 16.02 & 17.41 \\
-    \cs{Huge}         & 18.02 & 20    \\
-    \bottomrule
-  \end{tblr}
-\end{table}
\ No newline at end of file

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

Deleted: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,390 +0,0 @@
-\documentclass{beery}
-
-\begin{document}
-
-
-\section*
-  {%
-    \SetFontStep*{1}%
-    The \pkg{fontscale} package%
-  }
-
-A user interface for setting document font sizes
-
-Oliver Beery
-
-Version 1.3.0\quad{}17 May 2024
-
-
-\section{Introduction}
-\label{sec:intro}
-
-\subsection{About}
-\label{subsec:about}
-
-\listheading{The \pkg{fontscale} package provides the following functionalities:}
-\begin{itemize}
-  \item
-  Set font sizes via a classic, modular, or musical typographic scale.
-  \item
-  Set arbitrary sizes and baselineskips for the standard font size commands \cs{tiny}, \cs{scriptsize}, \cs{footnotesize}, \cs{small}, \cs{normalsize}, \cs{large}, \cs{Large}, \cs{LARGE}, \cs{huge}, and \cs{Huge}.
-  \item
-  Set the font size settings mid\-/document or within a local group.
-  \item
-  Set the font size by setting the font step, scale, or size.
-  \item
-  Set the font size relative to the current font size.
-  \item
-  Use the current font step, scale, size, and baselineskip directly, for example, for printing or within calculations.
-  \item
-  Print sample text to test different font sizes.
-  \item
-  For advanced users, store the step, scale, size, and baselineskip of each font size command in \pkg{expl3} variables.
-\end{itemize}
-
-\subsection{Loading the package}
-\label{subsec:loading}
-
-This package requires the 10 October 2023 \pkg{l3kernel} update.
-You may need to ensure that your \LaTeX{} installation is up\-/to\-/date before using this package.
-
-This package lets the user set arbitrary font sizes.
-This works with most fonts produced today, but, for historical reasons, the default Computer Modern font is available only in a number of fixed sizes.
-If you get a warning that Computer Modern is not available in the requested size, you may need to add the code \cs{RequirePackage{fix-cm}} before \cs{documentclass} to make Computer Modern available at arbitrary font sizes.
-
-\cs{usepackage}\marg{fontscale}
-\nopagebreak\newline
-\cs{fontscalesetup}\marg{\meta{keyval list}}
-
-Load the \pkg{fontscale} package via the usual command in the document preamble.
-This package has no package options.
-Instead, the package keys are set up via the command \cs{fontscalesetup}\marg{\meta{keyval list}}.
-\meta{keyval list} must receive a comma\-/separated list of keys and their associated values.
-The package keys are documented in \S\ref{sec:choosing} and \S\ref{sec:overwriting}.
-
-Many \LaTeX{} document classes have a font size option (\Key{10pt}, \Key{11pt}, \Key{12pt}, etc.\@) which not only changes the set of document font sizes, but also modifies additional settings such as the page layout and vertical spacing which were specifically designed to work with those font sizes.
-For this reason, you may want to set the document class font size option close to the value of \cs{normalsize} set by this package.
-
-Internally, this package sets up each font size command from \cs{tiny} to \cs{Huge} using the kernel command \cs{@setfontsize}\---they have no additional functionality beyond that of \cs{@setfontsize}.
-Unlike the standard document classes, the font size commands set up by this package do not change the vertical spacing for displayed math and list structures.
-If the user would like to add this functionality or perhaps other features to the font size commands, they can do so via hooks, which are documented in the \LaTeX{} kernel.
-
-\subsection{Terminology}
-\label{subsec:terminology}
-
-When using the \pkg{fontscale} package, each font size, including the standard font size commands from \cs{tiny} to \cs{Huge}, has a step, scale, size, and baselineskip.
-The latter two parameters are the familiar first and second arguments to the low\-/level font command \cs{fontsize}\marg{\meta{dimen}}\marg{\meta{skip}}.
-The font scale is the relative font size; the ratio of the font size to \cs{normalsize}.
-The font step is the number of font size gradations from \cs{normalsize}, which has a step of \num{0}.
-Table~\ref{table:fontsteps} lists the font step of each font size command.
-
-\input{./fontscale-manual-table-font-steps.tex}
-
-This package defines many keys and commands that take as a value or argument a \meta{dim expr}, \meta{skip expr}, \meta{fp expr}, or \meta{int expr}.
-This syntax is short for a dimen, skip, floating point, or integer expression, respectively.
-See \pkg{usrguide} \S5 for more information.%
-\footnote{\url{https://ctan.org/pkg/usrguide}}
-
-
-\section{Choosing the typographic scale}
-\label{sec:choosing}
-
-\Key{typographic-scale}
-  [classic-10pt, classic-11pt, classic-12pt, modular, musical]
-  [classic-10pt]
-\newline
-\Key{modular/ratio}[\meta{fp expr}][1.125]
-\newline
-\Key{musical/ratio}[\meta{fp expr}][2]%
-\nopagebreak\newline
-\Key{musical/notes}[\meta{int expr}][5]
-
-The key \Key{typographic\-/scale} sets the font sizes using a classic, modular, or musical typographic scale.
-These are common methods of choosing a set of document font sizes.
-The choice of typographic scale initializes to \Key{classic\-/10pt}.
-
-The key \Key{typographic\-/scale} can also be set in a condensed format via the keys \Key{classic\-/10pt}, \Key{classic\-/11pt}, \Key{classic\-/12pt}, \Key{modular}, or \Key{musical}, which set the key \Key{typographic\-/scale} to the corresponding value.
-
-The classic typographic scale consists of the traditional font sizes
-\numlist{6;7;8;9;10;11;12;14;16;18;21;24;36;48;60;72}.%
-\footnote{See \S{}3.1 of \textit{The Elements of Typographic Style} by Robert Bringhurst.}
-They have been used since the sixteenth century and are the default font sizes on most computer software.
-The keys \Key{classic-10pt, classic-11pt, classic-12pt} set the size of each font size command to values based on their position in the classic typographic scale.
-The size of \cs{normalsize} is the named point size.
-The sizes of the other font size commands are the adjacent font sizes in the scale.
-Table~\ref{table:classicscales} lists the size of each font size command when using a classic typographic scale.
-
-\input{./fontscale-manual-table-classic.tex}
-
-The key \Key{modular} sets the font sizes from \cs{tiny} to \cs{Huge} using a modular typographic scale.
-In a modular scale, each font size is a fixed ratio from the adjacent font sizes.%
-\footnote{\url{https://alistapart.com/article/more-meaningful-typography/}}
-Here, the base font size is the size of \cs{normalsize}, which can be set via the key \Key{normalsize/size}[\meta{dim expr}], more documented in \S\ref{sec:overwriting}.
-If not set, \cs{normalsize} initializes to \qty{10}{pt}.
-The modular ratio can be set via the key \Key{modular\slash{}ratio}.
-The initial modular ratio is \num{1.125}.
-
-\input{./fontscale-manual-table-modular-musical.tex}
-
-The key \Key{musical} sets the font sizes according to their position in a musical typographic scale.
-The font size is calculated using the formula:%
-\footnote
-  {%
-    I have referenced this article by Spencer Mortensen:
-    \newline
-    \url{https://spencermortensen.com/articles/typographic-scale/}%
-  }
-\[ f_i = f_0 \times r ^ { i / n } \]
-$f_0$ is the base font size, the size of \cs{normalsize}.
-$f_i$ is the font size with font step~$i$.
-$n$ is the number of notes in the musical scale\---the number of font size gradations or steps above \cs{normalsize}.
-$r$ is the ratio of the musical scale, the ratio of the highest to the lowest note $ f_n / f_0 $.
-(The modular typographic scale is actually a special case of the musical typographic scale where $n=1$.)
-
-The musical ratio~$r$ and the number of notes~$n$ can be set via the keys \Key{musical\slash{}ratio} and \Key{musical\slash{}notes}.
-The initial musical ratio\---\num{2}\---and the initial number of notes\---\num{5}\---are the same as that of the classic typographic scale.%
-\footnote{Ibid.}
-Conveniently, \cs{Huge} is \num{5} steps above \cs{normalsize}.
-The font size of \cs{normalsize}~$f_0$ can be set using the key \Key{normalsize/size}[\meta{dim expr}], more documented in \S\ref{sec:overwriting}.
-When using a musical typographic scale, \cs{normalsize} initializes to \qty{10}{pt}.%
-\footnote {I have set the initial value to \qty{10}{pt} instead of the \qty{12}{pt} recommended by the Spencer Mortensen article because this matches the default settings of the standard \LaTeXe{} document classes.}
-
-\Key{baselineskip-size-ratio}[\meta{fp expr}][1.2]
-\KeepNextPar*
-
-The key \Key{baselineskip\-/size\-/ratio} sets the ratio of the font baselineskip to the font size.
-By default, the font baselineskip of each font size command equals its font size times \meta{fp expr}.
-Users should not set this key unless they really know what they are doing.
-When using increased line spacing, users should prefer the low\-/level font command \cs{linespread} or the \pkg{setspace} package.
-
-
-\section{Overwriting the typographic scale}
-\label{sec:overwriting}
-
-In some situations, users may need to explicitly set the scale, size, or baselineskip of a font size command, overwriting the value set by the keys in \S\ref{sec:choosing}.
-Note that the font steps and the scale of \cs{normalsize} are constants and cannot be changed.
-
-\Key{\meta{font size command}/scale}[\meta{fp expr}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}scale} set the scale of \meta{font size command} to \meta{fp expr}, ignoring the value set by the key \Key{typographic\-/scale}.
-The key \Key{normalsize\slash{}scale} is not defined.
-
-\Key{\meta{font size command}/size}[\meta{dim expr}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}size} set the size of \meta{font size command} to \meta{dim expr}, ignoring the values set by the keys \Key{typographic\-/scale} and \Key{\meta{font size command}\slash{}scale}.
-\meta{dim expr} supplies a default unit of \unit{pt}.
-
-The package will issue a warning if the user sets the keys \Key{\meta{font size command}\slash{}size} and \Key{\meta{font size command}\slash{}scale} for the same \meta{font size command} since the latter key will be ignored.
-
-\Key{\meta{font size command}/baselineskip}[\meta{skip expr}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}baselineskip} set the font baselineskip of \meta{font size command} to \meta{skip expr} instead of calculating it from the size of \meta{font size command} and \Key{baselineskip\-/size\-/ratio}.
-\meta{skip expr} supplies a default unit of \unit{pt}.
-
-\Key{\meta{font size command}}[\meta{dim expr}]
-\nopagebreak\newline
-\Key{\meta{font size command}}[\meta{dim expr}/\meta{skip expr}]
-
-The keys \Key{\meta{font size command}} set the keys \Key{\meta{font size command}\slash{}size} or \Key{\meta{font size command}\slash{}baselineskip} 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, $10/12$ or $11/13$.
-The number before/after the slash is the size/leading in \unit{pts}.
-
-\Key{ignore-order}[true, false][false]
-\KeepNextPar*
-
-The user should take care to ensure that the font sizes and font baselineskips remain in the correct order when directly setting the scales, sizes, or baselineskips of the different font size commands.
-The magnitudes of the font sizes and font baselineskips should be ordered from \cs{tiny} to \cs{normalsize} to \cs{Huge}.
-This is important for typographic and syntactic consistency.
-This package will issue a warning if they are not in the correct order.
-The user can disable this warning via the key \Key{ignore\-/order}[true] or just \Key{ignore\-/order}.
-
-
-\section{User commands}
-\label{sec:usercommands}
-
-\subsection{Expandable font parameters}
-\label{subsec:fontparameters}
-
-\cs{CurrentFontStep}
-\nopagebreak\newline
-\cs{CurrentFontScale}
-\newline
-\cs{CurrentFontSize}
-\nopagebreak\newline
-\cs{CurrentFontBaselineskip}
-
-These are fully expandable commands that expand to the current font step, scale, size, or baselineskip.
-They can be used for printing or within calculations.
-Caution: \cs{CurrentFontStep} will expand to nothing if the current font step is undefined.
-
-Internally, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} use the kernel command \cs{f at size}.
-\cs{CurrentFontSize} expands to \texttt{f at size pt}.
-\cs{CurrentFontBaselineskip} expands to the kernel command \cs{f at baselineskip}.
-Note that the low\-/level font command \cs{fontsize}\marg{\meta{dimen}}\marg{\meta{skip}} sets \cs{f at size} to the new font size before expanding its second argument.
-This means that \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} may need to be first expanded if used in \meta{skip}.
-This package provides the command \cs{SetFontSizeBaselineskip} as an alternative to \cs{fontsize} + \cs{selectfont} that avoids this issue (\S\ref{subsec:fontsize}).
-
-\subsection{More font sizing commands}
-\label{subsec:fontsize}
-
-The \pkg{fontscale} package provides the commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} which set the font size in different ways.
-The first three commands have a starred version which sets the font size relative to the current font size.
-Internally, these commands all use the low\-/level font commands \cs{fontsize} and \cs{selectfont}.
-These commands should be used only in special cases.
-Generally, users should prefer the font size commands from \cs{tiny} to \cs{Huge} for typographic and syntactic consistency, although \cs{SetFontStep*}\marg{\meta{integer}} can use a font size command directly.
-
-\cs{SetFontStep}\marg{\meta{fp expr}}
-\nopagebreak\newline
-\cs{SetFontStep*}\marg{\meta{fp expr}}
-
-\cs{SetFontStep} sets the font size by setting the font step to \meta{fp expr}.
-The starred version \cs{SetFontStep*} adds \meta{fp expr} to the current font step.
-If the choice of typographic scale is not modular or musical, then the only valid values for \meta{fp expr} are the integers from \num{-4} to \num{5}, corresponding to the font size commands from \cs{tiny} to \cs{Huge}.
-\cs{SetFontStep} will issue an error if the calculated font step is invalid.
-The starred version \cs{SetFontStep*} will also issue an error if the current font step is invalid.
-\cs{SetFontStep} sets the font baselineskip to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-If the calculated font step matches the step of any font size command, then that font size command will be used directly.
-
-\listheading{Examples:}
-\begin{itemize}
-  \item
-  For example, \cs{SetFontStep}\marg{-2} and \cs{SetFontStep}\marg{2} use \cs{footnotesize} and \cs{Large}.
-  Note that it is typically better to use the equivalent font size command in place of \cs{SetFontStep}\marg{\meta{integer}}.
-  \item
-  If the current font size is \cs{normalsize}, \cs{SetFontStep*}\marg{1} and \cs{SetFontStep*}\marg{-1} use \cs{large} and \cs{small}.
-  This is useful for moving up or down a note on the typographic scale.
-  \item
-  If the choice of typographic scale is modular or musical, \cs{SetFontStep*}\marg{-0.5} sets the font size and font baselineskip to values between that of \cs{normalsize} and \cs{small}.
-  Otherwise, it produces an error.
-\end{itemize}
-
-\cs{SetFontScale}\marg{\meta{fp expr}}
-\nopagebreak\newline
-\cs{SetFontScale*}\marg{\meta{fp expr}}
-
-\cs{SetFontScale} sets the font size by setting the font scale to \meta{fp expr}.
-The font baselineskip is set to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-The starred version \cs{SetFontScale*} adds \meta{fp expr} to the current font scale.
-For example, \cs{SetFontScale}\marg{1.25} makes the font size 25\% larger than \cs{normalsize}.
-If the current font size is \cs{normalsize}, \cs{SetFontScale*}\marg{0.2} is equivalent to \cs{SetFontScale}\marg{1.2}.
-
-\cs{SetFontSize}\marg{\meta{dim expr}}
-\nopagebreak\newline
-\cs{SetFontSize*}\marg{\meta{dim expr}}
-
-\cs{SetFontSize} sets the font size to \meta{dim expr}.
-\meta{dim expr} supplies a default unit of \unit{pt}.
-The font baselineskip is set to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-The starred version \cs{SetFontSize*} adds \meta{dim expr} to the current font size.
-For example, \cs{SetFontSize*}\marg{1} and \cs{SetFontSize*}\marg{-1pt} increase and decrease the current font size by a \unit{pt}.
-
-\cs{ScaleFont}\marg{\meta{fp expr}}
-\KeepNextPar*
-
-Scales the current font size and the current font baselineskip by a factor of \meta{fp expr}.
-For example, if the current font size and font baselineskip are \qty{10}{pt} and \qty{12}{pt}, using \cs{ScaleFont}\marg{0.8} will reduce them proportionally to \qty{8}{pt} and \qty{9.6}{pt}.
-
-\cs{SetFontSizeBaselineskip}\marg{\meta{dim expr}}\marg{\meta{skip expr}}
-\KeepNextPar*
-
-Sets the font size to \meta{dim expr} and the font baselineskip to \meta{skip expr}.
-Both arguments supply a default unit of \unit{pt}.
-\cs{SetFontSizeBaselineskip} can be used as an alternative to \cs{fontsize} + \cs{selectfont} as it avoids the issue with \cs{f at size} discussed in \S\ref{subsec:fontparameters}.
-
-\subsection{Testing and debugging}
-\label{subsec:debug}
-
-The commands documented here are intended primarily for testing and debugging.
-I have used them often when developing this package so I think users will find them helpful.
-
-\cs{PrintFontParameters}
-\nopagebreak\newline
-\cs{PrintAllFontParameters}
-
-\cs{PrintFontParameters} prints the current font step, scale, size, and baselineskip in this order in a comma\-/separated list of key = value pairs.
-If the current font step is undefined (as explained for \cs{SetFontStep} in \S\ref{subsec:fontsize}), it will be left blank.
-\cs{PrintAllFontParameters} prints the step, scale, size, and baselineskip of each font size command.
-
-\cs{PrintSampleText}\oarg{\meta{text}}
-\nopagebreak\newline
-\cs{PrintSampleText*}\oarg{\meta{text}}
-
-\cs{PrintSampleText} prints \meta{text} in each font size ordered from \cs{tiny} to \cs{Huge} each followed by a paragraph break.
-The starred version \cs{PrintSampleText*} reverses the sizing order.
-The \meta{text} can be changed via the optional argument, but cannot contain \cs{par} tokens.
-The default \meta{text} is \enquote{The \texttt{fontscale} package: A user interface for setting document font sizes}.
-One useful way of printing example text is by using
-\cs{PrintSampleText}\oarg{\cs{PrintFontSizeCommand}:\textvisiblespace{}\cs{PrintFontParameters}}.
-
-\cs{PrintFontSizeCommand}
-\KeepNextPar*
-
-\cs{PrintFontSizeCommand} tests whether the current font size and the current font baselineskip match the font size and font baselineskip of any font size command from \cs{tiny} to \cs{Huge}.
-If so, it prints the name of that font size command, including the backslash character.
-If not, it instead prints \enquote{UNDEFINED\@}.
-\vfill\pagebreak%manual
-
-\subsection
-  {%
-    \texorpdfstring
-      {More on \cs{fontscalesetup}}
-      {More on \textbackslash{}fontscalesetup}%
-  }
-\label{subsec:fontscalesetup}
-
-\cs{fontscalesetup}\marg{\meta{keyval list}}
-\KeepNextPar*
-
-Sets and processes the \pkg{fontscale} package keys and then uses \cs{normalsize}.
-\cs{fontscalesetup} can be applied mid\-/document or locally within the current \TeX{} group.
-
-\Key{reset}[initial, preamble]
-\KeepNextPar*
-
-The key \Key{reset} is also available.
-Its value must be either \texttt{initial} or \texttt{preamble}.
-The key \Key{reset}[initial] or just \Key{reset} sets all the keys to their initial values.
-The key \Key{reset}[preamble] sets all the keys to their values at the end of the preamble (or does nothing if used before the end of the preamble).
-
-
-\section{Programming}
-\label{sec:programming}
-
-This section is relevant to \LaTeX3 programmers.
-
-The document commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} are set up to work with \cs{text_purify:n}.
-\cs{text_purify:n} will correctly remove these commands and their arguments.
-This includes the starred versions \cs{SetFontStep*}, \cs{SetFontScale*}, and \cs{SetFontSize*}.
-
-This package does not provide any public \pkg{expl3} functions.
-
-This package provides some public \pkg{expl3} variables.
-The package stores in public variables the step, scale, size, and baselineskip of each font size command.
-These variables should not be modified directly.
-Instead, they should be modified only indirectly via the command \cs{fontscalesetup}.
-
-Each takes the form:
-
-\begingroup
-  \ttfamily
-  \textbackslash{}c\_fontscale\_\meta{font size command}\_step\_fp
-  \nopagebreak\newline
-  \textbackslash{}l\_fontscale\_\meta{font size command}\_scale\_fp
-  \newline
-  \textbackslash{}l\_fontscale\_\meta{font size command}\_size\_dim
-  \nopagebreak\newline
-  \textbackslash{}l\_fontscale\_\meta{font size command}\_baselineskip\_skip
-\endgroup
-
-Exception:
-\cs{l_fontscale_normalsize_scale_fp} is not defined.
-The scale of \cs{normalsize} is instead stored as the constant \cs{c_fontscale_normalsize_scale_fp}, which always equals \num{1}.
-
-The step, scale, size, and baselineskip of each font size command are also stored in property lists, one for each font size command:
-
-\texttt{\textbackslash{}l\_fontscale\_\meta{font size command}\_prop}
-
-\end{document}
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -0,0 +1,41 @@
+\ProvidesFile
+  {fontscale-table-classic.tex}
+  [2024-08-02]
+
+\begin{table}
+  \centering
+  \caption
+    {%
+      The font size of each font size command from \cs{tiny} to \cs{Huge} in units of \unit{pt} when using a classic typographic scale.%
+      \label{table:classic}%
+    }
+  \bigskip
+  \begin{tblr}
+    {
+        colspec=
+          {
+            l
+            Q[si={table-format=3.2},c]
+            Q[si={table-format=3.2},c]
+            Q[si={table-format=3.2},c]
+          }
+      , cell{1}{2-Z}={guard}
+      , cell{2-Z}{1}={cmd=\cs}
+      , cell{1}{2-Z}={cmd=\Key}
+    }
+    \toprule
+      font size command & classic-10pt & classic-11pt & classic-12pt \\
+    \midrule
+      tiny         &  6 &  7 &  8 \\
+      scriptsize   &  7 &  8 &  9 \\
+      footnotesize &  8 &  9 & 10 \\
+      small        &  9 & 10 & 11 \\
+      normalsize   & 10 & 11 & 12 \\
+      large        & 11 & 12 & 14 \\
+      Large        & 12 & 14 & 16 \\
+      LARGE        & 14 & 16 & 18 \\
+      huge         & 16 & 18 & 21 \\
+      Huge         & 18 & 21 & 24 \\
+    \bottomrule
+  \end{tblr}
+\end{table}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -0,0 +1,39 @@
+\ProvidesFile
+  {fontscale-table-font-steps.tex}
+  [2024-08-02]
+
+\begin{table}
+  \centering
+  \caption
+    {%
+      The font step of each font size command from \cs{tiny} to \cs{Huge}.
+      These are constants and cannot be changed.%
+      \label{table:fontsteps}%
+    }
+  \bigskip
+  \begin{tblr}
+    {
+        colspec=
+          {
+            l
+            Q[si={table-format=3.2},c]
+          }
+      , cell{1}{2}={guard}
+      , cell{2-Z}{1}={cmd=\cs}
+    }
+    \toprule
+      font size command & font step \\
+    \midrule
+      tiny         & -4 \\
+      scriptsize   & -3 \\
+      footnotesize & -2 \\
+      small        & -1 \\
+      normalsize   &  0 \\
+      large        &  1 \\
+      Large        &  2 \\
+      LARGE        &  3 \\
+      huge         &  4 \\
+      Huge         &  5 \\
+    \bottomrule
+  \end{tblr}
+\end{table}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -0,0 +1,39 @@
+\ProvidesFile
+  {fontscale-table-musical.tex}
+  [2024-08-02]
+
+\begin{table}
+  \centering
+  \caption
+    {%
+      The font size of each font size command from \cs{tiny} to \cs{Huge} when using a musical typographic scale with the initial values.
+      The font sizes are in units of \unit{pt} and rounded to two decimal places.%
+      \label{table:musical}%
+    }
+  \bigskip
+  \begin{tblr}
+    {
+        colspec=
+          {
+            l
+            Q[si={table-format=3.2},c]
+          }
+      , cell{1}{2}={guard}
+      , cell{2-Z}{1}={cmd=\cs}
+    }
+    \toprule
+      font size command & \Key{musical} \\
+    \midrule
+      tiny         & 5.74  \\
+      scriptsize   & 6.60  \\
+      footnotesize & 7.58  \\
+      small        & 8.71  \\
+      normalsize   & 10    \\
+      large        & 11.49 \\
+      Large        & 13.20 \\
+      LARGE        & 15.16 \\
+      huge         & 17.41 \\
+      Huge         & 20    \\
+    \bottomrule
+  \end{tblr}
+\end{table}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf	2024-08-03 20:28:46 UTC (rev 71965)

Property changes on: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	2024-08-03 20:28:46 UTC (rev 71965)
@@ -0,0 +1,398 @@
+\documentclass{beery}
+
+
+\begin{document}
+
+
+\section*
+  {%
+    \SetFontStep*{1}%
+    The \pkg{fontscale} package%
+  }
+
+A flexible interface for setting font sizes
+
+Oliver Beery
+
+Version 2.0.0\quad{}2 August 2024
+
+
+\section{Introduction}
+\label{sec:intro}
+
+\subsection{About}
+\label{subsec:about}
+
+\listheading{The \pkg{fontscale} package provides the following functionalities:}
+\begin{itemize}
+  \item
+  Set font sizes using a classic or musical typographic scale (\S\ref{subsec:typographicscale}).
+  \item
+  Set arbitrary font sizes and font baselineskips for the standard \LaTeX{} font size commands \cs{tiny}, \cs{scriptsize}, \cs{footnotesize}, \cs{small}, \cs{normalsize}, \cs{large}, \cs{Large}, \cs{LARGE}, \cs{huge}, and \cs{Huge} (\S\ref{subsec:overwriting}).
+  \item
+  Set the font sizes and font baselineskips of the standard \LaTeX{} font size commands mid\-/document or within a local group (\S\ref{subsec:fontscalesetup}).
+  \item
+  Provides expandable commands that expand to the current font step, font scale, font size, or font baselineskip (\S\ref{subsec:expandable}).
+  \item
+  Provides additional font size commands, including setting the font size by setting the font step or font scale and setting the font size relative to the current font size using more powerful tools than the \pkg{relsize} package (\S\ref{subsec:fontsize}).
+  \item
+  For \LaTeX3 programmers, this package defines public \pkg{expl3} variables that store the font step, font scale, font size, and font baselineskip of each font size command from \cs{tiny} to \cs{Huge} (\S\ref{sec:programming}).
+\end{itemize}
+
+\subsection{Loading the package}
+\label{subsec:loading}
+
+\listheading{The \pkg{fontscale} package requires:}
+\begin{itemize}
+  \item \LaTeXe{} version 2023-11-01 or newer
+  \item \pkg{l3kernel} version 2023-10-10 or newer
+\end{itemize}
+
+You may need to ensure that your \LaTeX{} installation is up\-/to\-/date before using this package.
+
+This package lets the user set arbitrary font sizes.
+This works with most fonts produced today, but, for historical reasons, the default Computer Modern font is available only in a number of discrete font sizes.
+If you get a warning that Computer Modern is not available in the requested font size, you may need to add the code \cs{RequirePackage}\allowbreak\verb|{fix-cm}| before \cs{documentclass} to make Computer Modern available at arbitrary font sizes.
+Alternatively, you can use the Latin Modern font by loading the \pkg{lmodern} package.
+
+The \pkg{fontscale} package has no package options.
+Instead, this package provides the command \cs{fontscalesetup}\marg{key\-/value list} (\S\ref{subsec:fontscalesetup}) which sets the package keys (\S\ref{sec:keys}).
+
+Many \LaTeX{} document classes have a font size option (e.g.\@ \Key{10pt}, \Key{11pt}, \Key{12pt}) which not only changes the set of document font sizes, but also modifies additional settings such as the page layout and vertical spacing which were specifically designed to work with those font sizes.
+For this reason, you may want to set the document class font size option close to the font size of \cs{normalsize} set by this package.
+
+\listheading{Internally, this package defines each font size command from \cs{tiny} to \cs{Huge} using the low\-/level font commands \cs{fontsize} and \cs{selectfont}\---they have no additional functionality beyond that of \cs{fontsize} and \cs{selectfont}, except that they:}
+\begin{itemize}
+  \item
+  Set the kernel command \cs{@currsize} equal to the font size command.
+  This is needed only for compatibility.
+  \item
+  Do nothing, except issue a warning, if used in math mode.
+\end{itemize}
+
+Unlike the standard \LaTeX{} document classes, the font size commands from \cs{tiny} to \cs{Huge} defined by this package do not change the vertical spacing for displayed math and list structures.
+If the user would like to add this functionality or perhaps other features to the font size commands, they can use hooks, which are documented in the \LaTeXe{} kernel.
+
+When loaded, this package uses \cs{normalsize} after initializing the font size commands from \cs{tiny} to \cs{Huge}.
+
+\subsection{The font size parameters}
+\label{subsec:fontsizeparameters}
+
+When using the \pkg{fontscale} package, each font size, including the standard \LaTeX{} font size commands from \cs{tiny} to \cs{Huge}, has a font step, font scale, font size, and font baselineskip.
+The latter two parameters are the familiar first and second arguments to the low\-/level font command \cs{fontsize}\marg{dimen}\marg{skip}.
+(The font baselineskip, stored in the kernel command \cs{f at baselineskip}, should not be confused with the paragraph baselineskip \cs{baselineskip}.)
+The font scale and font step are different ways of describing the font size.
+The font scale is the relative font size; the ratio of the font size to \cs{normalsize}, which has a font scale of \num{1}.
+The font step is the number of font size gradations from \cs{normalsize}, which has a font step of \num{0}.
+Table~\ref{table:fontsteps} displays the font step of each font size command.
+
+\input{./fontscale-table-font-steps.tex}
+
+\subsection{Syntax}
+\label{subsec:syntax}
+
+This package defines some keys and commands that take as a value or argument a \meta{floating point expression}, \meta{integer expression}, \meta{dimen expression}, or \meta{skip expression}.
+This syntax has the same representation as the arguments to \cs{fpeval}, \cs{inteval}, \cs{dimeval}, and \cs{skipeval}, documented in \pkg{usrguide}.%
+\footnote{\url{https://ctan.org/pkg/usrguide}}
+
+
+\section{Keys}
+\label{sec:keys}
+
+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}).
+
+\subsection{The typographic scale}
+\label{subsec:typographicscale}
+
+The font sizes of the font size commands from \cs{tiny} to \cs{Huge} are initially set by the key \Key{typographic\-/scale}.
+
+\Key{typographic-scale}
+  [%
+    classic-10pt$\,\vert\,$\allowbreak
+    classic-11pt$\,\vert\,$\allowbreak
+    classic-12pt$\,\vert\,$\allowbreak\hspace*{1.5em}%
+    musical%
+  ]
+  [classic-10pt]
+\newline
+\Key{classic-10pt}
+\newline
+\Key{classic-11pt}
+\newline
+\Key{classic-12pt}
+\nopagebreak\newline
+\Key{musical}
+
+The value of the key \Key{typographic\-/scale} must be \Value{classic\-/10pt}, \Value{classic\-/11pt}, \Value{classic\-/12pt}, or \Value{musical}.
+The initial value is \Value{classic\-/10pt}.
+Sets the font size of each font size command from \cs{tiny} to \cs{Huge} using a classic or musical typographic scale.
+These are common methods of choosing a set of document font sizes.
+The keys \Key{classic\-/10pt}, \Key{classic\-/11pt}, \Key{classic\-/12pt}, and \Key{musical} set the key \Key{typographic\-/scale} to the corresponding value.
+
+\input{./fontscale-table-classic.tex}
+
+The classic typographic scale consists of the traditional font sizes
+\numlist{6;7;8;9;10;11;12;14;16;18;21;24;36;48;60;72}.%
+\footnote{See \S3.1 of \textit{The Elements of Typographic Style} by Robert Bringhurst.}
+They have been used since the sixteenth century and are the default font sizes on most computer software.
+Setting the value of the key \Key{typographic\-/scale} to \Key{classic\-/10pt}, \Key{classic\-/11pt}, or \Key{classic\-/12pt} sets the font size of each font size command from \cs{tiny} to \cs{Huge} to values based on their position in the classic typographic scale.
+The named point size\---\qtylist[list-final-separator={, or }]{10;11;12}{pt}\---is the font size of \cs{normalsize}.
+The font sizes of the other font size commands are the adjacent font sizes in the classic typographic scale.
+Table~\ref{table:classic} displays the font size of each font size command when using a classic typographic scale.
+
+\Key{musical/base}[\meta{dimen expression}][10pt]%
+\nopagebreak\newline
+\Key{musical/ratio}[\meta{floating point expression}][2]%
+\nopagebreak\newline
+\Key{musical/notes}[\meta{integer expression}][5]
+
+The key \Key{typographic\-/scale}[musical] sets the font size of each font size command from \cs{tiny} to \cs{Huge} using a musical typographic scale.
+The font sizes are calculated using the formula:%
+\footnote
+  {%
+    I have referenced this article by Spencer Mortensen:
+    \newline
+    \url{https://spencermortensen.com/articles/typographic-scale/}%
+  }
+\begin{equation}\label{eq:musical}
+  f_i = f_0 \times r ^ { i / n }
+\end{equation}
+$f_i$ is the font size with font step~$i$.
+$f_0$ is the base font size.
+$n$ is the number of musical notes\---the number of font size gradations or steps above $f_0$.
+$r$ is the musical ratio, the ratio of the highest to the lowest note $ f_n / f_0 $.
+
+The key \Key{musical\slash{}base} sets the base font size to the value of \meta{dimen expression}, appending a default unit of \unit{pt}.
+The base font size is the font size of \cs{normalsize}.
+The key \Key{musical\slash{}ratio} sets the musical ratio to the result of computing the \meta{floating point expression}.
+The key \Key{musical\slash{}notes} sets the number of musical notes to the value of \meta{integer expression}.
+Table~\ref{table:musical} displays the font size of each font size command when using a musical typographic scale with the initial values.
+
+\input{./fontscale-table-musical.tex}
+
+\subsection{The baselineskip-size-ratio}
+\label{subsec:baselineskipsizeratio}
+
+The font baselineskips of the font size commands from \cs{tiny} to \cs{Huge} are initially set by the key \Key{baselineskip\-/size\-/ratio}.
+
+\Key{baselineskip-size-ratio}[\meta{floating point expression}][1.2]
+\KeepNextPar*
+
+Sets the ratio of the font baselineskip to the font size to the result of computing the \meta{floating point expression}.
+The font baselineskip of each font size command equals its font size times this number.
+The value of this key must be at least \num{1}.
+
+
+\subsection{Overwriting the previous keys}
+\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}.
+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.
+
+\Key{\meta{font size command}/scale}[\meta{floating point expression}][\meta{not set}]
+\KeepNextPar*
+
+Sets the font size of \meta{font size command} by setting its font scale to the result of computing the \meta{floating point expression}.
+Overwrites the font size set by the key \Key{typographic\-/scale}.
+The key \Key{normalsize\slash{}scale} is not defined.
+
+\Key{\meta{font size command}/size}[\meta{dimen expression}][\meta{not set}]
+\KeepNextPar*
+
+Sets the font size of \meta{font size command} to the value of \meta{dimen expression}, appending a default unit of \unit{pt}.
+Overwrites the font size set by the keys \Key{typographic\-/scale} and \Key{\meta{font size command}\slash{}scale}.
+
+\Key{\meta{font size command}/baselineskip}[\meta{skip expression}][\meta{not set}]
+\KeepNextPar*
+
+Sets the font baselineskip of \meta{font size command} to the value of \meta{skip expression}, appending a default unit of \unit{pt}.
+The font baselineskip of \meta{font size command} must be greater than or equal to its font size.
+Overwrites the font baselineskip set by the key \Key{baselineskip\-/size\-/ratio}.
+
+\Key{\meta{font size command}}[\meta{dimen expression}]
+\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}.
+
+
+\section{Commands}
+\label{sec:commands}
+
+This section documents the commands provided by the \pkg{fontscale} package.
+
+\subsection{Setting the keys}
+\label{subsec:fontscalesetup}
+
+\cs{fontscalesetup} \sarg{} \marg{key-value list}
+\KeepNextPar*
+
+Sets and processes the \pkg{fontscale} package keys (\S\ref{sec:keys}) in \meta{key\-/value list} and then uses \cs{normalsize}.
+Adding the optional star first resets the keys to their initial values.
+Can be used mid\-/document.
+The effect is local to the current group.
+Does nothing, except issue a warning, if used in math mode.
+\cs{fontscalesetup} should typically be used only once in the preamble or omitted if the user is satisfied with the initial font sizes and font baselineskips.
+
+\subsection{Expandable font size parameters}
+\label{subsec:expandable}
+
+\cs{CurrentFontStep}
+\nopagebreak\newline
+\cs{CurrentFontScale}
+\newline
+\cs{CurrentFontSize}
+\nopagebreak\newline
+\cs{CurrentFontBaselineskip}
+
+This package provides expandable commands that expand to the current font step, font scale, font size, or font baselineskip.
+They can be used for printing or within calculations.
+
+For clarity, \cs{CurrentFontStep} will be explained in detail.
+\cs{CurrentFontStep} initially tests if the current font size equals the font size of any font size command from \cs{tiny} to \cs{Huge}.
+If so, it expands to the font step of that font size command (Table~\ref{table:fontsteps}).
+If not and if the value of the key \Key{typographic\-/scale} is \Value{musical}, \cs{CurrentFontStep} expands to the current font step calculated from the musical typographic scale (Equation~\ref{eq:musical}).
+Otherwise, the current font step is undefined and \cs{CurrentFontStep} expands to nothing.
+
+Internally, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} rely on the kernel command \cs{f at size}.
+(\cs{f at size} stores the current font size in units of \unit{pt}, omitting the unit.)
+The low\-/level font command \cs{fontsize}\marg{dimen}\marg{skip} sets \cs{f at size} to the new font size before expanding its second argument.
+This means that, if used in \meta{skip}, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} will expand to the new value\---unless they are first expanded.
+This package provides \cs{SetFontSizeBaselineskip} as an alternative to \cs{fontsize} + \cs{selectfont} that avoids this issue (\S\ref{subsec:fontsize}).
+
+\subsection{More font size commands}
+\label{subsec:fontsize}
+
+This package provides additional font size commands for use only in special cases.
+Users should prefer the standard \LaTeX{} font size commands from \cs{tiny} to \cs{Huge} for typographic and syntactic consistency.
+
+\cs{SetFontStep} \sarg{} \marg{floating point expression}
+\KeepNextPar*
+
+Sets the font size by setting the font step to the result of computing the \meta{floating point expression}.
+Adding the optional star instead increases the current font step by the result of computing the \meta{floating point expression} or issues an error if the current font step is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
+Sets the font baselineskip equal to the new font size \texttimes{} the value of the key \Key{baselineskip\-/size\-/ratio}.
+
+\listheading{Three exceptions:}
+\begin{itemize}
+  \item
+  The font step must equal an integer from \num{-4} to \num{5} unless the value of the key \Key{typographic\-/scale} is \Value{musical}.
+  \cs{SetFontStep} will issue an error if the font step is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
+  \item
+  If the font step equals the font step of any font size command from \cs{tiny} to \cs{Huge} (Table~\ref{table:fontsteps}), then that font size command will be used directly.
+  \item
+  Does nothing, except issue a warning, if used in math mode.
+\end{itemize}
+
+\cs{SetFontScale} \sarg{} \marg{floating point expression}
+\KeepNextPar*
+
+Sets the font size by setting the font scale to the result of computing the \meta{floating point expression}.
+Adding the optional star instead increases the current font scale by the result of computing the \meta{floating point expression}.
+Sets the font baselineskip equal to the new font size \texttimes{} the value of the key \Key{baselineskip\-/size\-/ratio}.
+Does nothing, except issue a warning, if used in math mode.
+
+\cs{SetFontSize} \sarg{} \marg{dimen expression}
+\KeepNextPar*
+
+Sets the font size to the value of \meta{dimen expression}, appending a default unit of \unit{pt}.
+Adding the optional star instead increases the current font size by the result of \meta{dimen expression}, appending a default unit of \unit{pt}.
+Sets the font baselineskip equal to the new font size \texttimes{} the value of the key \Key{baselineskip\-/size\-/ratio}.
+Does nothing, except issue a warning, if used in math mode.
+
+\cs{ScaleFont} \marg{floating point expression}
+\KeepNextPar*
+
+Sets the font size equal to the current font size \texttimes{} the result of computing the \meta{floating point expression}.
+Sets the font baselineskip equal to the current font baselineskip \texttimes{} the result of computing the \meta{floating point expression}.
+Does nothing, except issue a warning, if used in math mode.
+
+\cs{SetFontSizeBaselineskip} \marg{dimen expression} \marg{skip expression}
+\KeepNextPar*
+
+Sets the font size to the value of \meta{dimen expression}, appending a default unit of \unit{pt}.
+Sets the font baselineskip to the value of \meta{skip expression}, appending a default unit of \unit{pt}.
+The font baselineskip must be greater than or equal to the font size.
+Does nothing, except issue a warning, if used in math mode.
+Can be used as an alternative to \cs{fontsize} + \cs{selectfont} as discussed in \S\ref{subsec:expandable}.
+
+\subsection{Testing and debugging}
+\label{subsec:debug}
+
+The commands documented here are intended primarily for testing and debugging.
+I have used them often when developing this package so I think users will find them helpful.
+
+\cs{PrintFontSizeParameters}
+\KeepNextPar*
+
+Prints the current font size parameters\---the font step, font scale, font size, and font baselineskip.
+The current font step will be left blank if it is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
+
+\cs{PrintAllFontSizeParameters}
+\KeepNextPar*
+
+Prints the font step, font scale, font size, and font baselineskip of each font size command from \cs{tiny} to \cs{Huge}.
+
+\cs{PrintSampleText} \sarg{} \marg{text}
+\KeepNextPar*
+
+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}\}}.
+
+\cs{PrintFontSizeCommand}
+\KeepNextPar*
+
+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}.
+
+
+\section{Programming}
+\label{sec:programming}
+
+This section is for \LaTeX3 programmers.
+
+\subsection
+  {%
+    Compatibility with
+    \texorpdfstring
+      {\cs{text_purify:n}}
+      {\textbackslash{}text\_purify:n}%
+  }
+\label{subsec:textpurify}
+
+\cs{text_purify:n} will correctly remove the formatting commands defined by this package, including \cs{fontscalesetup} and the commands documented in \S\ref{subsec:fontsize}.
+
+\subsection{Public functions and variables}
+\label{subsec:publicexpl3}
+
+This package does not define any public \pkg{expl3} functions.
+
+This package defines public \pkg{expl3} variables that store the font step, font scale, font size, and font baselineskip of each font size command from \cs{tiny} to \cs{Huge}.
+These variables should never be modified directly.
+Their values should be changed only by \cs{fontscalesetup}.
+
+Each takes the form:
+
+\verb|\c_fontscale_|\meta{font size command}\verb|_step_fp|
+\nopagebreak\newline
+\verb|\l_fontscale_|\meta{font size command}\verb|_scale_fp|
+\newline
+\verb|\l_fontscale_|\meta{font size command}\verb|_size_dim|
+\nopagebreak\newline
+\verb|\l_fontscale_|\meta{font size command}\verb|_baselineskip_skip|
+
+Exception:
+\cs{l_fontscale_normalsize_scale_fp} is not defined.
+The font scale of \cs{normalsize} is stored in \cs{c_fontscale_normalsize_scale_fp}.
+
+
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-08-03 20:28:27 UTC (rev 71964)
+++ trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-08-03 20:28:46 UTC (rev 71965)
@@ -1,26 +1,25 @@
-% Package   : fontscale -- A user interface for setting document font sizes
+% Package   : fontscale -- A flexible interface for setting font sizes
 % Copyright : 2024 (c) Oliver Beery <beeryoliver at gmail.com>
 % CTAN      : https://ctan.org/pkg/fontscale
 % Repository: https://github.com/beeryoliver/fontscale
 % License   : The LaTeX Project Public License 1.3c
 
-% The 2022-06-01 LaTeX kernel update added \ProcessKeyOptions.
-\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+% LaTeX2e version 2023-11-01 added \IfExplAtLeastTF.
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplPackage
   {fontscale}
-  {2024-05-17}
-  {1.3.0}
-  {A user interface for setting document font sizes}
+  {2024-08-02}
+  {2.0.0}
+  {A flexible interface for setting font sizes}
 
-% The 2023-10-10 l3kernel update added many 'e'-variants.
-\IfExplAtLeastTF { 2023-10-10 }
-  { }
+% l3kernel version 2023-10-10 added many 'e'-variants.
+\IfExplAtLeastTF { 2023-10-10 } { }
   {
     \msg_new:nnn { fontscale } { expl3-out-of-date }
       {
-        The~ package~ could~ not~ load.~
-        The~ fontscale~ package~ requires~
-        L3~ programming~ layer~ version~ 2023-10-10~ or~ later.
+        The~ fontscale~ package~ could~ not~ load.~
+        This~ package~ requires~
+        L3~ programming~ layer~ version~ 2023-10-10~ or~ newer.
       }
     \msg_critical:nn { fontscale } { expl3-out-of-date }
   }
@@ -27,7 +26,7 @@
 
 % This package does not require any other packages!
 
-% DECLARE FONT PARAMETER VARIABLES
+% DECLARE FONT SIZE PARAMETER VARIABLES
 
 \fp_const:Nn \c_fontscale_tiny_step_fp         { -4 }
 \fp_const:Nn \c_fontscale_scriptsize_step_fp   { -3 }
@@ -74,32 +73,8 @@
 \skip_new:N \l_fontscale_huge_baselineskip_skip
 \skip_new:N \l_fontscale_Huge_baselineskip_skip
 
-\prop_new:N \l_fontscale_tiny_prop
-\prop_new:N \l_fontscale_scriptsize_prop
-\prop_new:N \l_fontscale_footnotesize_prop
-\prop_new:N \l_fontscale_small_prop
-\prop_new:N \l_fontscale_normalsize_prop
-\prop_new:N \l_fontscale_large_prop
-\prop_new:N \l_fontscale_Large_prop
-\prop_new:N \l_fontscale_LARGE_prop
-\prop_new:N \l_fontscale_huge_prop
-\prop_new:N \l_fontscale_Huge_prop
+% INITIALIZE FONT SIZE PARAMETER VARIABLES
 
-\prop_put:Nnn \l_fontscale_tiny_prop         { step } { -4 }
-\prop_put:Nnn \l_fontscale_scriptsize_prop   { step } { -3 }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { step } { -2 }
-\prop_put:Nnn \l_fontscale_small_prop        { step } { -1 }
-\prop_put:Nnn \l_fontscale_normalsize_prop   { step } {  0 }
-\prop_put:Nnn \l_fontscale_large_prop        { step } {  1 }
-\prop_put:Nnn \l_fontscale_Large_prop        { step } {  2 }
-\prop_put:Nnn \l_fontscale_LARGE_prop        { step } {  3 }
-\prop_put:Nnn \l_fontscale_huge_prop         { step } {  4 }
-\prop_put:Nnn \l_fontscale_Huge_prop         { step } {  5 }
-
-\prop_put:Nnn \l_fontscale_normalsize_prop { scale } { 1 }
-
-% INITIALIZE FONT PARAMETER VARIABLES
-
 \fp_set:Nn \l_fontscale_tiny_scale_fp         { 0.6 }
 \fp_set:Nn \l_fontscale_scriptsize_scale_fp   { 0.7 }
 \fp_set:Nn \l_fontscale_footnotesize_scale_fp { 0.8 }
@@ -132,132 +107,144 @@
 \skip_set:Nn \l_fontscale_huge_baselineskip_skip         { 19.2pt }
 \skip_set:Nn \l_fontscale_Huge_baselineskip_skip         { 21.6pt }
 
-\prop_put:Nnn \l_fontscale_tiny_prop         { scale } { 0.6 }
-\prop_put:Nnn \l_fontscale_scriptsize_prop   { scale } { 0.7 }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { scale } { 0.8 }
-\prop_put:Nnn \l_fontscale_small_prop        { scale } { 0.9 }
-\prop_put:Nnn \l_fontscale_large_prop        { scale } { 1.1 }
-\prop_put:Nnn \l_fontscale_Large_prop        { scale } { 1.2 }
-\prop_put:Nnn \l_fontscale_LARGE_prop        { scale } { 1.4 }
-\prop_put:Nnn \l_fontscale_huge_prop         { scale } { 1.6 }
-\prop_put:Nnn \l_fontscale_Huge_prop         { scale } { 1.8 }
-
-\prop_put:Nnn \l_fontscale_tiny_prop         { size } {  6pt }
-\prop_put:Nnn \l_fontscale_scriptsize_prop   { size } {  7pt }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { size } {  8pt }
-\prop_put:Nnn \l_fontscale_small_prop        { size } {  9pt }
-\prop_put:Nnn \l_fontscale_normalsize_prop   { size } { 10pt }
-\prop_put:Nnn \l_fontscale_large_prop        { size } { 11pt }
-\prop_put:Nnn \l_fontscale_Large_prop        { size } { 12pt }
-\prop_put:Nnn \l_fontscale_LARGE_prop        { size } { 14pt }
-\prop_put:Nnn \l_fontscale_huge_prop         { size } { 16pt }
-\prop_put:Nnn \l_fontscale_Huge_prop         { size } { 18pt }
-
-\prop_put:Nnn \l_fontscale_tiny_prop         { baselineskip } {  7.2pt }
-\prop_put:Nnn \l_fontscale_scriptsize_prop   { baselineskip } {  8.4pt }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { baselineskip } {  9.6pt }
-\prop_put:Nnn \l_fontscale_small_prop        { baselineskip } { 10.8pt }
-\prop_put:Nnn \l_fontscale_normalsize_prop   { baselineskip } { 12  pt }
-\prop_put:Nnn \l_fontscale_large_prop        { baselineskip } { 13.2pt }
-\prop_put:Nnn \l_fontscale_Large_prop        { baselineskip } { 14.4pt }
-\prop_put:Nnn \l_fontscale_LARGE_prop        { baselineskip } { 16.8pt }
-\prop_put:Nnn \l_fontscale_huge_prop         { baselineskip } { 19.2pt }
-\prop_put:Nnn \l_fontscale_Huge_prop         { baselineskip } { 21.6pt }
-
 % SOME VARIABLES
 
-% Used for mapping.
-\tl_const:Nn \c__fontscale_names_tl
-  {
-    {tiny} {scriptsize} {footnotesize} {small} {normalsize}
-    {large} {Large} {LARGE} {huge} {Huge}
-  }
-\tl_const:Nn \c__fontscale_names_other_tl
-  {
-    {tiny} {scriptsize} {footnotesize} {small}
-    {large} {Large} {LARGE} {huge} {Huge}
-  }
-
 % Used to speed up floating point calculations.
 \fp_new:N \l__fontscale_normalsize_size_fp
 \fp_set:Nn \l__fontscale_normalsize_size_fp { 10 }
+\fp_new:N \l__fontscale_musical_base_fp
 \fp_new:N \l__fontscale_musical_notes_fp
 
-% Temporary variables
-\tl_new:N  \l__fontscale_step_tl
-\tl_new:N  \l__fontscale_scale_tl
-\dim_new:N \l__fontscale_size_dim
+% Scratch variables
+\tl_new:N  \l__fontscale_tmp_tl
+\dim_new:N \l__fontscale_tmp_dim
+\fp_new:N  \l__fontscale_tmp_fp
 
 % SOME HELPER FUNCTIONS
 
-% Sets a dimen/skip variable from a dimen/skip expression, supplying a default
+% Sets a dimen/skip variable from a dimen/skip expression, appending a default
 % unit of pt.
-\cs_new_protected:Npn \__fontscale_dim_set_with_default_pt:Nn #1#2
+\cs_new_protected:Npn \__fontscale_dim_set_default_pt:Nn #1#2
   { \@defaultunits #1 = \dimexpr #2 pt \relax \relax \@nnil }
-\cs_generate_variant:Nn \__fontscale_dim_set_with_default_pt:Nn { c }
-\cs_new_protected:Npn \__fontscale_skip_set_with_default_pt:Nn #1#2
+\cs_generate_variant:Nn \__fontscale_dim_set_default_pt:Nn { c }
+\cs_new_protected:Npn \__fontscale_skip_set_default_pt:Nn #1#2
   { \@defaultunits #1 = \glueexpr #2 pt \relax \@nnil }
-\cs_generate_variant:Nn \__fontscale_skip_set_with_default_pt:Nn { c }
-% Used to define \tiny to \Huge. Need \dim_use:N for compatibility with the
-% microtype package. Otherwise the following would do:
-% \cs_new_protected:Npn \__fontscale_fontsize:NNN { \@setfontsize }
-\cs_new_protected:Npn \__fontscale_fontsize:NNN #1#2
-  { \@setfontsize #1 { \dim_use:N #2 } }
-% Similar to \fontsize + \selectfont, except that it takes dimen and skip
-% expressions as arguments and avoids the issue where \f at size is set to the new
-% font size before the second argument is expanded.
+\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.
+\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
+      }
+  }
+% Similar to \fontsize + \selectfont, except that it:
+% (1) Takes dimen and skip expressions as arguments.
+% (2) Avoids the issue where \f at size is set to the new font size before the
+% second argument is expanded.
+% (3) Provides error checking for the font size and font baselineskip.
+\dim_new:N  \l__fontscale_fontsize_dim
 \skip_new:N \l__fontscale_fontsize_skip
 \cs_new_protected:Npn \__fontscale_fontsize:nn #1#2
   {
-    \__fontscale_skip_set_with_default_pt:Nn \l__fontscale_fontsize_skip {#2}
-    \fontsize { = \dimexpr #1 pt \relax \relax } \l__fontscale_fontsize_skip
-    \selectfont
+    \__fontscale_dim_set_default_pt:Nn  \l__fontscale_fontsize_dim  {#1}
+    \__fontscale_skip_set_default_pt:Nn \l__fontscale_fontsize_skip {#2}
+    \dim_compare:nNnTF \l__fontscale_fontsize_dim > \c_zero_dim
+      {
+        \dim_compare:nNnTF \l__fontscale_fontsize_skip <
+          \l__fontscale_fontsize_dim
+          { \msg_error:nn { fontscale } { font-baselineskip-out-of-bounds } }
+          {
+            \fontsize \l__fontscale_fontsize_dim \l__fontscale_fontsize_skip
+            \selectfont
+          }
+      }
+      { \msg_error:nn { fontscale } { font-size-out-of-bounds } }
   }
 % Similar to the above function, except that it sets the font baselineskip
 % equal to the new font size times the baselineskip-size-ratio.
 \cs_new_protected:Npn \__fontscale_fontsize:n #1
   {
-    \fontsize { = \dimexpr #1 pt \relax \relax }
-      { \fp_to_dim:n { \f at size * \l__fontscale_baselineskip_size_ratio_fp } }
-    \selectfont
+    \__fontscale_dim_set_default_pt:Nn \l__fontscale_fontsize_dim {#1}
+    \dim_compare:nNnTF \l__fontscale_fontsize_dim > \c_zero_dim
+      {
+        \fontsize \l__fontscale_fontsize_dim
+          {
+            \fp_to_dim:n
+              {
+                \l__fontscale_fontsize_dim
+                * \l__fontscale_baselineskip_size_ratio_fp
+              }
+          }
+        \selectfont
+      }
+      { \msg_error:nn { fontscale } { font-size-out-of-bounds } }
   }
 
 % MESSAGES
 
-\msg_new:nnn { fontscale } { modular-ratio-out-of-bounds }
+\msg_new:nnn { fontscale } { key-baselineskip-size-ratio-out-of-bounds }
   {
-    The~ value~ for~ the~ key~ 'modular / ratio'~
+    The~ value~ of~ the~ key~ 'baselineskip-size-ratio'~
     \msg_line_context: \c_space_tl
-    must~ be~ greater~ than~ 1.
+    must~ be~ at~ least~ 1.
   }
-\msg_new:nnn { fontscale } { musical-ratio-out-of-bounds }
+\msg_new:nnn { fontscale } { key-musical-base-out-of-bounds }
   {
-    The~ value~ for~ the~ key~ 'musical / ratio'~
+    The~ value~ of~ the~ key~ 'musical / base'~
     \msg_line_context: \c_space_tl
+    must~ be~ a~ positive~ length.
+  }
+\msg_new:nnn { fontscale } { key-musical-ratio-out-of-bounds }
+  {
+    The~ value~ of~ the~ key~ 'musical / ratio'~
+    \msg_line_context: \c_space_tl
     must~ be~ greater~ than~ 1.
   }
-\msg_new:nnn { fontscale } { musical-notes-out-of-bounds }
+\msg_new:nnn { fontscale } { key-musical-notes-out-of-bounds }
   {
-    The~ value~ for~ the~ key~ 'musical / notes'~
+    The~ value~ of~ the~ key~ 'musical / notes'~
     \msg_line_context: \c_space_tl
     must~ be~ a~ positive~ integer.
   }
-\msg_new:nnn { fontscale } { key-font-scale-ignored }
+\msg_new:nnn { fontscale } { key-font-scale-out-of-bounds }
   {
-    Key~ '#1 / scale'~
+    The~ value~ of~ the~ key~ '#1 / scale'~
     \msg_line_context: \c_space_tl
-    ignored.~
-    Setting~ the~ scale~ and~ size~ keys~ for~ the~ same~
-    font~ size~ command~ ignores~ the~ scale~ key.
+    must~ be~ positive.
   }
+\msg_new:nnn { fontscale } { key-font-size-out-of-bounds }
+  {
+    The~ value~ of~ the~ key~ '#1 / size'~
+    \msg_line_context: \c_space_tl
+    must~ be~ a~ positive~ length.
+  }
+\msg_new:nnn { fontscale } { key-font-scale-overwritten }
+  {
+    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-baselineskip-out-of-bounds }
+  {
+    The~ value~ of~ the~ key~ '#1 / baselineskip'~
+    \msg_line_context: \c_space_tl
+    must~ be~ greater~ than~ or~ equal~ to~
+    the~ font~ size~ of~ '\iow_char:N \\#1'.
+  }
 \msg_new:nnn { fontscale } { font-sizes-out-of-order }
   {
     The~ font~ sizes~
     \msg_line_context: \c_space_tl
     are~ not~ in~ the~ correct~ order.~
-    The~ magnitude~ of~ the~ font~ sizes~ should~ be~ ordered~ from~
-    '\iow_char:N \\tiny'~ to~ '\iow_char:N \\normalsize'~ to~
-    '\iow_char:N \\Huge'.
+    The~ lengths~ of~ the~ font~ sizes~ should~ be~ ordered~ from~
+    '\iow_char:N \\tiny'~ to~ '\iow_char:N \\Huge'.
   }
 \msg_new:nnn { fontscale } { font-baselineskips-out-of-order }
   {
@@ -264,17 +251,40 @@
     The~ font~ baselineskips~
     \msg_line_context: \c_space_tl
     are~ not~ in~ the~ correct~ order.~
-    The~ magnitude~ of~ the~ font~ baselineskips~ should~ be~ ordered~ from~
-    '\iow_char:N \\tiny'~ to~ '\iow_char:N \\normalsize'~ to~
-    '\iow_char:N \\Huge'.
+    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'~
+    \msg_line_context: \c_space_tl
+    does~ nothing~ if~ used~ in~ math~ mode.
+  }
+\msg_new:nnn { fontscale } { math-mode-error }
+  {
+    '#1'~
+    \msg_line_context: \c_space_tl
+    cannot~ be~ used~ in~ math~ mode.
+  }
+\msg_new:nnn { fontscale } { font-size-out-of-bounds }
+  {
+    The~ font~ size~
+    \msg_line_context: \c_space_tl
+    must~ be~ a~ positive~ length.
+  }
+\msg_new:nnn { fontscale } { font-baselineskip-out-of-bounds }
+  {
+    The~ font~ baselineskip~
+    \msg_line_context: \c_space_tl
+    must~ be~ greater~ than~ or~ equal~ to~ the~ font~ size.
+  }
 \msg_new:nnn { fontscale } { font-step-out-of-bounds }
   {
     The~ font~ step~
     \msg_line_context: \c_space_tl
-    must~ be~ an~ integer~ from~ -4~ to~ 5,~
-    unless~ the~ value~ for~ the~ choice~ key~ 'typographic-scale'~
-    is~ 'modular'~ or~ 'musical'.
+    must~ equal~ an~ integer~ from~ -4~ to~ 5,~
+    unless~ the~ value~ of~ the~ key~ 'typographic-scale'~ is~ 'musical'.
   }
 \msg_new:nnn { fontscale } { current-font-step-out-of-bounds }
   {
@@ -281,28 +291,35 @@
     '\iow_char:N \\SetFontStep*'~
     \msg_line_context: \c_space_tl
     could~ not~ calculate~ the~ new~ font~ step~ because~
-    the~ current~ font~ step~ is~ undefined.
+    the~ current~ font~ step~ is~ undefined.~
+    \msg_see_documentation_text:n { fontscale }
   }
 
 % DEFINE KEYS
 
 \str_new:N \l__fontscale_typographic_scale_str
+\dim_new:N \l__fontscale_musical_base_dim
 
+\cs_new_protected:Npn \__fontscale_keys_name:n #1
+  {
+    \tl_if_in:nnTF {#1} { / }
+      { \__fontscale_keys_name_split:ww #1 \q_stop }
+      { \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1} }
+  }
+\cs_new_protected:Npn \__fontscale_keys_name_split:ww #1 / #2 \q_stop
+  {
+    \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1}
+    \tl_set:cn { l__fontscale_ \l_keys_key_str _baselineskip_tl } {#2}
+  }
+
 \keys_define:nn { fontscale }
   {
-      reset .choices:nn = { initial , preamble }
-        { \use:c { __fontscale_keys_precompile_#1: } }
-    , reset .default:n = initial
-
-    , ignore-order .bool_set:N = \l__fontscale_ignore_order_bool
-    , ignore-order .default:n = true
-
-    , baselineskip-size-ratio .fp_set:N =
+      baselineskip-size-ratio .fp_set:N =
         \l__fontscale_baselineskip_size_ratio_fp
     , baselineskip-size-ratio .value_required:n = true
 
     , typographic-scale .choices:nn =
-        { classic-10pt , classic-11pt , classic-12pt , modular , musical }
+        { classic-10pt , classic-11pt , classic-12pt , musical }
         { \str_set:Nn \l__fontscale_typographic_scale_str {#1} }
     , typographic-scale .value_required:n = true
 
@@ -315,18 +332,16 @@
     , classic-12pt .meta:n = { typographic-scale = classic-12pt }
     , classic-12pt .value_forbidden:n = true
 
-    , modular .meta:n = { typographic-scale = modular }
-    , modular .value_forbidden:n = true
-
     , musical .meta:n = { typographic-scale = musical }
     , musical .value_forbidden:n = true
-
-    , modular / ratio .fp_set:N = \l__fontscale_modular_ratio_fp
-    , modular / ratio .value_required:n = true
   }
 \keys_define:nn { fontscale / musical }
   {
-      ratio .fp_set:N = \l__fontscale_musical_ratio_fp
+      base .code:n =
+        \__fontscale_dim_set_default_pt:Nn \l__fontscale_musical_base_dim {#1}
+    , base .value_required:n = true
+
+    , ratio .fp_set:N = \l__fontscale_musical_ratio_fp
     , ratio .value_required:n = true
 
     , notes .int_set:N = \l__fontscale_musical_notes_int
@@ -441,58 +456,46 @@
   }
 \keys_define:nn { fontscale }
   {
-      tiny .code:n = \__fontscale_keys_name_code:n {#1}
+      tiny .code:n = \__fontscale_keys_name:n {#1}
     , tiny .value_required:n = true
 
-    , scriptsize .code:n = \__fontscale_keys_name_code:n {#1}
+    , scriptsize .code:n = \__fontscale_keys_name:n {#1}
     , scriptsize .value_required:n = true
 
-    , footnotesize .code:n = \__fontscale_keys_name_code:n {#1}
+    , footnotesize .code:n = \__fontscale_keys_name:n {#1}
     , footnotesize .value_required:n = true
 
-    , small .code:n = \__fontscale_keys_name_code:n {#1}
+    , small .code:n = \__fontscale_keys_name:n {#1}
     , small .value_required:n = true
 
-    , normalsize .code:n = \__fontscale_keys_name_code:n {#1}
+    , normalsize .code:n = \__fontscale_keys_name:n {#1}
     , normalsize .value_required:n = true
 
-    , large .code:n = \__fontscale_keys_name_code:n {#1}
+    , large .code:n = \__fontscale_keys_name:n {#1}
     , large .value_required:n = true
 
-    , Large .code:n = \__fontscale_keys_name_code:n {#1}
+    , Large .code:n = \__fontscale_keys_name:n {#1}
     , Large .value_required:n = true
 
-    , LARGE .code:n = \__fontscale_keys_name_code:n {#1}
+    , LARGE .code:n = \__fontscale_keys_name:n {#1}
     , LARGE .value_required:n = true
 
-    , huge .code:n = \__fontscale_keys_name_code:n {#1}
+    , huge .code:n = \__fontscale_keys_name:n {#1}
     , huge .value_required:n = true
 
-    , Huge .code:n = \__fontscale_keys_name_code:n {#1}
+    , Huge .code:n = \__fontscale_keys_name:n {#1}
     , Huge .value_required:n = true
   }
-\cs_new_protected:Npn \__fontscale_keys_name_code:n #1
-  {
-    \str_if_in:nnTF {#1} { / }
-      { \__fontscale_keys_name_code_split:ww #1 \q_stop }
-      { \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1} }
-  }
-\cs_new_protected:Npn \__fontscale_keys_name_code_split:ww #1 / #2 \q_stop
-  {
-    \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1}
-    \tl_set:cn { l__fontscale_ \l_keys_key_str _baselineskip_tl } {#2}
-  }
 
-% PRE-COMPILE KEYS
+% 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.
-\cs_new_protected:Npn \__fontscale_keys_precompile_initial:
+\cs_new_protected:Npn \__fontscale_keys_set_initial:
   {
-    \bool_set_false:N \l__fontscale_ignore_order_bool
     \fp_set:Nn  \l__fontscale_baselineskip_size_ratio_fp { 1.2 }
     \str_set:Nn \l__fontscale_typographic_scale_str      { classic-10pt }
-    \fp_set:Nn  \l__fontscale_modular_ratio_fp           { 1.125 }
+    \dim_set:Nn \l__fontscale_musical_base_dim           { 10pt }
     \fp_set:Nn  \l__fontscale_musical_ratio_fp           { 2 }
     \int_set:Nn \l__fontscale_musical_notes_int          { 5 }
 
@@ -528,98 +531,23 @@
     \tl_set:Nn \l__fontscale_huge_baselineskip_tl         { \q_no_value }
     \tl_set:Nn \l__fontscale_Huge_baselineskip_tl         { \q_no_value }
   }
-\__fontscale_keys_precompile_initial:
+\__fontscale_keys_set_initial:
 
-% Pre-compiles the keys with their values at the end of the preamble. The keys
-% are pre-compiled by hand for speed.
-\cs_new_eq:NN \__fontscale_keys_precompile_preamble: \prg_do_nothing:
-% \AddToHook is passed only a single token for speed.
-\AddToHook { begindocument / before }
-  { \__fontscale_keys_precompile_preamble_set: }
-\cs_new_protected:Npn \__fontscale_keys_precompile_preamble_set:
+% SET AND PROCESS KEYS
+
+\NewDocumentCommand \fontscalesetup { s m }
   {
-    \cs_set_protected:Npe \__fontscale_keys_precompile_preamble:
+    \mode_if_math:TF
       {
-        \bool_if:NTF \l__fontscale_ignore_order_bool
-          { \bool_set_true:N } { \bool_set_false:N }
-          \exp_not:N \l__fontscale_ignore_order_bool
-        \fp_set:Nn \exp_not:N \l__fontscale_baselineskip_size_ratio_fp
-          { \exp_not:V \l__fontscale_baselineskip_size_ratio_fp }
-        \str_set:Nn \exp_not:N \l__fontscale_typographic_scale_str
-          { \l__fontscale_typographic_scale_str }
-        \fp_set:Nn \exp_not:N \l__fontscale_modular_ratio_fp
-          { \exp_not:V \l__fontscale_modular_ratio_fp }
-        \fp_set:Nn \exp_not:N \l__fontscale_musical_ratio_fp
-          { \exp_not:V \l__fontscale_musical_ratio_fp }
-        \int_set:Nn \exp_not:N \l__fontscale_musical_notes_int
-          { \int_use:N \l__fontscale_musical_notes_int }
-
-        \tl_set:Nn \exp_not:N \l__fontscale_tiny_scale_tl
-          { \exp_not:V \l__fontscale_tiny_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_scale_tl
-          { \exp_not:V \l__fontscale_scriptsize_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_scale_tl
-          { \exp_not:V \l__fontscale_footnotesize_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_small_scale_tl
-          { \exp_not:V \l__fontscale_small_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_large_scale_tl
-          { \exp_not:V \l__fontscale_large_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Large_scale_tl
-          { \exp_not:V \l__fontscale_Large_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_LARGE_scale_tl
-          { \exp_not:V \l__fontscale_LARGE_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_huge_scale_tl
-          { \exp_not:V \l__fontscale_huge_scale_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Huge_scale_tl
-          { \exp_not:V \l__fontscale_Huge_scale_tl }
-
-        \tl_set:Nn \exp_not:N \l__fontscale_tiny_size_tl
-          { \exp_not:V \l__fontscale_tiny_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_size_tl
-          { \exp_not:V \l__fontscale_scriptsize_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_size_tl
-          { \exp_not:V \l__fontscale_footnotesize_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_small_size_tl
-          { \exp_not:V \l__fontscale_small_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_normalsize_size_tl
-          { \exp_not:V \l__fontscale_normalsize_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_large_size_tl
-          { \exp_not:V \l__fontscale_large_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Large_size_tl
-          { \exp_not:V \l__fontscale_Large_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_LARGE_size_tl
-          { \exp_not:V \l__fontscale_LARGE_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_huge_size_tl
-          { \exp_not:V \l__fontscale_huge_size_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Huge_size_tl
-          { \exp_not:V \l__fontscale_Huge_size_tl }
-
-        \tl_set:Nn \exp_not:N \l__fontscale_tiny_baselineskip_tl
-          { \exp_not:V \l__fontscale_tiny_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_baselineskip_tl
-          { \exp_not:V \l__fontscale_scriptsize_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_baselineskip_tl
-          { \exp_not:V \l__fontscale_footnotesize_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_small_baselineskip_tl
-          { \exp_not:V \l__fontscale_small_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_normalsize_baselineskip_tl
-          { \exp_not:V \l__fontscale_normalsize_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_large_baselineskip_tl
-          { \exp_not:V \l__fontscale_large_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Large_baselineskip_tl
-          { \exp_not:V \l__fontscale_Large_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_LARGE_baselineskip_tl
-          { \exp_not:V \l__fontscale_LARGE_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_huge_baselineskip_tl
-          { \exp_not:V \l__fontscale_huge_baselineskip_tl }
-        \tl_set:Nn \exp_not:N \l__fontscale_Huge_baselineskip_tl
-          { \exp_not:V \l__fontscale_Huge_baselineskip_tl }
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \fontscalesetup }
       }
+      {
+        \IfBooleanTF #1
+          { \__fontscale_keys_reset:n {#2} }
+          { \__fontscale_keys_set:n   {#2} }
+      }
   }
-
-% PROCESS KEYS
-
-\NewDocumentCommand \fontscalesetup { m } { \__fontscale_keys_set:n {#1} }
 \cs_new_protected:Npn \__fontscale_keys_set:n #1
   {
     \keys_set:nn { fontscale } {#1}
@@ -628,35 +556,40 @@
     \prg_break:
     \prg_break_point:
   }
+\cs_new_protected:Npn \__fontscale_keys_reset:n
+  { \__fontscale_keys_set_initial: \__fontscale_keys_set:n }
 \cs_new_protected:Npn \__fontscale_keys_process:
   {
-    \__fontscale_keys_process_check_modular_musical:
+    \__fontscale_keys_process_start:
     \__fontscale_keys_process_normalsize:
     \__fontscale_keys_process_other:
     \__fontscale_keys_process_check_order:
   }
-% Issues an error if the key 'modular/ratio', 'musical/ratio', or
-% 'musical/notes' is set to an impossible value.
-\cs_new_protected:Npn \__fontscale_keys_process_check_modular_musical:
+\cs_new_protected:Npn \__fontscale_keys_process_start:
   {
-    \fp_compare:nNnF \l__fontscale_modular_ratio_fp > \c_one_fp
+    \fp_compare:nNnT \l__fontscale_baselineskip_size_ratio_fp < \c_one_fp
       {
-        \msg_error:nn { fontscale } { modular-ratio-out-of-bounds }
+        \msg_error:nn { fontscale }
+          { key-baselineskip-size-ratio-out-of-bounds }
         \prg_break:
       }
+    \dim_compare:nNnF \l__fontscale_musical_base_dim > \c_zero_dim
+      {
+        \msg_error:nn { fontscale } { key-musical-base-out-of-bounds }
+        \prg_break:
+      }
     \fp_compare:nNnF \l__fontscale_musical_ratio_fp > \c_one_fp
       {
-        \msg_error:nn { fontscale } { musical-ratio-out-of-bounds }
+        \msg_error:nn { fontscale } { key-musical-ratio-out-of-bounds }
         \prg_break:
       }
     \int_compare:nNnF \l__fontscale_musical_notes_int > 0
       {
-        \msg_error:nn { fontscale } { musical-notes-out-of-bounds }
+        \msg_error:nn { fontscale } { key-musical-notes-out-of-bounds }
         \prg_break:
       }
   }
-% Sets the size and baselineskip of \normalsize and updates their property list
-% entries.
+% Sets the font size and font baselineskip of \normalsize.
 \cs_new_protected:Npn \__fontscale_keys_process_normalsize:
   {
     \quark_if_no_value:NTF \l__fontscale_normalsize_size_tl
@@ -663,20 +596,25 @@
       {
         \dim_set:Nn \l_fontscale_normalsize_size_dim
           {
-            \str_case:VnF \l__fontscale_typographic_scale_str
+            \str_case:Vn \l__fontscale_typographic_scale_str
               {
+                { classic-10pt } { 10pt }
                 { classic-11pt } { 11pt }
                 { classic-12pt } { 12pt }
+                { musical } { \l__fontscale_musical_base_dim }
               }
-              { 10pt }
           }
       }
       {
-        \__fontscale_dim_set_with_default_pt:Nn
-          \l_fontscale_normalsize_size_dim { \l__fontscale_normalsize_size_tl }
+        \__fontscale_dim_set_default_pt:Nn \l_fontscale_normalsize_size_dim
+          { \l__fontscale_normalsize_size_tl }
+        \dim_compare:nNnF \l_fontscale_normalsize_size_dim > \c_zero_dim
+          {
+            \msg_error:nnn { fontscale } { key-font-size-out-of-bounds }
+              { normalsize }
+            \prg_break:
+          }
       }
-    \prop_put:NnV \l_fontscale_normalsize_prop { size }
-      \l_fontscale_normalsize_size_dim
     \fp_set:Nn \l__fontscale_normalsize_size_fp
       { \l_fontscale_normalsize_size_dim }
     \quark_if_no_value:NTF \l__fontscale_normalsize_baselineskip_tl
@@ -691,12 +629,17 @@
           }
       }
       {
-        \__fontscale_skip_set_with_default_pt:Nn
+        \__fontscale_skip_set_default_pt:Nn
           \l_fontscale_normalsize_baselineskip_skip
           { \l__fontscale_normalsize_baselineskip_tl }
+        \dim_compare:nNnT \l_fontscale_normalsize_baselineskip_skip <
+          \l_fontscale_normalsize_size_dim
+          {
+            \msg_error:nnn { fontscale }
+              { key-font-baselineskip-out-of-bounds } { normalsize }
+            \prg_break:
+          }
       }
-    \prop_put:NnV \l_fontscale_normalsize_prop { baselineskip }
-      \l_fontscale_normalsize_baselineskip_skip
   }
 % Auxiliary functions that expand to the font size depending on the name of the
 % font size command.
@@ -745,57 +688,55 @@
         { Huge         } { 24pt }
       }
   }
-\cs_new:Npn \__fontscale_keys_process_other_modular:n #1
-  {
-    \fp_to_dim:n
-      {
-        \l__fontscale_normalsize_size_fp * \l__fontscale_modular_ratio_fp
-        ^ \use:c { c_fontscale_#1_step_fp }
-      }
-  }
 \cs_new:Npn \__fontscale_keys_process_other_musical:n #1
   {
     \fp_to_dim:n
       {
-        \l__fontscale_normalsize_size_fp * \l__fontscale_musical_ratio_fp
+        \l__fontscale_musical_base_fp * \l__fontscale_musical_ratio_fp
         ^ ( \use:c { c_fontscale_#1_step_fp }
         / \l__fontscale_musical_notes_fp )
       }
   }
-% Sets the size, scale, and baselineskip of the other font size commands and
-% updates their property list entries. Issues a warning if the user sets both
-% the scale and size keys for the same font size command.
+% Sets the font size, font scale, and font baselineskip of the other font size
+% commands.
 \cs_new_protected:Npn \__fontscale_keys_process_other:
   {
-    \cs_set_eq:Nc \__fontscale_keys_process_other_typographic_scale:n
+    \str_case:Vn \l__fontscale_typographic_scale_str
       {
-        \str_case:Vn \l__fontscale_typographic_scale_str
-          {
-            { classic-10pt } { __fontscale_keys_process_other_classic_xpt:n   }
-            { classic-11pt } { __fontscale_keys_process_other_classic_xipt:n  }
-            { classic-12pt } { __fontscale_keys_process_other_classic_xiipt:n }
-            { modular      } { __fontscale_keys_process_other_modular:n       }
-            { musical      } { __fontscale_keys_process_other_musical:n       }
-          }
+        { classic-10pt }
+        {
+          \cs_set_eq:NN \__fontscale_keys_process_other_fn_aux:n
+            \__fontscale_keys_process_other_classic_xpt:n
+        }
+        { classic-11pt }
+        {
+          \cs_set_eq:NN \__fontscale_keys_process_other_fn_aux:n
+            \__fontscale_keys_process_other_classic_xipt:n
+        }
+        { classic-12pt }
+        {
+          \cs_set_eq:NN \__fontscale_keys_process_other_fn_aux:n
+            \__fontscale_keys_process_other_classic_xiipt:n
+        }
+        { musical }
+        {
+          \cs_set_eq:NN \__fontscale_keys_process_other_fn_aux:n
+            \__fontscale_keys_process_other_musical:n
+          \fp_set:Nn \l__fontscale_musical_base_fp
+            { \l__fontscale_musical_base_dim }
+          \fp_set:Nn \l__fontscale_musical_notes_fp
+            { \l__fontscale_musical_notes_int }
+        }
       }
-    \str_if_eq:VnT \l__fontscale_typographic_scale_str { musical }
+    \tl_map_function:nN
       {
-        \fp_set:Nn \l__fontscale_musical_notes_fp
-          { \l__fontscale_musical_notes_int }
+        {tiny} {scriptsize} {footnotesize} {small}
+        {large} {Large} {LARGE} {huge} {Huge}
       }
-    \tl_map_function:NN \c__fontscale_names_other_tl
-      \__fontscale_keys_process_other_aux:n
+      \__fontscale_keys_process_other_fn:n
   }
-\cs_new_protected:Npn \__fontscale_keys_process_other_aux:n #1
+\cs_new_protected:Npn \__fontscale_keys_process_other_fn:n #1
   {
-    \quark_if_no_value:cF { l__fontscale_#1_size_tl }
-      {
-        \__fontscale_dim_set_with_default_pt:cn { l_fontscale_#1_size_dim }
-          { \use:c { l__fontscale_#1_size_tl } }
-        \quark_if_no_value:cF { l__fontscale_#1_scale_tl }
-          { \msg_warning:nnn { fontscale } { key-font-scale-ignored } {#1} }
-        \prg_break:
-      }
     \quark_if_no_value:cF { l__fontscale_#1_scale_tl }
       {
         \dim_set:cn { l_fontscale_#1_size_dim }
@@ -806,17 +747,42 @@
                 * ( \use:c { l__fontscale_#1_scale_tl } )
               }
           }
+        \dim_compare:nNnF { \use:c { l_fontscale_#1_size_dim } } > \c_zero_dim
+          {
+            \tl_map_break:n
+              {
+                \msg_error:nnn { fontscale } { key-font-scale-out-of-bounds }
+                  {#1}
+                \prg_break:
+              }
+          }
+        \quark_if_no_value:cT { l__fontscale_#1_size_tl } { \prg_break: }
+      }
+    \quark_if_no_value:cF { l__fontscale_#1_size_tl }
+      {
+        \__fontscale_dim_set_default_pt:cn { l_fontscale_#1_size_dim }
+          { \use:c { l__fontscale_#1_size_tl } }
+        \dim_compare:nNnF { \use:c { l_fontscale_#1_size_dim } } > \c_zero_dim
+          {
+            \tl_map_break:n
+              {
+                \msg_error:nnn { fontscale } { key-font-size-out-of-bounds }
+                  {#1}
+                \prg_break:
+              }
+          }
+        \quark_if_no_value:cF { l__fontscale_#1_scale_tl }
+          {
+            \msg_warning:nnn { fontscale } { key-font-scale-overwritten } {#1}
+          }
         \prg_break:
       }
     \dim_set:cn { l_fontscale_#1_size_dim }
-      { \__fontscale_keys_process_other_typographic_scale:n {#1} }
+      { \__fontscale_keys_process_other_fn_aux:n {#1} }
     \prg_break:
     \prg_break_point:
     \fp_set:cn { l_fontscale_#1_scale_fp }
       { \use:c { l_fontscale_#1_size_dim } / \l__fontscale_normalsize_size_fp }
-    \prop_put:cne { l_fontscale_#1_prop } { scale }
-      { \fp_use:c { l_fontscale_#1_scale_fp } }
-    \prop_put:cnv { l_fontscale_#1_prop } { size } { l_fontscale_#1_size_dim }
     \quark_if_no_value:cTF { l__fontscale_#1_baselineskip_tl }
       {
         \skip_set:cn { l_fontscale_#1_baselineskip_skip }
@@ -829,122 +795,113 @@
           }
       }
       {
-        \__fontscale_skip_set_with_default_pt:cn
+        \__fontscale_skip_set_default_pt:cn
           { l_fontscale_#1_baselineskip_skip }
           { \use:c { l__fontscale_#1_baselineskip_tl } }
+        \dim_compare:nNnT { \use:c { l_fontscale_#1_baselineskip_skip } } <
+          { \use:c { l_fontscale_#1_size_dim } }
+          {
+            \tl_map_break:n
+              {
+                \msg_error:nnn { fontscale }
+                  { key-font-baselineskip-out-of-bounds } {#1}
+                \prg_break:
+              }
+          }
       }
-    \prop_put:cnv { l_fontscale_#1_prop } { baselineskip }
-      { l_fontscale_#1_baselineskip_skip }
   }
 % Issues a warning if the font sizes or font baselineskips (ignoring the
-% stretch and shrink components) are not in the correct order unless the value
-% for the key 'ignore-order' is 'true'.
+% stretch and shrink components) are not in the correct order.
 \cs_new_protected:Npn \__fontscale_keys_process_check_order:
   {
-    \bool_if:NF \l__fontscale_ignore_order_bool
+    \dim_compare:nF
       {
-        \dim_compare:nF
-          {
-              \l_fontscale_tiny_size_dim
-            < \l_fontscale_scriptsize_size_dim
-            < \l_fontscale_footnotesize_size_dim
-            < \l_fontscale_small_size_dim
-            < \l_fontscale_normalsize_size_dim
-            < \l_fontscale_large_size_dim
-            < \l_fontscale_Large_size_dim
-            < \l_fontscale_LARGE_size_dim
-            < \l_fontscale_huge_size_dim
-            < \l_fontscale_Huge_size_dim
-          }
-          { \msg_warning:nn { fontscale } { 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 } { font-baselineskips-out-of-order } }
+          \l_fontscale_tiny_size_dim
+        < \l_fontscale_scriptsize_size_dim
+        < \l_fontscale_footnotesize_size_dim
+        < \l_fontscale_small_size_dim
+        < \l_fontscale_normalsize_size_dim
+        < \l_fontscale_large_size_dim
+        < \l_fontscale_Large_size_dim
+        < \l_fontscale_LARGE_size_dim
+        < \l_fontscale_huge_size_dim
+        < \l_fontscale_Huge_size_dim
       }
+      { \msg_warning:nn { fontscale } { 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 } { font-baselineskips-out-of-order } }
   }
 
 % DOCUMENT COMMANDS
 
-% The internal functions of each font size command are not used elsewhere in
-% the code for compatibility with user-defined hooks
-% (e.g. \AddToHook{cmd/normalsize/after}{<user-defined-function>}).
-\DeclareDocumentCommand \tiny { } { \__fontscale_tiny: }
-\cs_new_protected:Npn \__fontscale_tiny:
+% Defines the standard LaTeX font size commands from \tiny to \Huge and
+% initializes to \normalsize.
+\DeclareDocumentCommand \tiny { }
   {
     \__fontscale_fontsize:NNN \tiny \l_fontscale_tiny_size_dim
       \l_fontscale_tiny_baselineskip_skip
   }
-\DeclareDocumentCommand \scriptsize { } { \__fontscale_scriptsize: }
-\cs_new_protected:Npn \__fontscale_scriptsize:
+\DeclareDocumentCommand \scriptsize { }
   {
     \__fontscale_fontsize:NNN \scriptsize \l_fontscale_scriptsize_size_dim
       \l_fontscale_scriptsize_baselineskip_skip
   }
-\DeclareDocumentCommand \footnotesize { } { \__fontscale_footnotesize: }
-\cs_new_protected:Npn \__fontscale_footnotesize:
+\DeclareDocumentCommand \footnotesize { }
   {
     \__fontscale_fontsize:NNN \footnotesize \l_fontscale_footnotesize_size_dim
       \l_fontscale_footnotesize_baselineskip_skip
   }
-\DeclareDocumentCommand \small { } { \__fontscale_small: }
-\cs_new_protected:Npn \__fontscale_small:
+\DeclareDocumentCommand \small { }
   {
     \__fontscale_fontsize:NNN \small \l_fontscale_small_size_dim
       \l_fontscale_small_baselineskip_skip
   }
-\DeclareDocumentCommand \normalsize { } { \__fontscale_normalsize: }
-\cs_new_protected:Npn \__fontscale_normalsize:
+\DeclareDocumentCommand \normalsize { }
   {
     \__fontscale_fontsize:NNN \normalsize \l_fontscale_normalsize_size_dim
       \l_fontscale_normalsize_baselineskip_skip
   }
-\DeclareDocumentCommand \large { } { \__fontscale_large: }
-\cs_new_protected:Npn \__fontscale_large:
+\DeclareDocumentCommand \large { }
   {
     \__fontscale_fontsize:NNN \large \l_fontscale_large_size_dim
       \l_fontscale_large_baselineskip_skip
   }
-\DeclareDocumentCommand \Large { } { \__fontscale_Large: }
-\cs_new_protected:Npn \__fontscale_Large:
+\DeclareDocumentCommand \Large { }
   {
     \__fontscale_fontsize:NNN \Large \l_fontscale_Large_size_dim
       \l_fontscale_Large_baselineskip_skip
   }
-\DeclareDocumentCommand \LARGE { } { \__fontscale_LARGE: }
-\cs_new_protected:Npn \__fontscale_LARGE:
+\DeclareDocumentCommand \LARGE { }
   {
     \__fontscale_fontsize:NNN \LARGE \l_fontscale_LARGE_size_dim
       \l_fontscale_LARGE_baselineskip_skip
   }
-\DeclareDocumentCommand \huge { } { \__fontscale_huge: }
-\cs_new_protected:Npn \__fontscale_huge:
+\DeclareDocumentCommand \huge { }
   {
     \__fontscale_fontsize:NNN \huge \l_fontscale_huge_size_dim
       \l_fontscale_huge_baselineskip_skip
   }
-\DeclareDocumentCommand \Huge { } { \__fontscale_Huge: }
-\cs_new_protected:Npn \__fontscale_Huge:
+\DeclareDocumentCommand \Huge { }
   {
     \__fontscale_fontsize:NNN \Huge \l_fontscale_Huge_size_dim
       \l_fontscale_Huge_baselineskip_skip
   }
-% Initializes to \normalsize.
 \normalsize
 
-\NewExpandableDocumentCommand \CurrentFontStep { }
-  { \__fontscale_current_font_step: }
-\cs_new:Npn \__fontscale_current_font_step:
+\NewExpandableDocumentCommand \CurrentFontStep { } { \__fontscale_step: }
+\cs_new:Npn \__fontscale_step:
   {
     \dim_case:nnF { \f at size pt }
       {
@@ -960,47 +917,41 @@
         { \l_fontscale_Huge_size_dim         } {  5 }
       }
       {
-        \str_case:Vn \l__fontscale_typographic_scale_str
+        \str_if_eq:VnT \l__fontscale_typographic_scale_str { musical }
           {
-            { modular }
-            {
-              \fp_eval:n
-                {
-                  ln ( \f at size / \l__fontscale_normalsize_size_fp )
-                  / ln ( \l__fontscale_modular_ratio_fp )
-                }
-            }
-            { musical }
-            {
-              \fp_eval:n
-                {
-                  \l__fontscale_musical_notes_fp
-                  * ln ( \f at size / \l__fontscale_normalsize_size_fp )
-                  / ln ( \l__fontscale_musical_ratio_fp )
-                }
-            }
+            \fp_eval:n
+              {
+                \l__fontscale_musical_notes_fp
+                * ln ( \f at size / \l__fontscale_musical_base_fp )
+                / ln ( \l__fontscale_musical_ratio_fp )
+              }
           }
       }
   }
 
-\NewExpandableDocumentCommand \CurrentFontScale { }
-  { \__fontscale_current_font_scale: }
-\cs_new:Npn \__fontscale_current_font_scale:
+\NewExpandableDocumentCommand \CurrentFontScale { } { \__fontscale_scale: }
+\cs_new:Npn \__fontscale_scale:
   { \fp_eval:n { \f at size / \l__fontscale_normalsize_size_fp } }
 
-\NewExpandableDocumentCommand \CurrentFontSize { }
-  { \__fontscale_current_font_size: }
-\cs_new:Npn \__fontscale_current_font_size: { \f at size pt }
+\NewExpandableDocumentCommand \CurrentFontSize { } { \__fontscale_size: }
+\cs_new:Npn \__fontscale_size: { \f at size pt }
 
 \NewExpandableDocumentCommand \CurrentFontBaselineskip { }
-  { \__fontscale_current_font_baselineskip: }
-\cs_new:Npn \__fontscale_current_font_baselineskip: { \f at baselineskip }
+  { \__fontscale_baselineskip: }
+\cs_new:Npn \__fontscale_baselineskip: { \f at baselineskip }
 
 \NewDocumentCommand \SetFontStep { s m }
   {
-    \IfBooleanTF #1
-      { \__fontscale_add_font_step:n {#2} }
-      { \__fontscale_set_font_step:n {#2} }
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \SetFontStep }
+      }
+      {
+        \IfBooleanTF #1
+          { \__fontscale_add_font_step:n {#2} }
+          { \__fontscale_set_font_step:n {#2} }
+      }
   }
 % Using \str_case: here is significantly faster (and easier to write) than
 % repeatedly testing \fp_compare:.
@@ -1020,31 +971,17 @@
         {  5 } { \Huge         }
       }
       {
-        \str_case:VnF \l__fontscale_typographic_scale_str
+        \str_if_eq:VnTF \l__fontscale_typographic_scale_str { musical }
           {
-            { modular }
-            {
-              \__fontscale_fontsize:n
-                {
-                  \fp_to_dim:n
-                    {
-                      \l__fontscale_normalsize_size_fp
-                      * \l__fontscale_modular_ratio_fp ^ (#1)
-                    }
-                }
-            }
-            { musical }
-            {
-              \__fontscale_fontsize:n
-                {
-                  \fp_to_dim:n
-                    {
-                      \l__fontscale_normalsize_size_fp
-                      * \l__fontscale_musical_ratio_fp
-                      ^ ( (#1) / \l__fontscale_musical_notes_fp )
-                    }
-                }
-            }
+            \__fontscale_fontsize:n
+              {
+                \fp_to_dim:n
+                  {
+                    \l__fontscale_musical_base_fp
+                    * \l__fontscale_musical_ratio_fp
+                    ^ ( (#1) / \l__fontscale_musical_notes_fp )
+                  }
+              }
           }
           { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
       }
@@ -1051,18 +988,25 @@
   }
 \cs_new_protected:Npn \__fontscale_add_font_step:n #1
   {
-    \tl_set:Ne \l__fontscale_step_tl { \__fontscale_current_font_step: }
-    \tl_if_empty:NTF \l__fontscale_step_tl
+    \tl_set:Ne \l__fontscale_tmp_tl { \__fontscale_step: }
+    \tl_if_empty:NTF \l__fontscale_tmp_tl
       { \msg_error:nn { fontscale } { current-font-step-out-of-bounds } }
-      { \__fontscale_add_font_step_aux:n { (#1) + \l__fontscale_step_tl } }
+      { \__fontscale_add_font_step_aux:n { (#1) + \l__fontscale_tmp_tl } }
   }
 \cs_new_eq:NN \__fontscale_add_font_step_aux:n \__fontscale_set_font_step:n
 
 \NewDocumentCommand \SetFontScale { s m }
   {
-    \IfBooleanTF #1
-      { \__fontscale_add_font_scale:n {#2} }
-      { \__fontscale_set_font_scale:n {#2} }
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \SetFontScale }
+      }
+      {
+        \IfBooleanTF #1
+          { \__fontscale_add_font_scale:n {#2} }
+          { \__fontscale_set_font_scale:n {#2} }
+      }
   }
 \cs_new_protected:Npn \__fontscale_set_font_scale:n #1
   {
@@ -1077,70 +1021,150 @@
 
 \NewDocumentCommand \SetFontSize { s m }
   {
-    \IfBooleanTF #1
-      { \__fontscale_add_font_size:n {#2} }
-      { \__fontscale_set_font_size:n {#2} }
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \SetFontSize }
+      }
+      {
+        \IfBooleanTF #1
+          { \__fontscale_add_font_size:n {#2} }
+          { \__fontscale_set_font_size:n {#2} }
+      }
   }
 \cs_new_eq:NN \__fontscale_set_font_size:n \__fontscale_fontsize:n
 \cs_new_protected:Npn \__fontscale_add_font_size:n #1
   {
-    \__fontscale_dim_set_with_default_pt:Nn \l__fontscale_size_dim {#1}
-    \dim_add:Nn \l__fontscale_size_dim { \f at size pt }
-    \__fontscale_fontsize:n { \l__fontscale_size_dim }
+    \__fontscale_dim_set_default_pt:Nn \l__fontscale_tmp_dim {#1}
+    \__fontscale_fontsize:n { \l__fontscale_tmp_dim + \f at size pt }
   }
 
 \NewDocumentCommand \ScaleFont { m }
-  { \__fontscale_scale_font_size_baselineskip:n {#1} }
-\cs_new_protected:Npn \__fontscale_scale_font_size_baselineskip:n #1
   {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \ScaleFont }
+      }
+      { \__fontscale_scale_font:n {#1} }
+  }
+\cs_new_protected:Npn \__fontscale_scale_font:n #1
+  {
+    \fp_set:Nn \l__fontscale_tmp_fp {#1}
     \__fontscale_fontsize:nn
-      { \fp_to_dim:n { \f at size                          * (#1) } }
-      { \fp_to_dim:n { \dim_to_fp:n { \f at baselineskip } * (#1) } }
+      { \fp_to_dim:n { \f at size * \l__fontscale_tmp_fp } }
+      {
+        \fp_to_dim:n
+          { \dim_to_fp:n { \f at baselineskip } * \l__fontscale_tmp_fp }
+      }
   }
 
 \NewDocumentCommand \SetFontSizeBaselineskip { m m }
-  { \__fontscale_set_font_size_baselineskip:nn {#1} {#2} }
+  {
+    \mode_if_math:TF
+      {
+        \msg_warning:nne { fontscale } { math-mode-warning }
+          { \token_to_str:N \SetFontSizeBaselineskip }
+      }
+      { \__fontscale_set_font_size_baselineskip:nn {#1} {#2} }
+  }
 \cs_new_eq:NN \__fontscale_set_font_size_baselineskip:nn
   \__fontscale_fontsize:nn
 
-\NewDocumentCommand \PrintFontParameters { }
-  { \__fontscale_print_font_parameters: }
-\cs_new_protected:Npn \__fontscale_print_font_parameters:
+\NewDocumentCommand \PrintFontSizeParameters { }
+  { \__fontscale_print_font_size_parameters: }
+\cs_new_protected:Npn \__fontscale_print_font_size_parameters:
   {
-    step         ~=~ \__fontscale_current_font_step:         ,~
-    scale        ~=~ \__fontscale_current_font_scale:        ,~
-    size         ~=~ \__fontscale_current_font_size:         ,~
-    baselineskip ~=~ \__fontscale_current_font_baselineskip:
+    step         ~=~ \__fontscale_step:         ,~
+    scale        ~=~ \__fontscale_scale:        ,~
+    size         ~=~ \__fontscale_size:         ,~
+    baselineskip ~=~ \__fontscale_baselineskip:
   }
 
-\NewDocumentCommand \PrintAllFontParameters { }
-  { \__fontscale_print_all_font_parameters: }
-\cs_new_protected:Npn \__fontscale_print_all_font_parameters:
+\NewDocumentCommand \PrintAllFontSizeParameters { }
   {
-    \tl_map_inline:Nn \c__fontscale_names_tl
+    \mode_if_math:TF
       {
-        \prop_get:cnN { l_fontscale_##1_prop } { step  } \l__fontscale_step_tl
-        \prop_get:cnN { l_fontscale_##1_prop } { scale } \l__fontscale_scale_tl
-        \token_to_str:c {##1} \@ \c_colon_str \c_space_tl
-        step         ~=~ \l__fontscale_step_tl                             ,~
-        scale        ~=~ \l__fontscale_scale_tl                            ,~
-        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 }
+        \msg_error:nne { fontscale } { math-mode-error }
+          { \token_to_str:N \PrintAllFontSizeParameters }
       }
+      { \__fontscale_print_all_font_size_parameters: }
   }
+\cs_new_protected:Npn \__fontscale_print_all_font_size_parameters:
+  {
+    \token_to_str:N \tiny \c_colon_str \c_space_tl
+    step         ~=~ -4                                              ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_tiny_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_tiny_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_tiny_baselineskip_skip
+    \newline
+    \token_to_str:N \scriptsize \c_colon_str \c_space_tl
+    step         ~=~ -3                                                    ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_scriptsize_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_scriptsize_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_scriptsize_baselineskip_skip
+    \newline
+    \token_to_str:N \footnotesize \c_colon_str \c_space_tl
+    step         ~=~ -2                                                      ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_footnotesize_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_footnotesize_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_footnotesize_baselineskip_skip
+    \newline
+    \token_to_str:N \small \c_colon_str \c_space_tl
+    step         ~=~ -1                                               ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_small_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_small_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_small_baselineskip_skip
+    \newline
+    \token_to_str:N \normalsize \c_colon_str \c_space_tl
+    step         ~=~ 0                                                     ,~
+    scale        ~=~ 1                                                     ,~
+    size         ~=~ \dim_use:N  \l_fontscale_normalsize_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_normalsize_baselineskip_skip
+    \newline
+    \token_to_str:N \large \c_colon_str \c_space_tl
+    step         ~=~ 1                                                ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_large_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_large_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_large_baselineskip_skip
+    \newline
+    \token_to_str:N \Large \c_colon_str \c_space_tl
+    step         ~=~ 2                                                ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_Large_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_Large_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_Large_baselineskip_skip
+    \newline
+    \token_to_str:N \LARGE \@ \c_colon_str \c_space_tl
+    step         ~=~ 3                                                ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_LARGE_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_LARGE_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_LARGE_baselineskip_skip
+    \newline
+    \token_to_str:N \huge \c_colon_str \c_space_tl
+    step         ~=~ 4                                               ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_huge_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_huge_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_huge_baselineskip_skip
+    \newline
+    \token_to_str:N \Huge \c_colon_str \c_space_tl
+    step         ~=~ 5                                               ,~
+    scale        ~=~ \fp_use:N   \l_fontscale_Huge_scale_fp          ,~
+    size         ~=~ \dim_use:N  \l_fontscale_Huge_size_dim          ,~
+    baselineskip ~=~ \skip_use:N \l_fontscale_Huge_baselineskip_skip
+  }
 
-\NewDocumentCommand \PrintSampleText
-  { s O
-    {
-      The~ \texttt { fontscale }~ package \c_colon_str \c_space_tl
-      A~ user~ interface~ for~ setting~ document~ font~ sizes
-    }
-  }
+\NewDocumentCommand \PrintSampleText { s +m }
   {
-    \IfBooleanTF #1
-      { \__fontscale_print_sample_text_descending_order:n {#2} }
-      { \__fontscale_print_sample_text_ascending_order:n  {#2} }
+    \mode_if_math:TF
+      {
+        \msg_error:nne { fontscale } { math-mode-error }
+          { \token_to_str:N \PrintSampleText }
+      }
+      {
+        \IfBooleanTF #1
+          { \__fontscale_print_sample_text_descending_order:n {#2} }
+          { \__fontscale_print_sample_text_ascending_order:n  {#2} }
+      }
   }
 \cs_new_protected:Npn \__fontscale_print_sample_text_ascending_order:n #1
   {
@@ -1169,7 +1193,15 @@
     { \tiny         #1 \par }
   }
 
-\NewDocumentCommand \PrintFontSizeCommand { } { \__fontscale_print_name: }
+\NewDocumentCommand \PrintFontSizeCommand { }
+  {
+    \mode_if_math:TF
+      {
+        \msg_error:nne { fontscale } { math-mode-error }
+          { \token_to_str:N \PrintFontSizeCommand }
+      }
+      { \__fontscale_print_name: }
+  }
 \cs_new_protected:Npn \__fontscale_print_name:
   {
     \dim_case:nn { \f at size pt }
@@ -1235,7 +1267,7 @@
             { \token_to_str:N \Huge \prg_break: }
         }
       }
-    UNDEFINED \@
+    \token_to_str:N \undefined
     \prg_break:
     \prg_break_point:
   }
@@ -1242,7 +1274,7 @@
 
 % TEXT PURIFY
 
-\cs_new:Npn \__fontscale_text_purify_equivalent:n #1
+\cs_new:Npn \__fontscale_remove_arg_spec_sm:n #1
   {
     \bool_lazy_all:nT
       {
@@ -1252,11 +1284,13 @@
       }
       { \use_none:n }
   }
+\text_declare_purify_equivalent:Nn \fontscalesetup
+  { \__fontscale_remove_arg_spec_sm:n }
 \text_declare_purify_equivalent:Nn \SetFontStep
-  { \__fontscale_text_purify_equivalent:n }
+  { \__fontscale_remove_arg_spec_sm:n }
 \text_declare_purify_equivalent:Nn \SetFontScale
-  { \__fontscale_text_purify_equivalent:n }
+  { \__fontscale_remove_arg_spec_sm:n }
 \text_declare_purify_equivalent:Nn \SetFontSize
-  { \__fontscale_text_purify_equivalent:n }
+  { \__fontscale_remove_arg_spec_sm:n }
 \text_declare_purify_equivalent:Nn \ScaleFont { \use_none:n }
 \text_declare_purify_equivalent:Nn \SetFontSizeBaselineskip { \use_none:nn }
\ No newline at end of file



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