pressbooks-book icon indicating copy to clipboard operation
pressbooks-book copied to clipboard

Firefox + Crimson Text font + MacOS + MathJax equation sizing bug

Open mcgratay opened this issue 5 years ago • 2 comments

Prerequisites

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).

Screen Shot 2020-01-16 at 11 28 00 AM

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

  1. Go to Plugins on your test book and make sure QuickLaTeX is deactivated so equations are rendered by mathJax
  2. Create a chapter and add an equation in LaTeX, MathML, or AsciiMath
  3. Add other filler text for comparison, then save the chapter,
  4. Go to Appearance > Themes and select Graham, Atwood, or Baker
  5. 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 avatar Jan 16 '20 16:01 mcgratay

@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 Screenshot from 2020-01-24 16-36-54

SteelWagstaff avatar Jan 24 '20 22:01 SteelWagstaff

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.

soegaard avatar Dec 13 '21 07:12 soegaard