# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v5.0.0] - 2026-02-17

### Changed
- Major update before TeX Live 2026. This update includes many changes that are
  backwards incompatible.
- Updated requirements:
  - Now requires `l3kernel` version 2023-11-01.
  - No longer incompatible with the `scalefnt` package.
- The documentation no longer uses the terms "font step" and "font scale" to
  describe the font size. All package features which relied on the "font step"
  or "font scale" have been removed or redesigned. In hindsight, I do not find
  these concepts to be particularly helpful for users. Moreover, this had led
  to large package feature bloat.
- The documentation has been completely rewritten.
- Improved performance in the package code added to the `selectfont` hook.
- Keys `<font size command>/scale` renamed to
  `<font size command>/size-normalsize-ratio`.
- All font size commands defined by this package now issue an error instead of
  a warning if used in math mode.
- Improved the warning message in `\fontscalesetup` when the lengths of the
  font sizes are not correctly ordered from `\tiny` to `\Huge`.
- `\currentfontsize`, `\currentfontbaselineskip`, and `\currentnormalsize` are
  now proper lengths instead of expandable commands. This is more convenient
  when performing computations.
- `\setfontsize` now has an `o`- instead of an `s`-type argument with a new
  functionality.
- `\printfontsizecommand` now prints the command name in `\ttfamily`.

### Removed
- Files:
  - `fontscale-v3.sty` (no support for versions older than 5.0.0)
  - `fontscale-code.pdf`
- Keys:
  - `typographic-scale/classic-10pt`
  - `typographic-scale/classic-11pt`
  - `typographic-scale/classic-12pt`
  - `typographic-scale/classic-10bp`
  - `typographic-scale/classic-11bp`
  - `typographic-scale/classic-12bp`
  - `typographic-scale/classic-10dd`
  - `typographic-scale/classic-11dd`
  - `typographic-scale/classic-12dd`
  - `typographic-scale/classic-10nd`
  - `typographic-scale/classic-11nd`
  - `typographic-scale/classic-12nd`
  - `classic-10pt`
  - `classic-11pt`
  - `classic-12pt`
  - `classic-10bp`
  - `classic-11bp`
  - `classic-12bp`
  - `classic-10dd`
  - `classic-11dd`
  - `classic-12dd`
  - `classic-10nd`
  - `classic-11nd`
  - `classic-12nd`
  - `magscale` (lacks use case)
- Commands:
  - `\currentfontstep`, `\currentfontscale`
  - `\setfontstep`, `\setfontscale`
  - `\scalefont` (redundant with `\setfontsize` and `\currentfontsize`)
  - `\setfontsizebaselineskip` (redundant with `\setfontsize`)
  - `\setfontbaselineskip` `s`-type argument (redundant with
    `\currentfontbaselineskip`)
  - `\printfontsizeparameters`, `\printallfontsizeparameters`
- Variables:
  - `\c_fontscale_<font size command>_step_fp`
  - `\c_fontscale_normalsize_scale_fp`
  - `\l_fontscale_<font size command>_scale_fp`
  - `\l_fontscale_step_fp`, `\l_fontscale_scale_fp`

### Added
- Keys:
  - `typographic-scale/classic`
  - `classic`
  - `classic/base`
  - `classic/point`
- `\stepfontsize`

## [v4.2.0] - 2025-04-30

### Added
- Key `magscale`

### Changed
- The documentation now states that:
  - The key `<font size command>/size` issues a warning when overwriting the
    font size set by the key `<font size command>/scale`.
  - The key `<font size command>/baselineskip` issues a warning when
    overwriting the font baselineskip set by the key
    `<font size command>/baselineskip-size-ratio`.

## [v4.1.0] - 2025-04-04

### Added
- Keys:
  - `typographic-scale/classic-10bp`
  - `typographic-scale/classic-11bp`
  - `typographic-scale/classic-12bp`
  - `typographic-scale/classic-10dd`
  - `typographic-scale/classic-11dd`
  - `typographic-scale/classic-12dd`
  - `typographic-scale/classic-10nd`
  - `typographic-scale/classic-11nd`
  - `typographic-scale/classic-12nd`
  - `classic-10bp`
  - `classic-11bp`
  - `classic-12bp`
  - `classic-10dd`
  - `classic-11dd`
  - `classic-12dd`
  - `classic-10nd`
  - `classic-11nd`
  - `classic-12nd`
  - `<font size command>/baselineskip-size-ratio`
- `\currentnormalsize`

