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

feat(mathml): always load MathML font, update Polyfill, use latest woff2 font #7620

Merged
merged 6 commits into from
Nov 30, 2022

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Nov 18, 2022

Summary

Fixes #7607.

Problem

For browsers that don't support MathML, we load a MathML polyfill and a custom font (STIX TwoMath). This means that other browsers that support MathML use their default font for MathML, which might be different from that font.

Solution

Continue to load a MathML polyfill for browsers without support, but always load the custom font.

Note: The Polyfill doesn't apply to live samples, which are rendered in an (independent) iframe, but #7621 fixes that.


Screenshots

No visual change observed.

Before

After


How did you test this change?

Opened these pages in Chrome, Firefox and Safari:

@caugner caugner changed the title Always load mathml font feat(mathml): always load MathML font, replace STIX.otf with latest STIX.woff2 Nov 18, 2022
@caugner caugner force-pushed the always-load-mathml-font branch from e03e23e to 5cec181 Compare November 18, 2022 17:34
@caugner caugner changed the title feat(mathml): always load MathML font, replace STIX.otf with latest STIX.woff2 feat(mathml): always load MathML font, update Polyfill, use latest STIX.woff2 Nov 18, 2022
@caugner caugner changed the title feat(mathml): always load MathML font, update Polyfill, use latest STIX.woff2 feat(mathml): always load MathML font, update Polyfill, use latest woff2 font Nov 18, 2022
@caugner caugner marked this pull request as ready for review November 18, 2022 17:45
@caugner caugner mentioned this pull request Nov 18, 2022
3 tasks
@caugner caugner added the typography Issues related to font color/decoration/size/weight label Nov 18, 2022
@font-face {
font-family: "STIXRegular";
font-weight: normal;
src: url("./font/STIXTwoMath-Regular.woff2") format("woff2");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
src: url("./font/STIXTwoMath-Regular.woff2") format("woff2");
src: local('STIXTwoText') url("./font/STIXTwoMath-Regular.woff2") format("woff2");

@font-face {
font-family: "STIXRegular";
font-weight: normal;
src: local("STIXTwoText") url("./font/STIXTwoMath-Regular.woff2")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
src: local("STIXTwoText") url("./font/STIXTwoMath-Regular.woff2")
src: local("STIXTwoMath-Regular") url("./font/STIXTwoMath-Regular.woff2")

@caugner caugner force-pushed the always-load-mathml-font branch from c2c3a8f to 77f7ce7 Compare November 25, 2022 15:22
@caugner caugner requested a review from fiji-flo November 28, 2022 11:56
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

Looks great.

@caugner caugner merged commit 01fe5af into main Nov 30, 2022
@caugner caugner deleted the always-load-mathml-font branch November 30, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typography Issues related to font color/decoration/size/weight
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swap out MathML stylesheet
2 participants