Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Increase size of headings #19695

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

Merged
merged 2 commits into from
Mar 13, 2021
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Mar 13, 2021

PR Summary

Some time ago, we switch to Carlito, but this font seems to be a bit smaller than our body font.

The default styling makes fourth-level headings (h4) the same size as text, but bold:
Screenshot_2021-03-12 Screenshot

With the smaller font, this incorrectly makes the fourth-level headings look smaller than the text:
Screenshot_2021-03-12 Matplotlib Python plotting — Matplotlib 3 4 0rc3 post5 dev0+g78a0acba1d documentation

To match the body font, Carlito needs a base size of 16px (vs 14px), so re-scale all the headings using the CSS default em-size * 16px:
Screenshot_2021-03-12 Matplotlib Python plotting — Matplotlib 3 4 0rc3 post5 dev0+g78a0acba1d documentation(1)

Additionally, define the custom font under one name, instead of multiple. This means that styles use the normal CSS, and font fallbacks will get the right style.

PR Checklist

  • [n/a] Has pytest style unit tests (and pytest passes).
  • [n/a] Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

QuLogic added 2 commits March 12, 2021 19:13
This allows specifying a single font name later, and using normal
switches for bold/italic. This also means if the font didn't load, the
fallbacks will get the right style.
Some time ago, we switch to Carlito, but this font seems to be a bit
smaller than our body font. The default styling makes fourth-level
headings (`h4`) the same size as text, but bold. With the smaller font,
this incorrectly makes the fourth-level headings look smaller than the
text.

To match the body font, Carlito needs a base size of 16px (vs 14px), so
re-scale all the headings using the CSS default em-size * 16px.
@QuLogic QuLogic added this to the v3.4.0 milestone Mar 13, 2021
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine by me. Although IMHO we don't have to invest in tuning our current style if we seriously consider switching to pydata-sphinx-theme.

@timhoffm timhoffm merged commit 697bfe7 into matplotlib:master Mar 13, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 13, 2021
timhoffm added a commit that referenced this pull request Mar 14, 2021
…695-on-v3.4.x

Backport PR #19695 on branch v3.4.x (DOC: Increase size of headings)
@QuLogic QuLogic deleted the doc-headings branch March 15, 2021 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants