texlive[73489] Master/texmf-dist: fontscale (17jan25)
commits+karl at tug.org
commits+karl at tug.org
Fri Jan 17 21:19:50 CET 2025
Revision: 73489
https://tug.org/svn/texlive?view=revision&revision=73489
Author: karl
Date: 2025-01-17 21:19:50 +0100 (Fri, 17 Jan 2025)
Log Message:
-----------
fontscale (17jan25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md 2025-01-17 20:19:50 UTC (rev 73489)
@@ -7,6 +7,13 @@
## [Unreleased]
+## [v3.0.6] - 2025-01-17
+
+### Changed
+- `\SetFontStep` now rounds the new font step to 5 decimal places only when
+ testing if it equals the font step of any font size commnad from `\tiny` to
+ `\Huge`.
+
## [v3.0.5] - 2025-01-03
### Changed
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls 2025-01-17 20:19:50 UTC (rev 73489)
@@ -4,14 +4,12 @@
\NeedsTeXFormat{LaTeX2e}[2023-11-01]
\ProvidesExplClass
{beery}
- {2025-01-03}
+ {2025-01-17}
{}
{}
\LoadClass { article }
-\box_new:N \l__beery_tmp_box
-
\RequirePackage { fontscale }
\fontscalesetup { musical }
\RequirePackage { siunitx }
@@ -20,7 +18,6 @@
\RequirePackage [ shortcuts , allowbreakbefore ] { extdash }
\RequirePackage { csquotes }
\RequirePackage { lmodern }
-
\RequirePackage { scaletextbullet }
\RequirePackage { tcolorbox }
@@ -54,7 +51,7 @@
{ #1 $\,=\,$ #2 \hspace* { \fill } \hbox:n { initial $\,=\,$ #3 } }
\group_end:
}
-\NewDocumentCommand \Value { >{ \TrimSpaces } m } { \texttt {#1} }
+\NewDocumentCommand \Value { >{ \TrimSpaces } m } { \texttt {#1} \@ }
\NewDocumentCommand \cmd { >{ \TrimSpaces } m }
{ \texttt { \token_to_str:N #1 } \@ }
\NewDocumentCommand \cs { >{ \TrimSpaces } m }
@@ -64,7 +61,9 @@
\allowbreak
\texttt { \c_left_brace_str }
$\langle$
- { \normalfont \itshape #1 }
+ \group_begin:
+ \normalfont \itshape #1
+ \group_end:
$\rangle$
\texttt { \c_right_brace_str }
}
@@ -73,7 +72,9 @@
\allowbreak
\texttt { [ }
$\langle$
- { \normalfont \itshape #1 }
+ \group_begin:
+ \normalfont \itshape #1
+ \group_end:
$\rangle$
\texttt { ] }
}
@@ -81,18 +82,20 @@
\NewDocumentCommand \meta { >{ \TrimSpaces } m }
{
$\langle$
- { \normalfont \itshape #1 }
+ \group_begin:
+ \normalfont \itshape #1
+ \group_end:
$\rangle$
}
-\NewDocumentCommand \cls { >{ \TrimSpaces } m } { \textsf {#1} }
-\NewDocumentCommand \env { >{ \TrimSpaces } m } { \texttt {#1} }
-\NewDocumentCommand \pkg { >{ \TrimSpaces } m } { \textsf {#1} }
+\NewDocumentCommand \cls { >{ \TrimSpaces } m } { \textsf {#1} \@ }
+\NewDocumentCommand \env { >{ \TrimSpaces } m } { \texttt {#1} \@ }
+\NewDocumentCommand \pkg { >{ \TrimSpaces } m } { \textsf {#1} \@ }
\NewDocumentCommand \latin { >{ \TrimSpaces } m } { \textit {#1} }
% PAGE STYLE
-\hbox_set:Nn \l__beery_tmp_box { \c_beery_alphabet_tl }
-\dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l__beery_tmp_box }
+\hbox_set:Nn \l_tmpa_box { \c_beery_alphabet_tl }
+\dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l_tmpa_box }
\dim_log:N \c_beery_alphabet_dim
\dim_const:Nn \c_beery_big_dim { \l_fontscale_normalsize_baselineskip_skip }
@@ -125,21 +128,22 @@
\skip_set:Nn \topskip { \l_fontscale_normalsize_size_dim }
\skip_set_eq:NN \splittopskip \topskip
\RequirePackage { geometry }
+\dim_const:Nn \c_beery_textwidth_dim
+ { \fp_to_dim:n { \c_e_fp * \dim_to_fp:n { \c_beery_alphabet_dim } } }
+\dim_const:Nn \c_beery_textheight_dim
+ { \fp_to_dim:n { 1.6180 * \dim_to_fp:n { \c_beery_textwidth_dim } } }
+\dim_const:Nn \c_beery_footskip_dim
+ { \c_beery_big_dim + \l_fontscale_footnotesize_baselineskip_skip }
\geometry
{
a4paper
- , textwidth =
- \fp_to_dim:n { \c_e_fp * \dim_to_fp:n { \c_beery_alphabet_dim } }
- , textheight =
- \fp_to_dim:n
- { 1.6180 * \c_e_fp * \dim_to_fp:n { \c_beery_alphabet_dim } }
+ , textwidth = \c_beery_textwidth_dim
+ , textheight = \c_beery_textheight_dim
, heightrounded
, centering
, headheight = \l_fontscale_footnotesize_baselineskip_skip
, headsep = \c_beery_big_dim
- , footskip =
- \dim_eval:n
- { \c_beery_big_dim + \l_fontscale_footnotesize_baselineskip_skip }
+ , footskip = \c_beery_footskip_dim
}
\RequirePackage { fancyhdr }
@@ -155,10 +159,11 @@
\linespread { 1 }
\RequirePackage [ skip = \c_beery_medium_skip ] { parskip }
\RequirePackage [ raggedrightboxes ] { ragged2e }
-\skip_set:Nn \RaggedRightRightskip { 0pt plus 0.5 \linewidth }
+\skip_set:Nn \RaggedRightRightskip { \c_zero_dim plus \c_beery_alphabet_dim }
\dim_zero:N \RaggedRightParindent
\dim_set_eq:NN \JustifyingParindent \RaggedRightParindent
\RaggedRight
+% \justifying
\int_set:Nn \pretolerance { -1 }
\int_set:Nn \tolerance { 200 }
\dim_zero:N \emergencystretch
@@ -165,6 +170,7 @@
\int_set:Nn \widowpenalty { 10000 }
\int_set_eq:NN \clubpenalty \widowpenalty
\int_set_eq:NN \displaywidowpenalty \widowpenalty
+% hyphenation
\int_set:Nn \hyphenpenalty { 99 }
\int_set_eq:NN \exhyphenpenalty \hyphenpenalty
@@ -175,7 +181,7 @@
\setcounter { tocdepth } { 2 }
\titlespacing* \section % section
- { 0pt } % indent
+ { \c_zero_dim } % indent
{
\c_beery_big_dim
plus \fp_to_dim:n { 1 / 2 * 4 * \dim_to_fp:n { \c_beery_big_dim } }
@@ -183,7 +189,7 @@
} % before
{ \c_beery_medium_skip } % after
\titlespacing* \subsection
- { 0pt }
+ { \c_zero_dim }
{
\fp_to_dim:n { 4 / 3 * \dim_to_fp:n { \c_beery_medium_dim } }
plus \fp_to_dim:n { 1 / 2 * 4 * \dim_to_fp:n { \c_beery_medium_dim } }
@@ -215,17 +221,19 @@
leftmargin = *
, labelsep = 0.5em
% vertical spacing
- , topsep = 0pt
- , partopsep = 0pt
+ , topsep = \c_zero_skip
+ , partopsep = \c_zero_skip
, parsep = \c_beery_small_skip
- , itemsep = 0pt
+ , itemsep = \c_zero_skip
}
\setlist [ itemize , 1 ] { label = \textbullet }
\setlist [ itemize , 2 ] { label = \ScaleTextBullets { 2 } }
\setlist [ itemize , 3 ] { label = \ScaleTextBullets { 3 } }
+\setlist [ itemize , 4 ] { label = \ScaleTextBullets { 4 } }
\setlist [ enumerate , 1 ] { label = \arabic* . }
-\setlist [ enumerate , 2 ] { label = \theenumi \arabic* . }
-\setlist [ enumerate , 3 ] { label = \theenumii \arabic* . }
+\setlist [ enumerate , 2 ] { label = \theenumi \arabic* . }
+\setlist [ enumerate , 3 ] { label = \theenumii \arabic* . }
+\setlist [ enumerate , 4 ] { label = \theenumiii \arabic* . }
% list headings
% https://tex.stackexchange.com/questions/2644/how-to-prevent-a-page-break-before-an-itemize-list
@@ -234,7 +242,7 @@
\par
\IfBooleanTF #1
{
- \int_compare:nNnT { \prevgraf } = { 1 }
+ \int_compare:nNnT \prevgraf = 1
{ \nobreak \@afterheading }
}
{ \nobreak \@afterheading }
@@ -244,7 +252,7 @@
\par
#1
\par
- \int_compare:nNnT { \prevgraf } = { 1 }
+ \int_compare:nNnT \prevgraf = 1
{ \nobreak \@afterheading }
\vspace { \skip_eval:n { \c_beery_small_skip - \parskip } }
}
@@ -251,15 +259,6 @@
% TABLES
-\renewcommand \bottomfraction { 1 }
-\renewcommand \topfraction { 1 }
-\skip_set:Nn \textfloatsep
- {
- \c_beery_big_dim
- plus \c_beery_big_dim
- minus \fp_to_dim:n { \dim_to_fp:n { \c_beery_big_dim } / 3 }
- }
-
\RequirePackage { tabularray }
\UseTblrLibrary { booktabs , siunitx }
@@ -302,7 +301,7 @@
\item #1 \endlist
}
\coffin_typeset:Nnnnn \l__beery_footnote_coffin { l } { b }
- { 0pt } { - \c_beery_footnote_baselineheight_dim }
+ { \c_zero_dim } { - \c_beery_footnote_baselineheight_dim }
}
% REFERENCES
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex 2025-01-17 20:19:50 UTC (rev 73489)
@@ -1,4 +1,4 @@
-\ProvidesFile{fontscale-table-classic.tex}[2025-01-03]
+\ProvidesFile{fontscale-table-classic.tex}[2025-01-17]
\begin{table}
\centering
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex 2025-01-17 20:19:50 UTC (rev 73489)
@@ -1,4 +1,4 @@
-\ProvidesFile{fontscale-table-font-steps.tex}[2025-01-03]
+\ProvidesFile{fontscale-table-font-steps.tex}[2025-01-17]
\begin{table}
\centering
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex 2025-01-17 20:19:50 UTC (rev 73489)
@@ -1,4 +1,4 @@
-\ProvidesFile{fontscale-table-musical.tex}[2025-01-03]
+\ProvidesFile{fontscale-table-musical.tex}[2025-01-17]
\begin{table}
\centering
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex 2025-01-17 20:19:50 UTC (rev 73489)
@@ -14,7 +14,7 @@
Oliver Beery
-Version 3.0.5\quad{}3 January 2025
+Version 3.0.6\quad{}17 January 2025
\section{Introduction}
@@ -56,7 +56,7 @@
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}).
+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}).
When loaded, this package uses \cs{normalsize} after defining and initializing the font size commands from \cs{tiny} to \cs{Huge}.
@@ -105,7 +105,7 @@
This section documents the keys provided by the \pkg{fontscale} package.
This package has no package options.
-Set the package keys using \cs{fontscalesetup}\marg{key\-/value list} (\S\ref{subsec:fontscalesetup}).
+Set the package keys using \cs{fontscalesetup}\marg{key$\,=\,$value list} (\S\ref{subsec:fontscalesetup}).
\subsection
{%
@@ -180,8 +180,11 @@
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 initial value is \qty{10}{pt}.
The key \Key{musical\slash{}ratio} sets the musical ratio to the result of computing the \meta{floating point expression}.
+The initial value is \num{2}.
The key \Key{musical\slash{}notes} sets the number of musical notes to the value of \meta{integer expression}.
+The initial value is \num{5}.
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}
@@ -203,6 +206,7 @@
Sets the font baselineskip of each font size command from \cs{tiny} to \cs{Huge} equal to its font size \texttimes{} the result of computing the \meta{floating point expression}.
Sets the font baselineskip set by \cs{SetFontStep}, \cs{SetFontScale}, and \cs{SetFontSize} equal to the new font size \texttimes{} the result of computing the \meta{floating point expression} (\S\ref{subsec:fontsize}).
+The initial value is \num{1.2}.
\subsection{Overwriting the previous keys}
@@ -215,6 +219,9 @@
This is important for typographic and syntactic consistency.
If the font sizes are in the wrong order, \cs{fontscalesetup} will issue a warning and some package features may not work correctly.
+The syntax \meta{font size command} represents the name of a font size command from \cs{tiny} to \cs{Huge}, omitting the backslash character.
+\pagebreak%manual
+
\begin{mydisplaycode}
\Key{\meta{font size command}/scale}[\meta{floating point expression}][\meta{not set}]
\end{mydisplaycode}
@@ -221,8 +228,8 @@
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}.
+These keys are initially not set.
The key \Key{normalsize\slash{}scale} is not defined.
-\pagebreak%manual
\begin{mydisplaycode}
\Key{\meta{font size command}/size}[\meta{dimen expression}][\meta{not set}]
@@ -230,6 +237,7 @@
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}.
+These keys are initially not set.
\begin{mydisplaycode}
\Key{\meta{font size command}/baselineskip}[\meta{skip expression}][\meta{not set}]
@@ -237,6 +245,7 @@
Sets the font baselineskip of \meta{font size command} to the value of \meta{skip expression}, appending a default unit of \unit{pt}.
Overwrites the font baselineskip set by the key \Key{baselineskip-size-ratio}.
+These keys are initially not set.
\begin{mydisplaycode}
\Key{\meta{font size command}}[\meta{dimen expression}]
@@ -262,12 +271,12 @@
\label{subsec:fontscalesetup}
\begin{mydisplaycode}
- \cs{fontscalesetup} \sarg{} \marg{key-value list}
+ \cs{fontscalesetup} \sarg{} \marg{key$\,=\,$value list}
\end{mydisplaycode}
-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 all the \pkg{fontscale} package keys to their initial values.
-The order of the keys in \meta{key\-/value list} does not affect how the keys are processed (unless a key is set more than once).
+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 \sarg{} first resets all the \pkg{fontscale} package keys to their initial values.
+The order of the keys in \meta{key$\,=\,$value list} does not affect how the keys are processed (unless a key is set more than once).
Can be used mid\-/document.
The effect is local to the current group.
Does nothing, except issue a warning, if used in math mode.
@@ -305,17 +314,22 @@
\end{mydisplaycode}
Sets the font size by setting the font step to the result of computing the \meta{floating point expression}.
-Adding the optional star instead sets the font step equal to the current font step + the result of computing the \meta{floating point expression}.
-The font step is rounded to \num{5} decimal places.
+Adding the optional star \sarg{} instead sets the font step equal to the current font step + 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}.
\listheading{Three exceptions:}
\begin{itemize}
\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.
+ 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.%
+ \footnote
+ {%
+ \label{fn:setfontstep}%
+ The font step is rounded to \num{5} decimal places when testing equality due to floating point precision.%
+ }
\item
\cs{SetFontStep} will issue an error if the font step is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
- The font step must equal the font step of any font size command from \cs{tiny} to \cs{Huge} unless the value of the key \Key{typographic-scale} is \Value{musical}.
+ The font step must equal the font step of any font size command from \cs{tiny} to \cs{Huge} unless the value of the key \Key{typographic-scale} is \Value{musical}.%
+ \footnote{See Footnote~\ref{fn:setfontstep}.}
\cs{SetFontStep*} will always issue an error if the current font step is undefined.
\item
Does nothing, except issue a warning, if used in math mode.
@@ -326,7 +340,7 @@
\end{mydisplaycode}
Sets the font size by setting the font scale to the result of computing the \meta{floating point expression}.
-Adding the optional star instead sets the font scale equal to the current font scale + the result of computing the \meta{floating point expression}.
+Adding the optional star \sarg{} instead sets the font scale equal to the current font scale + 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.
@@ -335,10 +349,9 @@
\end{mydisplaycode}
Sets the font size to the value of \meta{dimen expression}, appending a default unit of \unit{pt}.
-Adding the optional star instead sets the font size equal to the current font size + the result of \meta{dimen expression}, appending a default unit of \unit{pt}.
+Adding the optional star \sarg{} instead sets the font size equal to the current font size + 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.
-\pagebreak%manual
\begin{mydisplaycode}
\cs{ScaleFont} \marg{floating point expression}
@@ -367,7 +380,7 @@
\end{mydisplaycode}
Sets the font baselineskip to the value of \meta{skip expression}, appending a default unit of \unit{pt}.
-Adding the optional star instead sets the font baselineskip equal to the current font baselineskip + the result of \meta{skip expression}, appending a default unit of \unit{pt}.
+Adding the optional star \sarg{} instead sets the font baselineskip equal to the current font baselineskip + the result of \meta{skip expression}, appending a default unit of \unit{pt}.
Does not change the font size.
Does nothing, except issue a warning, if used in math mode.
@@ -381,7 +394,7 @@
\cs{PrintFontSizeParameters}
\end{mydisplaycode}
-Prints the current font size parameters\---the font step, font scale, font size, and font baselineskip.
+Prints the current font step, font scale, font size, and font baselineskip.
The printed font step and font scale are rounded to \num{5} decimal places.
To print with more decimal places, use \cs{CurrentFontStep} and \cs{CurrentFontScale} (\S\ref{subsec:expandable}).
The printed font step will be left blank if it is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
@@ -401,7 +414,7 @@
Prints \meta{text} in each font size ordered from \cs{tiny} to \cs{Huge} each followed by a paragraph break.
\meta{text} can contain \cs{par} tokens.
-Adding the optional star reverses the order of the font sizes.
+Adding the optional star \sarg{} reverses the order of the font sizes.
Cannot be used in math mode.
One useful way of printing sample text is \cs{PrintSampleText}\allowbreak\texttt{\{\cs{PrintFontSizeCommand}:\allowbreak\textvisiblespace\allowbreak\cs{PrintFontSizeParameters}\}}.
@@ -440,6 +453,7 @@
This package defines some public \pkg{expl3} variables.
They are set either by \cs{fontscalesetup} or in the \texttt{selectfont} hook.
They should never be modified directly.
+The syntax \meta{font size command} represents the name of a font size command from \cs{tiny} to \cs{Huge}, omitting the backslash character.
\begin{mydisplaycode}
\ttfamily
Modified: trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty 2025-01-17 20:19:42 UTC (rev 73488)
+++ trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty 2025-01-17 20:19:50 UTC (rev 73489)
@@ -8,8 +8,8 @@
\NeedsTeXFormat{LaTeX2e}[2023-11-01]
\ProvidesExplPackage
{fontscale}
- {2025-01-03}
- {3.0.5}
+ {2025-01-17}
+ {3.0.6}
{A flexible interface for setting font sizes}
% l3kernel version 2023-10-10 added many 'e'-variants.
@@ -263,7 +263,7 @@
\fp_set:Nn \l_fontscale_scale_fp
{
\dim_to_fp:n { \l_fontscale_size_dim }
- * \l__fontscale_normalsize_size_reciprocal_fp
+ / \l__fontscale_normalsize_size_fp
}
\str_if_eq:VnTF \l__fontscale_typographic_scale_str { musical }
{
@@ -277,7 +277,7 @@
{ \l_fontscale_scale_fp }
{
\dim_to_fp:n { \l_fontscale_size_dim }
- * \l__fontscale_musical_base_reciprocal_fp
+ / \l__fontscale_musical_base_fp
}
)
}
@@ -287,14 +287,12 @@
% Used only to speed up floating point calculations.
\fp_new:N \l__fontscale_normalsize_size_fp
-\fp_new:N \l__fontscale_normalsize_size_reciprocal_fp
+\fp_set:Nn \l__fontscale_normalsize_size_fp { 10 }
\fp_new:N \l__fontscale_musical_base_fp
-\fp_new:N \l__fontscale_musical_base_reciprocal_fp
-\fp_new:N \l__fontscale_musical_notes_reciprocal_fp
+\fp_new:N \l__fontscale_musical_notes_fp
\fp_new:N \l__fontscale_musical_selectfont_fp
-\fp_set:Nn \l__fontscale_normalsize_size_fp { 10 }
-\fp_set:Nn \l__fontscale_normalsize_size_reciprocal_fp { 0.1 }
+\fp_const:Nn \c__fontscale_five_fp { 5 }
% Scratch variable
\fp_new:N \l__fontscale_tmp_fp
@@ -386,6 +384,8 @@
}
{ \msg_error:nnn { fontscale } { font-size-out-of-bounds } {#1} }
}
+\cs_new:Npn \__fontscale_fp_eval_round:n #1
+ { \fp_eval:n { round ( #1 , \c__fontscale_five_fp ) } }
% DEFINE KEYS
@@ -724,8 +724,6 @@
}
\fp_set:Nn \l__fontscale_normalsize_size_fp
{ \dim_to_fp:n { \l_fontscale_normalsize_size_dim } }
- \fp_set:Nn \l__fontscale_normalsize_size_reciprocal_fp
- { \c_one_fp / \l__fontscale_normalsize_size_fp }
\quark_if_no_value:NTF \l__fontscale_normalsize_baselineskip_tl
{
\skip_set:Nn \l_fontscale_normalsize_baselineskip_skip
@@ -796,7 +794,7 @@
{
\l__fontscale_musical_base_fp * \l__fontscale_musical_ratio_fp
^ ( \use:c { c_fontscale_#1_step_fp }
- * \l__fontscale_musical_notes_reciprocal_fp )
+ / \l__fontscale_musical_notes_fp )
}
}
% Sets the font size, font scale, and font baselineskip of the other font size
@@ -824,22 +822,10 @@
{
\cs_set_eq:NN \__fontscale_keys_process_other_fn_aux:n
\__fontscale_keys_process_other_musical:n
- \dim_compare:nNnTF \l__fontscale_musical_base_dim =
- \l_fontscale_normalsize_size_dim
- {
- \fp_set_eq:NN \l__fontscale_musical_base_fp
- \l__fontscale_normalsize_size_fp
- \fp_set_eq:NN \l__fontscale_musical_base_reciprocal_fp
- \l__fontscale_normalsize_size_reciprocal_fp
- }
- {
- \fp_set:Nn \l__fontscale_musical_base_fp
- { \dim_to_fp:n { \l__fontscale_musical_base_dim } }
- \fp_set:Nn \l__fontscale_musical_base_reciprocal_fp
- { \c_one_fp / \l__fontscale_musical_base_fp }
- }
- \fp_set:Nn \l__fontscale_musical_notes_reciprocal_fp
- { \c_one_fp / \int_use:N \l__fontscale_musical_notes_int }
+ \fp_set:Nn \l__fontscale_musical_base_fp
+ { \dim_to_fp:n { \l__fontscale_musical_base_dim } }
+ \fp_set:Nn \l__fontscale_musical_notes_fp
+ { \int_use:N \l__fontscale_musical_notes_int }
\fp_set:Nn \l__fontscale_musical_selectfont_fp
{
\int_use:N \l__fontscale_musical_notes_int
@@ -903,7 +889,7 @@
\fp_set:cn { l_fontscale_#1_scale_fp }
{
\dim_to_fp:n { \use:c { l_fontscale_#1_size_dim } }
- * \l__fontscale_normalsize_size_reciprocal_fp
+ / \l__fontscale_normalsize_size_fp
}
\quark_if_no_value:cTF { l__fontscale_#1_baselineskip_tl }
{
@@ -1124,8 +1110,8 @@
}
\cs_new_protected:Npn \__fontscale_set_font_step:n #1
{
- \fp_set:Nn \l__fontscale_tmp_fp { round ( #1 , 5 ) }
- \str_case:enF { \fp_use:N \l__fontscale_tmp_fp }
+ \fp_set:Nn \l__fontscale_tmp_fp {#1}
+ \str_case:enF { \__fontscale_fp_eval_round:n { \l__fontscale_tmp_fp } }
{
{ -4 } { \tiny }
{ -3 } { \scriptsize }
@@ -1147,8 +1133,7 @@
{
\l__fontscale_musical_base_fp
* \l__fontscale_musical_ratio_fp
- ^ ( \l__fontscale_tmp_fp
- * \l__fontscale_musical_notes_reciprocal_fp )
+ ^ ( \l__fontscale_tmp_fp / \l__fontscale_musical_notes_fp )
}
}
}
@@ -1263,8 +1248,8 @@
\cs_new_protected:Npn \__fontscale_print_font_size_parameters:
{
step~ =~ \fp_if_nan:nF { \l_fontscale_step_fp }
- { \fp_eval:n { round ( \l_fontscale_step_fp , 5 ) } } ,~
- scale~ =~ \fp_eval:n { round ( \l_fontscale_scale_fp , 5 ) } ,~
+ { \__fontscale_fp_eval_round:n { \l_fontscale_step_fp } } ,~
+ scale~ =~ \__fontscale_fp_eval_round:n { \l_fontscale_scale_fp } ,~
size~ =~ \dim_use:N \l_fontscale_size_dim ,~
baselineskip~ =~ \skip_use:N \l_fontscale_baselineskip_skip
}
@@ -1289,7 +1274,10 @@
\token_to_str:c {##1} \@ \c_colon_str \c_space_tl
step~ =~ \fp_use:c { c_fontscale_##1_step_fp } ,~
scale~ =~ \str_if_eq:nnTF {##1} { normalsize } { 1 }
- { \fp_eval:n { round ( \use:c { l_fontscale_##1_scale_fp } , 5 ) } }
+ {
+ \__fontscale_fp_eval_round:n
+ { \use:c { l_fontscale_##1_scale_fp } }
+ }
,~
size~ =~ \dim_use:c { l_fontscale_##1_size_dim } ,~
baselineskip~ =~ \skip_use:c { l_fontscale_##1_baselineskip_skip }
More information about the tex-live-commits
mailing list.