1 <!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
2 <!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
3 <!-- This Source Code Form is subject to the terms of the Mozilla Public
4 - License, v. 2.0. If a copy of the MPL was not distributed with this
5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
9 <title>MathJax fonts
</title>
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8"/>
11 <script type=
"text/x-mathjax-config">
13 jax: [
"output/HTML-CSS"],
14 "HTML-CSS": { availableFonts: [
"TeX"] }
17 <script type=
"text/javascript"
18 src=
"http://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js">
20 <script type=
"text/javascript">
31 var noChar
= codePoint();
33 function codePoint(aValue
, aFont
)
41 var i
= fontList
.indexOf(aFont
);
46 var hexacode
= Number(v
).toString(16).toUpperCase();
47 while (hexacode
.length
< 4) {
48 hexacode
= "0" + hexacode
;
50 return "\\u" + hexacode
+ f
;
53 function codePoint2(aList
)
56 return codePoint(aList
[0], aList
[1]);
62 function isSupported(aStretch
)
64 for (var x
in aStretch
) {
65 var part
= aStretch
[x
];
66 if (part
[0] instanceof Array
) {
69 } else if (part
.length
> 2) {
70 // Part has scale factor
78 ["Require", MathJax
.Ajax
, "[MathJax]/jax/element/mml/jax.js"],
79 ["Require", MathJax
.Ajax
, "[MathJax]/jax/output/HTML-CSS/jax.js"],
80 ["Require", MathJax
.Ajax
, "[MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata-extra.js"],
83 var t
= document
.getElementById("output");
86 var fontData
= MathJax
.OutputJax
["HTML-CSS"].FONTDATA
;
88 t
.value
+= "# Content below is generated from MathJaxFonts.html. Do not edit.\n";
91 // Generate the list of external fonts
92 for (var i
= 1; i
< fontList
.length
; i
++) {
93 t
.value
+= "external." + i
+ " = " + fontList
[i
] + "\n";
97 // Generate stretchy table for delimiters
98 var delimiters
= fontData
.DELIMITERS
;
99 for (var u
in delimiters
) {
101 var v
= delimiters
[u
];
104 // These characters are already handled when we load fontdata-extra.js
109 if (delimiters
.hasOwnProperty(v
.alias
)) {
110 // use data from the char pointed by this alias
111 v
= delimiters
[v
.alias
];
113 // It is an alias to a non-stretchy char. Ignore it.
118 if (v
.stretch
&& !isSupported(v
.stretch
)) {
119 // This construction is not supported.
120 t
.value
+= "# " + codePoint(u
) + " = [not supported]\n";
124 t
.value
+= codePoint(u
);
128 t
.value
+= codePoint2(v
.stretch
.top
);
129 t
.value
+= codePoint2(v
.stretch
.mid
);
130 t
.value
+= codePoint2(v
.stretch
.bot
);
131 t
.value
+= codePoint2(v
.stretch
.ext
);
133 t
.value
+= codePoint2(v
.stretch
.left
);
134 t
.value
+= codePoint2(v
.stretch
.mid
);
135 t
.value
+= codePoint2(v
.stretch
.right
);
136 t
.value
+= codePoint2(v
.stretch
.rep
);
139 t
.value
+= noChar
+ noChar
+ noChar
+ noChar
;
142 for (var i
in v
.HW
) {
143 t
.value
+= codePoint(u
, v
.HW
[i
][1]);
149 // Generate table for large operators
150 var fonts1
= fontData
.FONTS
[fontList
[1]];
151 var fonts2
= fontData
.FONTS
[fontList
[2]];
152 for (var u
in fonts1
) {
153 if (delimiters
.hasOwnProperty(u
) || // already listed above
154 u
== "version" || u
== "available" ||
155 u
== "directory" || u
== "family" || u
== "testString") {
156 // Ignore these properties
159 t
.value
+= codePoint(u
);
161 t
.value
+= noChar
+ noChar
+ noChar
+ noChar
;
162 t
.value
+= codePoint(u
, fontList
[1]);
163 if (fonts2
.hasOwnProperty(u
)) {
164 t
.value
+= codePoint(u
, fontList
[2]);
175 <textarea id=
"output" cols=
"80" rows=
"20"></textarea>