tex.js 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. var __read = (this && this.__read) || function (o, n) {
  29. var m = typeof Symbol === "function" && o[Symbol.iterator];
  30. if (!m) return o;
  31. var i = m.call(o), r, ar = [], e;
  32. try {
  33. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  34. }
  35. catch (error) { e = { error: error }; }
  36. finally {
  37. try {
  38. if (r && !r.done && (m = i["return"])) m.call(i);
  39. }
  40. finally { if (e) throw e.error; }
  41. }
  42. return ar;
  43. };
  44. var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
  45. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  46. if (ar || !(i in from)) {
  47. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  48. ar[i] = from[i];
  49. }
  50. }
  51. return to.concat(ar || Array.prototype.slice.call(from));
  52. };
  53. Object.defineProperty(exports, "__esModule", { value: true });
  54. exports.CommonTeXFontMixin = void 0;
  55. function CommonTeXFontMixin(Base) {
  56. var _a;
  57. return _a = (function (_super) {
  58. __extends(class_1, _super);
  59. function class_1() {
  60. return _super !== null && _super.apply(this, arguments) || this;
  61. }
  62. class_1.prototype.getDelimiterData = function (n) {
  63. return this.getChar('-smallop', n) || this.getChar('-size4', n);
  64. };
  65. return class_1;
  66. }(Base)),
  67. _a.NAME = 'TeX',
  68. _a.defaultVariants = __spreadArray(__spreadArray([], __read(Base.defaultVariants), false), [
  69. ['-smallop', 'normal'],
  70. ['-largeop', 'normal'],
  71. ['-size3', 'normal'],
  72. ['-size4', 'normal'],
  73. ['-tex-calligraphic', 'italic'],
  74. ['-tex-bold-calligraphic', 'bold-italic'],
  75. ['-tex-oldstyle', 'normal'],
  76. ['-tex-bold-oldstyle', 'bold'],
  77. ['-tex-mathit', 'italic'],
  78. ['-tex-variant', 'normal']
  79. ], false),
  80. _a.defaultCssFonts = __assign(__assign({}, Base.defaultCssFonts), { '-smallop': ['serif', false, false], '-largeop': ['serif', false, false], '-size3': ['serif', false, false], '-size4': ['serif', false, false], '-tex-calligraphic': ['cursive', true, false], '-tex-bold-calligraphic': ['cursive', true, true], '-tex-oldstyle': ['serif', false, false], '-tex-bold-oldstyle': ['serif', false, true], '-tex-mathit': ['serif', true, false] }),
  81. _a.defaultSizeVariants = ['normal', '-smallop', '-largeop', '-size3', '-size4', '-tex-variant'],
  82. _a.defaultStretchVariants = ['-size4'],
  83. _a;
  84. }
  85. exports.CommonTeXFontMixin = CommonTeXFontMixin;
  86. //# sourceMappingURL=tex.js.map