@mathjax/generic-font
Version:
Generic font for MathJax v4
95 lines • 4.1 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericFont = void 0;
var FontData_js_1 = require("@mathjax/src/cjs/output/chtml/FontData.js");
var common_js_1 = require("./common.js");
var normal_js_1 = require("./chtml/normal.js");
var delimiters_js_1 = require("./chtml/delimiters.js");
var Base = (0, common_js_1.CommonGenericFontMixin)(FontData_js_1.ChtmlFontData);
var GenericFont = (function (_super) {
__extends(GenericFont, _super);
function GenericFont() {
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
_this.cssFontPrefix = 'G';
return _this;
}
GenericFont.NAME = 'Generic';
GenericFont.OPTIONS = __assign(__assign({}, Base.OPTIONS), { fontURL: '@mathjax/generic-font/js/chtml/woff2', dynamicPrefix: '@mathjax/generic-font/js/chtml/dynamic' });
GenericFont.defaultCssFamilyPrefix = 'MJX-G-ZERO';
GenericFont.defaultVariantLetters = {
'normal': ''
};
GenericFont.defaultDelimiters = delimiters_js_1.delimiters;
GenericFont.defaultChars = {
'normal': normal_js_1.normal
};
GenericFont.defaultStyles = __assign(__assign({}, FontData_js_1.ChtmlFontData.defaultStyles), { 'mjx-container[jax="CHTML"] > mjx-math.G-N[breakable] > *': {
'font-family': 'MJX-G-ZERO, MJX-G-N'
}, '.G-N': {
'font-family': 'MJX-G-ZERO, MJX-G-N'
} });
GenericFont.defaultFonts = __assign(__assign({}, FontData_js_1.ChtmlFontData.defaultFonts), { '@font-face /* MJX-G-ZERO */': {
'font-family': 'MJX-G-ZERO',
src: 'url("%%URL%%/mjx-g-zero.woff2") format("woff2")'
}, '@font-face /* MJX-BRK */': {
'font-family': 'MJX-BRK',
src: 'url("%%URL%%/mjx-g-brk.woff2") format("woff2")'
}, '@font-face /* MJX-G-N */': {
'font-family': 'MJX-G-N',
src: 'url("%%URL%%/mjx-g-n.woff2") format("woff2")'
} });
return GenericFont;
}(Base));
exports.GenericFont = GenericFont;
//# sourceMappingURL=chtml.js.map