pressbooks-book
pressbooks-book copied to clipboard
Firefox + Crimson Text font + MacOS + MathJax equation sizing bug
Prerequisites
- [x] Can you reproduce the behavior you wish to address with all plugins except Pressbooks deactivated?
- [x] Are you running the latest version of Pressbooks, the latest version of McLuhan, and the latest version of WordPress?
- [x] Are you experiencing the issue while using this book theme?
- [x] Did you perform a cursory search to see if your bug or enhancement is already listed?
Description
Several Pressbooks themes use a font called Crimson Text, which includes bad metadata that adversely affects the Firefox browser's interpretation of what x-height other elements on the page should be scaled to. This results in equations rendering at 50% the size of the surrounding text. The image below shows an equation in LaTeX followed by the same equation written out in plain text (then italicized to match).
The bug seems to specifically target LaTeX, MathML, and AsciiMath equations generated by MathJax while users are visiting a webbook via a Firefox browser on the Mac operating system. Other supported browsers (Edge, Chrome, and Safari) weren't affected. According to feedback, users who visited Firefox from a Windows operating system were not affected. QuickLaTeX did not show the same errors. Export formats were fine.
The Crimson Text font appears in the webbook stylesheets of three active themes:
- Graham
- Atwood
- Baker
Example: https://firefoxcrimsontextmacoslatexerror.textopress.com
See conversation for context: https://www.rebus.community/t/logical-symbols-and-accessibility/2340/14
Steps to Reproduce
- Go to Plugins on your test book and make sure QuickLaTeX is deactivated so equations are rendered by mathJax
- Create a chapter and add an equation in LaTeX, MathML, or AsciiMath
- Add other filler text for comparison, then save the chapter,
- Go to Appearance > Themes and select Graham, Atwood, or Baker
- Visit the book in the Firefox browser on a Mac
Expected behavior: Equations are the same size as the surrounding text
Actual behavior: Equations are 50% the size of the surrounding text when certain conditions are met
@mcgratay Has 'bad metadata' issue been reported upstream to Google fonts? If not, will you do so at your convenience? See 'further information' section at https://fonts.google.com/specimen/Crimson+Text
FWIW I had the same problem with Crimson Text and incorrect equation sizes in another project. The solution was to switch to Crimson Pro, which Google describes like this:
The first Crimson design was initiated by Sebastian Kosch in 2009, and he later completely redrew a new version called Crimson Prime. Google commissioned Jacques Le Bailly to review both typefaces, and develop Crimson Pro as a new design that synthesises both designs into a final authoritative family, first released in January 2019. All decisions were made to enable better readability for longer texts and the ability to make good and diverse typography.
As far as I can tell Crimson Text is no longer displayed on Google Fonts.