site/node_modules/mathjax-full/js/output/common/Wrappers/mtext.js

51 lines
2.3 KiB
JavaScript
Raw Normal View History

2024-10-14 08:09:33 +02:00
"use strict";
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommonMtextMixin = void 0;
function CommonMtextMixin(Base) {
var _a;
return _a = (function (_super) {
__extends(class_1, _super);
function class_1() {
return _super !== null && _super.apply(this, arguments) || this;
}
class_1.prototype.getVariant = function () {
var options = this.jax.options;
var data = this.jax.math.outputData;
var merror = ((!!data.merrorFamily || !!options.merrorFont) && this.node.Parent.isKind('merror'));
if (!!data.mtextFamily || !!options.mtextFont || merror) {
var variant = this.node.attributes.get('mathvariant');
var font = this.constructor.INHERITFONTS[variant] || this.jax.font.getCssFont(variant);
var family = font[0] || (merror ? data.merrorFamily || options.merrorFont :
data.mtextFamily || options.mtextFont);
this.variant = this.explicitVariant(family, font[2] ? 'bold' : '', font[1] ? 'italic' : '');
return;
}
_super.prototype.getVariant.call(this);
};
return class_1;
}(Base)),
_a.INHERITFONTS = {
normal: ['', false, false],
bold: ['', false, true],
italic: ['', true, false],
'bold-italic': ['', true, true]
},
_a;
}
exports.CommonMtextMixin = CommonMtextMixin;
//# sourceMappingURL=mtext.js.map