### Changed
- Improved performance in the package code added to the `selectfont` hook.
- The documentation now states that:
  - `fontscale` does not load any other packages.
  - `\currentfontstep`, `\currentfontscale`, and `\currentfontsize` do not
    expand `\f@size`.

### Fixed
- The documentation now correctly states that the classic typographic scale
  includes font size `30`. (`30` was not included in some older versions of The
  Elements of Typographic Style by Robert Bringhurst.)
- The package now correctly uses `\dim_use:N` and `\skip_use:N` when using
  `expl3` `dim` and `skip` variables in `LaTeX2e` commands.
- Removed incorrect code comment regarding compatibility with the `microtype`
  package.
- The internal variables that store the value of the keys
  `<font size command>/scale`, `<font size command>/size`, and
  `<font size command>/baselineskip` now correctly store the value of the
  evaluated floating point/dimen/skip expression. This should result in more
  consistent behavior if `\fontscalesetup` is used again.

## [v4.0.1] - 2025-03-11

### Changed
- The package now issues a package error if the font size would be 2048pt or
  greater.

### Fixed
- Fixed a rare issue where `\fontscalesetup` would not issue a package error if
  the font size of a font size command was `0pt` and the value of the key
  `typographic-scale` was `musical`.

## [v4.0.0] - 2025-03-02

### Added
- `fontscale` version 3 can be used by declaring `\usepackage{fontscale}[=v3]`.
- `fontscale-v3.sty`

### Removed
- The package keys and commands that take a dimen or skip expression as a value
  or argument no longer append a default unit of `pt` and remove extra trailing
  tokens, if any. (This feature had relied on exploiting `expl3` implementation
  details.)

### Changed
- `fontscale` is no longer compatible with the `scalefnt` package.
- The keys `<font size command>` are now shortcuts for the keys
  `<font size command>/size`. (The previous functionality no longer makes
  syntactic sense given the removal of default unit support.)
- Renamed the document commands using the recommended all-lowercase convention:
  - `\CurrentFontStep` to `\currentfontstep`
  - `\CurrentFontScale` to `\currentfontscale`
  - `\CurrentFontSize` to `\currentfontsize`
  - `\CurrentFontBaselineskip` to `\currentfontbaselineskip`
  - `\SetFontStep` to `\setfontstep`
  - `\SetFontScale` to `\setfontscale`
  - `\SetFontSize` to `\setfontsize`
  - `\ScaleFont` to `\scalefont`
  - `\SetFontSizeBaselineskip` to `\setfontsizebaselineskip`
  - `\SetFontBaselineskip` to `\setfontbaselineskip`
  - `\PrintFontSizeParameters` to `\printfontsizeparameters`
  - `\PrintAllFontSizeParameters` to `\printallfontsizeparameters`
  - `\PrintSampleText` to `\printsampletext`
  - `\PrintFontSizeCommand` to `\printfontsizecommand`

## [v3.1.2] - 2025-02-13

### Fixed
- The package now correctly requires `l3kernel` version 2023-11-09.

## [v3.1.1] - 2025-02-06

### Changed
- The package no longer removes extra trailing tokens from user input into an
  integer expression. (This feature had relied on exploiting an implementation
  detail.)

## [v3.1.0] - 2025-02-03

### Added
- `fontscale-code.tex`
- `fontscale-code.pdf`

## [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
- Clarified some package functionalities in the documentation:
  - The new font baselineskip set by `\ScaleFont` has no stretch and shrink
    components.
  - `\ScaleFont` is intended as a more robust alternative to `\scalefont` from
    the `scalefnt` package.
  - `\SetFontSizeBaselineskip` is intended as a more robust alternative to
    `\fontsize` + `\selectfont`.
  - `\PrintAllFontSizeParameters`, `\PrintSampleText`, and
    `\PrintFontSizeCommand` cannot be used in math mode.
- Code improvements:
  - The package messages are now defined first.
  - The package now regularly uses `\dim_to_fp:n` when handling dimensions
    within floating point expressions.

## [v3.0.4] - 2024-12-22

### Changed
- `\PrintFontSizeParameters` and `\PrintAllFontSizeParamters` now print the
  font step and font scale rounded to 5 decimal places. (`\CurrentFontStep` and
  `\CurrentFontScale` are unchanged.)

## [v3.0.3] - 2024-12-09

### Changed
- The documentation now displays code in a light-gray background using the
  `tcolorbox` package. This subtle contrast enhances readability.

## [v3.0.2] - 2024-11-25

### Changed
- Keys and commands that take an integer expression as a value or argument now
  remove the extra tokens that were not part of the integer expression.
- Added more explanatory code comments.

## [v3.0.1] - 2024-10-20

