Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX template: Prevent scaling of main font #5212

Merged
merged 2 commits into from
Jan 10, 2019
Merged

LaTeX template: Prevent scaling of main font #5212

merged 2 commits into from
Jan 10, 2019

Conversation

adunning
Copy link
Contributor

When Scale=MatchLowercase is set as a default font option, this scales mainfont against the old default, meaning that it resizes whatever is set as the main font to match the metrics of Latin Modern. This can result, for example, in a document set to 12pt appearing in 11pt or 13pt. Setting this option for individual families allows everything to scale against the main font, and permits the user to override the setting if desired. Note that it is not necessary to specify Ligatures=TeX, as this is already set by default for the appropriate families. See the fontspec manual: https://ctan.org/pkg/fontspec.

adunning and others added 2 commits January 10, 2019 11:21
When `Scale=MatchLowercase` is set as a default font option, this scales `mainfont` against the old default, meaning that it resizes whatever is set as the main font to match the metrics of Latin Modern. This can result, for example, in a document set to 12pt appearing in 11pt or 13pt. Setting this option for individual families allows everything to scale against the main font, and permits the user to override the setting if desired. Note that it is not necessary to specify `Ligatures=TeX`, as this is already set by default for the appropriate families. See the `fontspec` manual: <https://ctan.org/pkg/fontspec>.
@adunning
Copy link
Contributor Author

adunning commented Jan 10, 2019

The manual suggests (¶6.2 Scale) that one could instead do this:

\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Scale=1}

This would theoretically be a touch cleaner, and avoid the potential issue of a user unintentionally disabling scaling by setting other options. In my testing, however, I found that setting the defaults this way actually loads mainfont with both the Scale=1 and Scale=MatchLowercase options, meaning that it doesn't actually work. I've reported this at latex3/fontspec#345.

@jgm jgm merged commit 666bf8a into jgm:master Jan 10, 2019
@jgm
Copy link
Owner

jgm commented Jan 10, 2019

OK, great!

@adunning adunning deleted the patch-1 branch January 10, 2019 20:20
jgm pushed a commit that referenced this pull request Jan 13, 2019
Simplify the approach of #5212, ensuring that `mainfont` is used as the base font for scaling and that LuaLaTeX does not display the mono font with TeX ligatures (as it does not use the `Mapping=tex-ansi` option).

With a modified version of `\defaultfontfeatures`, fontspec will continue to report scaling against the old default font in the log, but it nonetheless displays main font at the specified size. Using this rather than setting `Scale=MatchLowercase` for each family individually means that users will not lose scaling when upgrading to the new template if they were using other font options. Scaling can be disabled for an individual family by adding the option `Scale=1` to `sansfontoptions`, `monofontoptions`, etc.

Remove the `\setromanfont` command added in #4665, as this is not documented in the fontspec manual and appears to be a deprecated alias for `\setmainfont`.

For the release notes, I should also add that one can imitate the previous appearance with `-V mainfontoptions="Scale=MatchLowercase"`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants