tex.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 __values = (this && this.__values) || function(o) {
  18. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  19. if (m) return m.call(o);
  20. if (o && typeof o.length === "number") return {
  21. next: function () {
  22. if (o && i >= o.length) o = void 0;
  23. return { value: o && o[i++], done: !o };
  24. }
  25. };
  26. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  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(options) {
  60. var e_1, _a;
  61. if (options === void 0) { options = null; }
  62. var _this = _super.call(this, options) || this;
  63. var CLASS = _this.constructor;
  64. try {
  65. for (var _b = __values(Object.keys(CLASS.variantCacheIds)), _c = _b.next(); !_c.done; _c = _b.next()) {
  66. var variant = _c.value;
  67. _this.variant[variant].cacheID = 'TEX-' + CLASS.variantCacheIds[variant];
  68. }
  69. }
  70. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  71. finally {
  72. try {
  73. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  74. }
  75. finally { if (e_1) throw e_1.error; }
  76. }
  77. return _this;
  78. }
  79. TeXFont.defaultDelimiters = delimiters_js_1.delimiters;
  80. TeXFont.defaultChars = {
  81. 'normal': normal_js_1.normal,
  82. 'bold': bold_js_1.bold,
  83. 'italic': italic_js_1.italic,
  84. 'bold-italic': bold_italic_js_1.boldItalic,
  85. 'double-struck': double_struck_js_1.doubleStruck,
  86. 'fraktur': fraktur_js_1.fraktur,
  87. 'bold-fraktur': fraktur_bold_js_1.frakturBold,
  88. 'script': script_js_1.script,
  89. 'bold-script': script_bold_js_1.scriptBold,
  90. 'sans-serif': sans_serif_js_1.sansSerif,
  91. 'bold-sans-serif': sans_serif_bold_js_1.sansSerifBold,
  92. 'sans-serif-italic': sans_serif_italic_js_1.sansSerifItalic,
  93. 'sans-serif-bold-italic': sans_serif_bold_italic_js_1.sansSerifBoldItalic,
  94. 'monospace': monospace_js_1.monospace,
  95. '-smallop': smallop_js_1.smallop,
  96. '-largeop': largeop_js_1.largeop,
  97. '-size3': tex_size3_js_1.texSize3,
  98. '-size4': tex_size4_js_1.texSize4,
  99. '-tex-calligraphic': tex_calligraphic_js_1.texCalligraphic,
  100. '-tex-bold-calligraphic': tex_calligraphic_bold_js_1.texCalligraphicBold,
  101. '-tex-mathit': tex_mathit_js_1.texMathit,
  102. '-tex-oldstyle': tex_oldstyle_js_1.texOldstyle,
  103. '-tex-bold-oldstyle': tex_oldstyle_bold_js_1.texOldstyleBold,
  104. '-tex-variant': tex_variant_js_1.texVariant
  105. };
  106. TeXFont.variantCacheIds = {
  107. 'normal': 'N',
  108. 'bold': 'B',
  109. 'italic': 'I',
  110. 'bold-italic': 'BI',
  111. 'double-struck': 'D',
  112. 'fraktur': 'F',
  113. 'bold-fraktur': 'BF',
  114. 'script': 'S',
  115. 'bold-script': 'BS',
  116. 'sans-serif': 'SS',
  117. 'bold-sans-serif': 'BSS',
  118. 'sans-serif-italic': 'SSI',
  119. 'sans-serif-bold-italic': 'SSBI',
  120. 'monospace': 'M',
  121. '-smallop': 'SO',
  122. '-largeop': 'LO',
  123. '-size3': 'S3',
  124. '-size4': 'S4',
  125. '-tex-calligraphic': 'C',
  126. '-tex-bold-calligraphic': 'BC',
  127. '-tex-mathit': 'MI',
  128. '-tex-oldstyle': 'OS',
  129. '-tex-bold-oldstyle': 'BOS',
  130. '-tex-variant': 'V'
  131. };
  132. return TeXFont;
  133. }((0, tex_js_1.CommonTeXFontMixin)(FontData_js_1.SVGFontData)));
  134. exports.TeXFont = TeXFont;
  135. //# sourceMappingURL=tex.js.map