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

Create a unified Math font #23

Open
mathijshenquet opened this issue Aug 24, 2017 · 1 comment
Open

Create a unified Math font #23

mathijshenquet opened this issue Aug 24, 2017 · 1 comment

Comments

@mathijshenquet
Copy link

mathijshenquet commented Aug 24, 2017

I would like to propose the creation of a single unified font file containing all the glyphs used for ordinary mathematical typesetting.

With ordinary mathematical typesetting I mean typesetting in math mode of a plain LaTeX installation with the AMS packages. By default the punctuation and special characters like ,, %, ! etc in this mode are taken from the roman font, I will call this font the base font.

Currently MathJax creates the following font files containing the glyphs used for ordinary math typesetting (ignoring Size* fonts for the moment):

  1. Main-Regular - The roman font used as base font. This supplies the punctuation and special character glyphs, like the commas in $a, b, c$.

  2. AMS - Contains many special symbol glyphs, like $\geqq$. With, as far as I can see, no overlap with glyphs from Main-Regular.

  3. Math-Regular, Math-Italic, Math-BoldItalic, Caligraphic-Bold, Caligraphic-Regular, Fraktur-Bold, Fraktur-Regular, SansSerif-Bold, SansSerif-Italic, SansSerif-Regular, Typewriter

    These contain the differently styled alphabetical a-z, A-Z glyphs, some of these additionally contain numeral 0-9 glyphs, and some contain greek character glyphs.

Some of the fonts from part 3 (like SansSerif-*, Fraktur-* and Typewriter) contain glyphs used for other purposes, such as typesetting text, not used in ordinary math typesetting. For example some contain glyphs for punctuation and special characters already supplied by Main-Regular.

Unicode provides codepoints for all glyphs mentioned in parts 1, 2 and 3 so in principle only a single Math font is necessary to do ordinary math typesetting. This could be done in the following way:

  • The glyphs from parts 1 and 2 can be merged with little (no?) conflict.
  • The alphabetical, and where applicable the numeral and greek, glyphs in parts 3 can be placed as indicated by the unicode Mathematical Alphanumeric Symbols guideline.
  • The resulting font file could be called Math-Roman or Math-Regular signifying the underlying roman basefont used. Later other fonts like Math-SansSerif could be created where punctuation is taken from the SansSerif font (there are usecases for such a thing).

I think the creation of such a unified font file, even if not directly used for the MathJax project, is a good idea for the following reasons:

  1. It provides a more faithful encoding of the mathematical content. Usage of a Bold font should be styling change, but using bold in mathematical writing signifies different semantics as codified in the unicode Mathematical Alphanumeric Symbols.
  2. The glyphs not used for ordinary math typesetting (as described above) don't need to be transmitted. Admittedly this is a tradeoff since user might need those later for other purposes. Also a user not interested in using SansSerif in math mode won't be able to opt out of it anymore.
  3. It creates a high quality mathematical font for the world to use.

Greetings Mathijs

PS. I would gladly work on this myself

mathijshenquet added a commit to mathijshenquet/MathJax-dev that referenced this issue Sep 4, 2017
@pkra
Copy link

pkra commented Sep 8, 2017

Thanks for filing an issue. This is a complicated topic, I'm afraid. Let me try to summarize a recent discussion among the team members.

There are two main reasons why this is not of interest to us at MathJax.

The first reason is that there are already several fonts for the purpose you describe, e.g., STIX and LatinModern (the latter is based on Computer Modern, like our "MathJax fonts"). So we don't think there's a no need to add another one.

The second reason is that combining all the glyphs into one font is not appropriate for a web font. Such a font will get downloaded often and download time / bandwidth are increased unnecessarily when most of the glyphs will not be used. We intentionally separated the MathJax fonts into groups in order to reduce download times and provide a fast and reliable experience. This is a pretty standard approach, cf. how Google Fonts or Typekit offer on-the-fly font subsetting and warn you when you specify too many fonts.

In other words, there are already fonts and MathJax wouldn't benefit.

In addition there are several minor reasons we would not go this route.

At the time the MathJax fonts were developed, browser&OS support for Plane1 of Unicode (where the math alphanumerics are located) was unreliable and glyphs would sometimes not be displayed. Thus using them was not an option.

The math alphabets also cause issues for assistive technology and they make our accessible rendering more difficult.

Finally, we are not a font development project, and do not have the resources to produce and maintain fonts that are not intended for the MathJax project. The fonts are simply traces of TeX bitmapped versions of the CM font, and so are not a high-quality font; making them high-quality would take a lot of hand editing and that is not our mission.

On a personal note, we actually consider the use of the Unicode math alphabets a bad practice on the web. While they may be useful for print layout, they carry no real semantic information (cf above) and they also do not match layout traditions on the web -- on the web, authors frequently expect CSS to affect to math content, e.g., in underlined links or in styled headings.

Of course none of this should stop you if you want to build a font based on the MathJax fonts! They are SIL licensed and you are more than welcome to use them accordingly. We're also happy to answer questions about our fonts; we are actually revamping our font tool chain as part of MathJax v3.

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

No branches or pull requests

2 participants