tex.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. var __assign = (this && this.__assign) || function () {
  18. __assign = Object.assign || function(t) {
  19. for (var s, i = 1, n = arguments.length; i < n; i++) {
  20. s = arguments[i];
  21. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  22. t[p] = s[p];
  23. }
  24. return t;
  25. };
  26. return __assign.apply(this, arguments);
  27. };
  28. Object.defineProperty(exports, "__esModule", { value: true });
  29. exports.TeXFont = void 0;
  30. var FontData_js_1 = require("../FontData.js");
  31. var tex_js_1 = require("../../common/fonts/tex.js");
  32. var bold_italic_js_1 = require("./tex/bold-italic.js");
  33. var bold_js_1 = require("./tex/bold.js");
  34. var double_struck_js_1 = require("./tex/double-struck.js");
  35. var fraktur_bold_js_1 = require("./tex/fraktur-bold.js");
  36. var fraktur_js_1 = require("./tex/fraktur.js");
  37. var italic_js_1 = require("./tex/italic.js");
  38. var largeop_js_1 = require("./tex/largeop.js");
  39. var monospace_js_1 = require("./tex/monospace.js");
  40. var normal_js_1 = require("./tex/normal.js");
  41. var sans_serif_bold_italic_js_1 = require("./tex/sans-serif-bold-italic.js");
  42. var sans_serif_bold_js_1 = require("./tex/sans-serif-bold.js");
  43. var sans_serif_italic_js_1 = require("./tex/sans-serif-italic.js");
  44. var sans_serif_js_1 = require("./tex/sans-serif.js");
  45. var script_bold_js_1 = require("./tex/script-bold.js");
  46. var script_js_1 = require("./tex/script.js");
  47. var smallop_js_1 = require("./tex/smallop.js");
  48. var tex_calligraphic_bold_js_1 = require("./tex/tex-calligraphic-bold.js");
  49. var tex_calligraphic_js_1 = require("./tex/tex-calligraphic.js");
  50. var tex_mathit_js_1 = require("./tex/tex-mathit.js");
  51. var tex_oldstyle_bold_js_1 = require("./tex/tex-oldstyle-bold.js");
  52. var tex_oldstyle_js_1 = require("./tex/tex-oldstyle.js");
  53. var tex_size3_js_1 = require("./tex/tex-size3.js");
  54. var tex_size4_js_1 = require("./tex/tex-size4.js");
  55. var tex_variant_js_1 = require("./tex/tex-variant.js");
  56. var delimiters_js_1 = require("../../common/fonts/tex/delimiters.js");
  57. var TeXFont = (function (_super) {
  58. __extends(TeXFont, _super);
  59. function TeXFont() {
  60. return _super !== null && _super.apply(this, arguments) || this;
  61. }
  62. TeXFont.defaultCssFamilyPrefix = 'MJXZERO';
  63. TeXFont.defaultVariantClasses = {
  64. 'normal': 'mjx-n',
  65. 'bold': 'mjx-b',
  66. 'italic': 'mjx-i',
  67. 'bold-italic': 'mjx-b mjx-i',
  68. 'double-struck': 'mjx-ds mjx-b',
  69. 'fraktur': 'mjx-fr',
  70. 'bold-fraktur': 'mjx-fr mjx-b',
  71. 'script': 'mjx-sc mjx-i',
  72. 'bold-script': 'mjx-sc mjx-b mjx-i',
  73. 'sans-serif': 'mjx-ss',
  74. 'bold-sans-serif': 'mjx-ss mjx-b',
  75. 'sans-serif-italic': 'mjx-ss mjx-i',
  76. 'sans-serif-bold-italic': 'mjx-ss mjx-b mjx-i',
  77. 'monospace': 'mjx-ty',
  78. '-smallop': 'mjx-sop',
  79. '-largeop': 'mjx-lop',
  80. '-size3': 'mjx-s3',
  81. '-size4': 'mjx-s4',
  82. '-tex-calligraphic': 'mjx-cal mjx-i',
  83. '-tex-bold-calligraphic': 'mjx-cal mjx-b',
  84. '-tex-mathit': 'mjx-mit mjx-i',
  85. '-tex-oldstyle': 'mjx-os',
  86. '-tex-bold-oldstyle': 'mjx-os mjx-b',
  87. '-tex-variant': 'mjx-var'
  88. };
  89. TeXFont.defaultVariantLetters = {
  90. 'normal': '',
  91. 'bold': 'B',
  92. 'italic': 'MI',
  93. 'bold-italic': 'BI',
  94. 'double-struck': 'A',
  95. 'fraktur': 'FR',
  96. 'bold-fraktur': 'FRB',
  97. 'script': 'SC',
  98. 'bold-script': 'SCB',
  99. 'sans-serif': 'SS',
  100. 'bold-sans-serif': 'SSB',
  101. 'sans-serif-italic': 'SSI',
  102. 'sans-serif-bold-italic': 'SSBI',
  103. 'monospace': 'T',
  104. '-smallop': 'S1',
  105. '-largeop': 'S2',
  106. '-size3': 'S3',
  107. '-size4': 'S4',
  108. '-tex-calligraphic': 'C',
  109. '-tex-bold-calligraphic': 'CB',
  110. '-tex-mathit': 'MI',
  111. '-tex-oldstyle': 'C',
  112. '-tex-bold-oldstyle': 'CB',
  113. '-tex-variant': 'A'
  114. };
  115. TeXFont.defaultDelimiters = delimiters_js_1.delimiters;
  116. TeXFont.defaultChars = {
  117. 'normal': normal_js_1.normal,
  118. 'bold': bold_js_1.bold,
  119. 'italic': italic_js_1.italic,
  120. 'bold-italic': bold_italic_js_1.boldItalic,
  121. 'double-struck': double_struck_js_1.doubleStruck,
  122. 'fraktur': fraktur_js_1.fraktur,
  123. 'bold-fraktur': fraktur_bold_js_1.frakturBold,
  124. 'script': script_js_1.script,
  125. 'bold-script': script_bold_js_1.scriptBold,
  126. 'sans-serif': sans_serif_js_1.sansSerif,
  127. 'bold-sans-serif': sans_serif_bold_js_1.sansSerifBold,
  128. 'sans-serif-italic': sans_serif_italic_js_1.sansSerifItalic,
  129. 'sans-serif-bold-italic': sans_serif_bold_italic_js_1.sansSerifBoldItalic,
  130. 'monospace': monospace_js_1.monospace,
  131. '-smallop': smallop_js_1.smallop,
  132. '-largeop': largeop_js_1.largeop,
  133. '-size3': tex_size3_js_1.texSize3,
  134. '-size4': tex_size4_js_1.texSize4,
  135. '-tex-calligraphic': tex_calligraphic_js_1.texCalligraphic,
  136. '-tex-bold-calligraphic': tex_calligraphic_bold_js_1.texCalligraphicBold,
  137. '-tex-mathit': tex_mathit_js_1.texMathit,
  138. '-tex-oldstyle': tex_oldstyle_js_1.texOldstyle,
  139. '-tex-bold-oldstyle': tex_oldstyle_bold_js_1.texOldstyleBold,
  140. '-tex-variant': tex_variant_js_1.texVariant
  141. };
  142. TeXFont.defaultStyles = __assign(__assign({}, FontData_js_1.CHTMLFontData.defaultStyles), { '.MJX-TEX': {
  143. 'font-family': 'MJXZERO, MJXTEX'
  144. }, '.TEX-B': {
  145. 'font-family': 'MJXZERO, MJXTEX-B'
  146. }, '.TEX-I': {
  147. 'font-family': 'MJXZERO, MJXTEX-I'
  148. }, '.TEX-MI': {
  149. 'font-family': 'MJXZERO, MJXTEX-MI'
  150. }, '.TEX-BI': {
  151. 'font-family': 'MJXZERO, MJXTEX-BI'
  152. }, '.TEX-S1': {
  153. 'font-family': 'MJXZERO, MJXTEX-S1'
  154. }, '.TEX-S2': {
  155. 'font-family': 'MJXZERO, MJXTEX-S2'
  156. }, '.TEX-S3': {
  157. 'font-family': 'MJXZERO, MJXTEX-S3'
  158. }, '.TEX-S4': {
  159. 'font-family': 'MJXZERO, MJXTEX-S4'
  160. }, '.TEX-A': {
  161. 'font-family': 'MJXZERO, MJXTEX-A'
  162. }, '.TEX-C': {
  163. 'font-family': 'MJXZERO, MJXTEX-C'
  164. }, '.TEX-CB': {
  165. 'font-family': 'MJXZERO, MJXTEX-CB'
  166. }, '.TEX-FR': {
  167. 'font-family': 'MJXZERO, MJXTEX-FR'
  168. }, '.TEX-FRB': {
  169. 'font-family': 'MJXZERO, MJXTEX-FRB'
  170. }, '.TEX-SS': {
  171. 'font-family': 'MJXZERO, MJXTEX-SS'
  172. }, '.TEX-SSB': {
  173. 'font-family': 'MJXZERO, MJXTEX-SSB'
  174. }, '.TEX-SSI': {
  175. 'font-family': 'MJXZERO, MJXTEX-SSI'
  176. }, '.TEX-SC': {
  177. 'font-family': 'MJXZERO, MJXTEX-SC'
  178. }, '.TEX-T': {
  179. 'font-family': 'MJXZERO, MJXTEX-T'
  180. }, '.TEX-V': {
  181. 'font-family': 'MJXZERO, MJXTEX-V'
  182. }, '.TEX-VB': {
  183. 'font-family': 'MJXZERO, MJXTEX-VB'
  184. }, 'mjx-stretchy-v mjx-c, mjx-stretchy-h mjx-c': {
  185. 'font-family': 'MJXZERO, MJXTEX-S1, MJXTEX-S4, MJXTEX, MJXTEX-A ! important'
  186. } });
  187. TeXFont.defaultFonts = __assign(__assign({}, FontData_js_1.CHTMLFontData.defaultFonts), { '@font-face /* 1 */': {
  188. 'font-family': 'MJXTEX',
  189. src: 'url("%%URL%%/MathJax_Main-Regular.woff") format("woff")'
  190. }, '@font-face /* 2 */': {
  191. 'font-family': 'MJXTEX-B',
  192. src: 'url("%%URL%%/MathJax_Main-Bold.woff") format("woff")'
  193. }, '@font-face /* 3 */': {
  194. 'font-family': 'MJXTEX-I',
  195. src: 'url("%%URL%%/MathJax_Math-Italic.woff") format("woff")'
  196. }, '@font-face /* 4 */': {
  197. 'font-family': 'MJXTEX-MI',
  198. src: 'url("%%URL%%/MathJax_Main-Italic.woff") format("woff")'
  199. }, '@font-face /* 5 */': {
  200. 'font-family': 'MJXTEX-BI',
  201. src: 'url("%%URL%%/MathJax_Math-BoldItalic.woff") format("woff")'
  202. }, '@font-face /* 6 */': {
  203. 'font-family': 'MJXTEX-S1',
  204. src: 'url("%%URL%%/MathJax_Size1-Regular.woff") format("woff")'
  205. }, '@font-face /* 7 */': {
  206. 'font-family': 'MJXTEX-S2',
  207. src: 'url("%%URL%%/MathJax_Size2-Regular.woff") format("woff")'
  208. }, '@font-face /* 8 */': {
  209. 'font-family': 'MJXTEX-S3',
  210. src: 'url("%%URL%%/MathJax_Size3-Regular.woff") format("woff")'
  211. }, '@font-face /* 9 */': {
  212. 'font-family': 'MJXTEX-S4',
  213. src: 'url("%%URL%%/MathJax_Size4-Regular.woff") format("woff")'
  214. }, '@font-face /* 10 */': {
  215. 'font-family': 'MJXTEX-A',
  216. src: 'url("%%URL%%/MathJax_AMS-Regular.woff") format("woff")'
  217. }, '@font-face /* 11 */': {
  218. 'font-family': 'MJXTEX-C',
  219. src: 'url("%%URL%%/MathJax_Calligraphic-Regular.woff") format("woff")'
  220. }, '@font-face /* 12 */': {
  221. 'font-family': 'MJXTEX-CB',
  222. src: 'url("%%URL%%/MathJax_Calligraphic-Bold.woff") format("woff")'
  223. }, '@font-face /* 13 */': {
  224. 'font-family': 'MJXTEX-FR',
  225. src: 'url("%%URL%%/MathJax_Fraktur-Regular.woff") format("woff")'
  226. }, '@font-face /* 14 */': {
  227. 'font-family': 'MJXTEX-FRB',
  228. src: 'url("%%URL%%/MathJax_Fraktur-Bold.woff") format("woff")'
  229. }, '@font-face /* 15 */': {
  230. 'font-family': 'MJXTEX-SS',
  231. src: 'url("%%URL%%/MathJax_SansSerif-Regular.woff") format("woff")'
  232. }, '@font-face /* 16 */': {
  233. 'font-family': 'MJXTEX-SSB',
  234. src: 'url("%%URL%%/MathJax_SansSerif-Bold.woff") format("woff")'
  235. }, '@font-face /* 17 */': {
  236. 'font-family': 'MJXTEX-SSI',
  237. src: 'url("%%URL%%/MathJax_SansSerif-Italic.woff") format("woff")'
  238. }, '@font-face /* 18 */': {
  239. 'font-family': 'MJXTEX-SC',
  240. src: 'url("%%URL%%/MathJax_Script-Regular.woff") format("woff")'
  241. }, '@font-face /* 19 */': {
  242. 'font-family': 'MJXTEX-T',
  243. src: 'url("%%URL%%/MathJax_Typewriter-Regular.woff") format("woff")'
  244. }, '@font-face /* 20 */': {
  245. 'font-family': 'MJXTEX-V',
  246. src: 'url("%%URL%%/MathJax_Vector-Regular.woff") format("woff")'
  247. }, '@font-face /* 21 */': {
  248. 'font-family': 'MJXTEX-VB',
  249. src: 'url("%%URL%%/MathJax_Vector-Bold.woff") format("woff")'
  250. } });
  251. return TeXFont;
  252. }((0, tex_js_1.CommonTeXFontMixin)(FontData_js_1.CHTMLFontData)));
  253. exports.TeXFont = TeXFont;
  254. //# sourceMappingURL=tex.js.map