### Changed
- Improved the error message when the font size is not a positive length.
- Documentation improvements.

## [v3.0.0] - 2024-10-05

### Added
- Added new `expl3` public variables that store the current font step, font
  scale, font size, and font baselineskip, respectively. They are set in the
  `selectfont` hook.
  - `\l_fontscale_step_fp`
  - `\l_fontscale_scale_fp`
  - `\l_fontscale_size_dim`
  - `\l_fontscale_baselineskip_skip`

### Changed
- This update includes some changes that are backwards incompatible.
- The package commands now use the above variables instead of `\f@size` and
  `\f@baselineskip`. This changes the behavior of `\CurrentFontStep`,
  `\CurrentFontScale`, and `\CurrentFontSize` within the second argument of
  `\fontsize` because `\fontsize` sets `\f@size` to the new font size before
  expanding its second argument.
- `\PrintFontSizeCommand` no longer tests if the current font baselineskip
  equals the font baselineskip of any font size command from `\tiny` to
  `\Huge`.
- `\SetFontStep` now rounds the new font step to 5 decimal places. This is
  important when checking if it equals the font step of any font size command
  from `\tiny` to `\Huge`.
- A default `pt` is now appended only in user-level commands, not in internal
  `expl3` functions.
- `\fontscalesetup` now processes the keys slightly faster when the key
  `<font size command>/baselineskip` is not set.
- Documentation improvements.

### Removed
- `\CurrentFontSizeCommand` (redundant with `\CurrentFontSize` and
  `\CurrentFontBaselineskip`)

## [v2.4.0] - 2024-09-10

### Changed
- `\fontscalesetup` no longer issues a warning if the lengths of the font
  baselineskips are not ordered from `\tiny` to `\Huge`.
- Code improvements.

## [v2.3.0] - 2024-09-06

### Changed
- The package commands no longer check if the font baselineskip is less than
  the font size.

## [v2.2.0] - 2024-08-29

### Changed
- Improved the messages issued by this package.

### Added
- `\SetFontBaselineskip`

## [v2.1.0] - 2024-08-12

### Changed
- Documentation improvements.

### Added
- `\CurrentFontSizeCommand`

## [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
- `\fontscalesetup` now provides error checking for the keys `modular/ratio`,
  `musical/ratio`, and `musical/notes`.
- It is now documented that `\fontscalesetup` uses `\normalsize` after it
  sets and processes the package keys.

### Changed
- The code now regularly uses `V`- and `v`-type arguments to get the value of
  an `expl3` variable.
- The code now uses private `expl3` wrappers around the `LaTeX2e` commands
  `\@setfontsize`, `\fontsize`, and `\selectfont`.

## [v1.2.2] - 2024-04-29

### Changed
- Improved package messages when issuing errors and warnings.
- Code improvements.

### Fixed
- The documentation no longer incorrectly compares `\ScaleFont` with
  `\scalefont` from the `scalefnt` package.
- The internal function for the key `reset/preamble` now correctly initializes
  to `\prg_do_nothing:`.

## [v1.2.1] - 2024-04-21

### Changed
- Improved the error message for `\SetFontStep` when adding the optional star
  and the current font step is undefined.
- Documentation improvements.

## [v1.2.0] - 2024-04-15

### Added
- It is now documented that the keys and commands provided by this package take
  as a value or argument a dimen, skip, floating point, or integer expression
  instead of simply a size, skip, number, or integer.
- The package now includes a CHANGELOG file.

### Changed
- Documentation improvements.

### Fixed
- The key `reset/preamble` and `\SetFontStep` no longer rely on undocumented
  `expl3` features.
- Corrected typo in the documentation.

## [v1.1.1] - 2024-04-07

### Changed
- Improved performance, especially when using a musical typographic scale.
- Small documentation improvements.

## [v1.1.0] - 2024-03-31

### Added
 - `\SetFontStep`, `\SetFontScale`, `\SetFontSize`, `\ScaleFont`, and
 `\SetFontSizeBaselineskip` are now correctly removed by `\text_purify:n`.

## [v1.0.3] - 2024-03-26

### Changed
- Code improvements, particularly to document commands defined with optional
  arguments.

## [v1.0.2] - 2024-03-22

### Changed
- Performance and code improvements.

### Fixed
- The key `reset/preamble` no longer relies on an unsupported `V`-type `bool`
  argument.

## [v1.0.1] - 2024-03-08

### Added
- Added the `.tex` sources for the documentation.
- Added the CTAN link to the `.sty` and README files.

## [v1.0.0] - 2024-03-06

### Added
- First official release to CTAN.
