## File: font-support.rst

package info (click to toggle)
mathjax-docs 2.7+20161014-1
• links: PTS, VCS
• area: main
• in suites: stretch
• size: 1,080 kB
• ctags: 14
• sloc: sh: 22; python: 19; makefile: 8
 file content (93 lines) | stat: -rw-r--r-- 3,637 bytes parent folder | download | duplicates (2)
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 .. _font-support: ******************** MathJax Font Support ******************** MathJax currently supports the following fonts: * MathJax TeX (default) * STIX General * Asana Math * Neo Euler * Gyre Pagella * Gyre Termes * Latin Modern MathJax contains customized webfont versions of these fonts. In particular, these customized versions are split over several files to minimize the page load. Since browsers do not provide APIs to access font metrics, MathJax has to ship with the necessary font data; this font data is generated during development and cannot be generated on the fly. In addition, most fonts do not cover the relevant characters for mathematical layout. Finally, some fonts (e.g. Cambria Math) store important glyphs outside the Unicode range, making them inaccessible to JavaScript. These are the main reasons why MathJax is unable to support arbitrary fonts at this time. Font configuration ================== Page authors can configure their font preference for each :ref:output format  separately, see :ref:HTML-CSS output processor  and :ref:SVG output processor . MathJax will download the necessary webfonts and fontdata dynamically and only those files necessary for the content. For the HTML-CSS output, MathJax will download webfonts in the appropriate webfont format (depending on the client browser); for the SVG output, MathJax will download path data that corresponds to the fonts. The :ref:HTML-CSS output processor  will prefer locally installed copies of the webfonts to minimize page load. Page authors can set a preference via the availableFonts and preferredFont options and they can configure the webfont via the webFont option. Please note that except for STIX General, the usual distributions of the supported fonts do not work for technical reasons. You can download the webfonts from the MathJax repository _. The :ref:SVG output processor  will not use fonts directly but derived SVG path data to draw paths corresponding to characters. The page author can configure the font via the font option. There is currently no method for switching fonts after MathJax has loaded. Similarly, page users cannot change the font configuration at this time except by installing their preferred fonts locally. Character fallbacks =================== No font contains a suitable glyph for every character specified in the Unicode standard. When MathJax encounters a character the configured font does not support, it will fall back to other fonts in a variety of ways. First, MathJax enhances Unicode coverage of its default TeX fonts, e.g., combining two double integrals U+222C when a quadrupel integral U+2A0C is used. However, this cannot create every character specified in Unicode. Next, MathJax will run through a fallback chain within the configured fonts (e.g., upright Greek will be substituted with italic Greek). Finally, MathJax will ask the browser to provide the glyph from a system font. Since in that final case, MathJax will not have the necessary data on the glyph's bounding box, MathJax will guess these metrics; this can negatively affect layout. Adding new fonts ================ As mentioned, MathJax needs pre-generated font data to support a fonts. This font data can be generated using the MathJax development tools _. Font mixing =========== Mixing multiple fonts is currently not supported. We hope to add support in the future.