texlive[71029] Master/texmf-dist: fontscale (21apr24)
commits+karl at tug.org
commits+karl at tug.org
Sun Apr 21 22:15:20 CEST 2024
Revision: 71029
https://tug.org/svn/texlive?view=revision&revision=71029
Author: karl
Date: 2024-04-21 22:15:20 +0200 (Sun, 21 Apr 2024)
Log Message:
-----------
fontscale (21apr24)
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-manual.pdf
trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex
trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md 2024-04-21 20:15:09 UTC (rev 71028)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md 2024-04-21 20:15:20 UTC (rev 71029)
@@ -7,6 +7,13 @@
## [Unreleased]
+## [v1.2.1] - 2024-04-21
+
+### Changed
+- Improved the error message for `\SetFontStep*` when the current font step is
+ undefined.
+- Documentation improvements.
+
## [v1.2.0] - 2024-04-15
### Added
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls 2024-04-21 20:15:09 UTC (rev 71028)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls 2024-04-21 20:15:20 UTC (rev 71029)
@@ -4,7 +4,7 @@
\NeedsTeXFormat{LaTeX2e}[2023-06-01]
\ProvidesExplClass
{beery}
- {2024-04-15}
+ {2024-04-21}
{}
{}
@@ -11,6 +11,7 @@
\RequirePackage { fix-cm }
\LoadClass { article }
\RequirePackage { fontscale }
+\fontscalesetup { musical }
\RequirePackage [ list-final-separator = { ,~ and~ } ] { siunitx }
\RequirePackage { mathtools }
\RequirePackage [ shortcuts , allowbreakbefore ] { extdash }
@@ -179,7 +180,7 @@
\NewDocumentCommand \KeepNextPar { s }
{
\par
- \bool_if:NTF #1
+ \IfBooleanTF #1
{ \int_compare:nNnT { \prevgraf } = { 1 } { \nobreak \@afterheading } }
{ \nobreak \@afterheading }
}
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex 2024-04-21 20:15:09 UTC (rev 71028)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-manual.tex 2024-04-21 20:15:20 UTC (rev 71029)
@@ -13,7 +13,7 @@
Oliver Beery
-Version 1.2.0\quad{}15 April 2024
+Version 1.2.1\quad{}21 April 2024
\section{Introduction}
@@ -167,13 +167,13 @@
\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 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}.
+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.
@@ -196,7 +196,7 @@
\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 sizes and baselineskips should be ordered from \cs{tiny} to \cs{normalsize} to \cs{Huge}.
+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}.
@@ -218,7 +218,7 @@
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 step is undefined.
+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}.
@@ -243,10 +243,10 @@
\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 step is invalid.
-The starred version \cs{SetFontStep*} will also issue an error if the current step is invalid.
+\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 step matches the step of any font size command, then that font size command will be used directly.
+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}
@@ -277,8 +277,8 @@
\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 font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-The starred version \cs{SetFontSize*} adds \meta{dim expr} to the current size.
+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}}
@@ -291,7 +291,7 @@
\cs{SetFontSizeBaselineskip}\marg{\meta{dim expr}}\marg{\meta{skip expr}}
\KeepNextPar*
-Sets the font size and font baselineskip to \meta{dim expr} and \meta{skip expr}.
+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}.
@@ -305,8 +305,8 @@
\nopagebreak\newline
\cs{PrintAllFontParameters}
-\cs{PrintFontParameters} prints the current step, scale, size, and baselineskip in this order in a comma\-/separated list of key = value pairs.
-If the current step is undefined (as explained for \cs{SetFontStep} in \S\ref{subsec:fontsize}), it will be left blank.
+\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}}
Modified: trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty 2024-04-21 20:15:09 UTC (rev 71028)
+++ trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty 2024-04-21 20:15:20 UTC (rev 71029)
@@ -8,8 +8,8 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{fontscale}
- {2024-04-15}
- {1.2.0}
+ {2024-04-21}
+ {1.2.1}
{A user interface for setting document font sizes}
% The 2023-10-10 l3kernel update added many 'e'-variants.
@@ -213,11 +213,7 @@
\msg_line_context: \c_space_tl
are~ not~ in~ the~ correct~ order.~
The~ magnitude~ of~ the~ font~ sizes~ should~ be~ ordered~ from~
- \token_to_str:N \tiny \c_space_tl
- to~
- \token_to_str:N \normalsize \c_space_tl
- to~
- \token_to_str:N \Huge .
+ \iow_char:N \\tiny~ to~ \iow_char:N \\normalsize~ to~ \iow_char:N \\Huge .
}
\msg_new:nnn { fontscale } { font-baselineskips-out-of-order }
{
@@ -225,11 +221,7 @@
\msg_line_context: \c_space_tl
are~ not~ in~ the~ correct~ order.~
The~ magnitude~ of~ the~ font~ baselineskips~ should~ be~ ordered~ from~
- \token_to_str:N \tiny \c_space_tl
- to~
- \token_to_str:N \normalsize \c_space_tl
- to~
- \token_to_str:N \Huge .
+ \iow_char:N \\tiny~ to~ \iow_char:N \\normalsize~ to~ \iow_char:N \\Huge .
}
\msg_new:nnn { fontscale } { font-step-out-of-bounds }
{
@@ -238,6 +230,13 @@
must~ be~ an~ integer~ from~ -4~ to~ 5,~
unless~ the~ choice~ of~ typographic~ scale~ is~ modular~ or~ musical.
}
+\msg_new:nnn { fontscale } { current-font-step-out-of-bounds }
+ {
+ \iow_char:N \\SetFontStep*~
+ \msg_line_context: \c_space_tl
+ could~ not~ calculate~ the~ new~ font~ step~ because~
+ the~ current~ font~ step~ is~ undefined.
+ }
% DEFINE KEYS
@@ -581,11 +580,10 @@
{
\__fontscale_keys_process_normalsize:
\__fontscale_keys_process_other:
- \__fontscale_keys_process_other_props:
+ \__fontscale_keys_process_props:
\__fontscale_keys_process_check_order:
}
-% Sets the size and baselineskip of \normalsize, stores them in a property
-% list, and uses \normalsize.
+% Sets the size and baselineskip of \normalsize and uses \normalsize.
\cs_new_protected:Npn \__fontscale_keys_process_normalsize:
{
\quark_if_no_value:NTF \l__fontscale_normalsize_size_tl
@@ -624,90 +622,71 @@
\l_fontscale_normalsize_baselineskip_skip
{ \l__fontscale_normalsize_baselineskip_tl }
}
- \prop_put:Nno \l_fontscale_normalsize_prop { size }
- { \dim_use:N \l_fontscale_normalsize_size_dim }
- \prop_put:Nno \l_fontscale_normalsize_prop { baselineskip }
- { \skip_use:N \l_fontscale_normalsize_baselineskip_skip }
\normalsize
}
% Sets the size, scale, and baselineskip of the other font size commands.
% Issues a warning if the user sets both the scale and size keys for the same
% font size command.
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xpt:n #1
+\cs_new:Npn \__fontscale_keys_process_other_classic_xpt:n #1
{
- \dim_set:cn { l_fontscale_#1_size_dim }
+ \str_case:nn {#1}
{
- \str_case:nn {#1}
- {
- { tiny } { 6pt }
- { scriptsize } { 7pt }
- { footnotesize } { 8pt }
- { small } { 9pt }
- { large } { 11pt }
- { Large } { 12pt }
- { LARGE } { 14pt }
- { huge } { 16pt }
- { Huge } { 18pt }
- }
+ { tiny } { 6pt }
+ { scriptsize } { 7pt }
+ { footnotesize } { 8pt }
+ { small } { 9pt }
+ { large } { 11pt }
+ { Large } { 12pt }
+ { LARGE } { 14pt }
+ { huge } { 16pt }
+ { Huge } { 18pt }
}
}
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xipt:n #1
+\cs_new:Npn \__fontscale_keys_process_other_classic_xipt:n #1
{
- \dim_set:cn { l_fontscale_#1_size_dim }
+ \str_case:nn {#1}
{
- \str_case:nn {#1}
- {
- { tiny } { 7pt }
- { scriptsize } { 8pt }
- { footnotesize } { 9pt }
- { small } { 10pt }
- { large } { 12pt }
- { Large } { 14pt }
- { LARGE } { 16pt }
- { huge } { 18pt }
- { Huge } { 21pt }
- }
+ { tiny } { 7pt }
+ { scriptsize } { 8pt }
+ { footnotesize } { 9pt }
+ { small } { 10pt }
+ { large } { 12pt }
+ { Large } { 14pt }
+ { LARGE } { 16pt }
+ { huge } { 18pt }
+ { Huge } { 21pt }
}
}
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xiipt:n #1
+\cs_new:Npn \__fontscale_keys_process_other_classic_xiipt:n #1
{
- \dim_set:cn { l_fontscale_#1_size_dim }
+ \str_case:nn {#1}
{
- \str_case:nn {#1}
- {
- { tiny } { 8pt }
- { scriptsize } { 9pt }
- { footnotesize } { 10pt }
- { small } { 11pt }
- { large } { 14pt }
- { Large } { 16pt }
- { LARGE } { 18pt }
- { huge } { 21pt }
- { Huge } { 24pt }
- }
+ { tiny } { 8pt }
+ { scriptsize } { 9pt }
+ { footnotesize } { 10pt }
+ { small } { 11pt }
+ { large } { 14pt }
+ { Large } { 16pt }
+ { LARGE } { 18pt }
+ { huge } { 21pt }
+ { Huge } { 24pt }
}
}
-\cs_new_protected:Npn \__fontscale_keys_process_other_modular:n #1
+\cs_new:Npn \__fontscale_keys_process_other_modular:n #1
{
- \dim_set:cn { l_fontscale_#1_size_dim }
+ \fp_to_dim:n
{
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp * \l__fontscale_modular_ratio_fp
- ^ \use:c { c_fontscale_#1_step_fp }
- }
+ \l__fontscale_normalsize_size_fp * \l__fontscale_modular_ratio_fp
+ ^ \use:c { c_fontscale_#1_step_fp }
}
}
-\cs_new_protected:Npn \__fontscale_keys_process_other_musical:n #1
+\cs_new:Npn \__fontscale_keys_process_other_musical:n #1
{
- \dim_set:cn { l_fontscale_#1_size_dim }
+ \fp_to_dim:n
{
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp * \l__fontscale_musical_ratio_fp
- ^ ( \use:c { c_fontscale_#1_step_fp }
- / \l__fontscale_musical_notes_fp )
- }
+ \l__fontscale_normalsize_size_fp * \l__fontscale_musical_ratio_fp
+ ^ ( \use:c { c_fontscale_#1_step_fp }
+ / \l__fontscale_musical_notes_fp )
}
}
\cs_new_protected:Npn \__fontscale_keys_process_other:
@@ -767,7 +746,9 @@
}
\prg_break:
}
- \prg_break:n { \__fontscale_keys_process_other_typographic_scale:n {#1} }
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ { \__fontscale_keys_process_other_typographic_scale: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 }
@@ -788,9 +769,9 @@
{ \use:c { l__fontscale_#1_baselineskip_tl } }
}
}
-% Puts the scale, size, and baselineskip of the other font size commands in
-% property lists.
-\cs_new_protected:Npn \__fontscale_keys_process_other_props:
+% Puts the scale, size, and baselineskip of each font size command in
+% property lists, except the scale of \normalsize.
+\cs_new_protected:Npn \__fontscale_keys_process_props:
{
\prop_put:Nne \l_fontscale_tiny_prop { scale }
{ \fp_use:N \l_fontscale_tiny_scale_fp }
@@ -819,6 +800,8 @@
{ \dim_use:N \l_fontscale_footnotesize_size_dim }
\prop_put:Nno \l_fontscale_small_prop { size }
{ \dim_use:N \l_fontscale_small_size_dim }
+ \prop_put:Nno \l_fontscale_normalsize_prop { size }
+ { \dim_use:N \l_fontscale_normalsize_size_dim }
\prop_put:Nno \l_fontscale_large_prop { size }
{ \dim_use:N \l_fontscale_large_size_dim }
\prop_put:Nno \l_fontscale_Large_prop { size }
@@ -838,6 +821,8 @@
{ \skip_use:N \l_fontscale_footnotesize_baselineskip_skip }
\prop_put:Nno \l_fontscale_small_prop { baselineskip }
{ \skip_use:N \l_fontscale_small_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_normalsize_prop { baselineskip }
+ { \skip_use:N \l_fontscale_normalsize_baselineskip_skip }
\prop_put:Nno \l_fontscale_large_prop { baselineskip }
{ \skip_use:N \l_fontscale_large_baselineskip_skip }
\prop_put:Nno \l_fontscale_Large_prop { baselineskip }
@@ -1075,7 +1060,7 @@
{
\tl_set:Ne \l__fontscale_step_tl { \__fontscale_current_font_step: }
\tl_if_empty:NTF \l__fontscale_step_tl
- { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
+ { \msg_error:nn { fontscale } { current-font-step-out-of-bounds } }
{ \__fontscale_add_font_step_aux:n { (#1) + \l__fontscale_step_tl } }
}
\cs_new_eq:NN \__fontscale_add_font_step_aux:n \__fontscale_set_font_step:n
More information about the tex-live-commits
mailing list.