Wrapper.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  18. if (k2 === undefined) k2 = k;
  19. var desc = Object.getOwnPropertyDescriptor(m, k);
  20. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  21. desc = { enumerable: true, get: function() { return m[k]; } };
  22. }
  23. Object.defineProperty(o, k2, desc);
  24. }) : (function(o, m, k, k2) {
  25. if (k2 === undefined) k2 = k;
  26. o[k2] = m[k];
  27. }));
  28. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  29. Object.defineProperty(o, "default", { enumerable: true, value: v });
  30. }) : function(o, v) {
  31. o["default"] = v;
  32. });
  33. var __importStar = (this && this.__importStar) || function (mod) {
  34. if (mod && mod.__esModule) return mod;
  35. var result = {};
  36. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  37. __setModuleDefault(result, mod);
  38. return result;
  39. };
  40. var __values = (this && this.__values) || function(o) {
  41. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  42. if (m) return m.call(o);
  43. if (o && typeof o.length === "number") return {
  44. next: function () {
  45. if (o && i >= o.length) o = void 0;
  46. return { value: o && o[i++], done: !o };
  47. }
  48. };
  49. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  50. };
  51. var __read = (this && this.__read) || function (o, n) {
  52. var m = typeof Symbol === "function" && o[Symbol.iterator];
  53. if (!m) return o;
  54. var i = m.call(o), r, ar = [], e;
  55. try {
  56. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  57. }
  58. catch (error) { e = { error: error }; }
  59. finally {
  60. try {
  61. if (r && !r.done && (m = i["return"])) m.call(i);
  62. }
  63. finally { if (e) throw e.error; }
  64. }
  65. return ar;
  66. };
  67. var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
  68. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  69. if (ar || !(i in from)) {
  70. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  71. ar[i] = from[i];
  72. }
  73. }
  74. return to.concat(ar || Array.prototype.slice.call(from));
  75. };
  76. Object.defineProperty(exports, "__esModule", { value: true });
  77. exports.CommonWrapper = void 0;
  78. var Wrapper_js_1 = require("../../core/Tree/Wrapper.js");
  79. var MmlNode_js_1 = require("../../core/MmlTree/MmlNode.js");
  80. var string_js_1 = require("../../util/string.js");
  81. var LENGTHS = __importStar(require("../../util/lengths.js"));
  82. var Styles_js_1 = require("../../util/Styles.js");
  83. var BBox_js_1 = require("../../util/BBox.js");
  84. var FontData_js_1 = require("./FontData.js");
  85. var SMALLSIZE = 2 / 18;
  86. function MathMLSpace(script, size) {
  87. return (script ? size < SMALLSIZE ? 0 : SMALLSIZE : size);
  88. }
  89. var CommonWrapper = (function (_super) {
  90. __extends(CommonWrapper, _super);
  91. function CommonWrapper(factory, node, parent) {
  92. if (parent === void 0) { parent = null; }
  93. var _this = _super.call(this, factory, node) || this;
  94. _this.parent = null;
  95. _this.removedStyles = null;
  96. _this.styles = null;
  97. _this.variant = '';
  98. _this.bboxComputed = false;
  99. _this.stretch = FontData_js_1.NOSTRETCH;
  100. _this.font = null;
  101. _this.parent = parent;
  102. _this.font = factory.jax.font;
  103. _this.bbox = BBox_js_1.BBox.zero();
  104. _this.getStyles();
  105. _this.getVariant();
  106. _this.getScale();
  107. _this.getSpace();
  108. _this.childNodes = node.childNodes.map(function (child) {
  109. var wrapped = _this.wrap(child);
  110. if (wrapped.bbox.pwidth && (node.notParent || node.isKind('math'))) {
  111. _this.bbox.pwidth = BBox_js_1.BBox.fullWidth;
  112. }
  113. return wrapped;
  114. });
  115. return _this;
  116. }
  117. Object.defineProperty(CommonWrapper.prototype, "jax", {
  118. get: function () {
  119. return this.factory.jax;
  120. },
  121. enumerable: false,
  122. configurable: true
  123. });
  124. Object.defineProperty(CommonWrapper.prototype, "adaptor", {
  125. get: function () {
  126. return this.factory.jax.adaptor;
  127. },
  128. enumerable: false,
  129. configurable: true
  130. });
  131. Object.defineProperty(CommonWrapper.prototype, "metrics", {
  132. get: function () {
  133. return this.factory.jax.math.metrics;
  134. },
  135. enumerable: false,
  136. configurable: true
  137. });
  138. Object.defineProperty(CommonWrapper.prototype, "fixesPWidth", {
  139. get: function () {
  140. return !this.node.notParent && !this.node.isToken;
  141. },
  142. enumerable: false,
  143. configurable: true
  144. });
  145. CommonWrapper.prototype.wrap = function (node, parent) {
  146. if (parent === void 0) { parent = null; }
  147. var wrapped = this.factory.wrap(node, parent || this);
  148. if (parent) {
  149. parent.childNodes.push(wrapped);
  150. }
  151. this.jax.nodeMap.set(node, wrapped);
  152. return wrapped;
  153. };
  154. CommonWrapper.prototype.getBBox = function (save) {
  155. if (save === void 0) { save = true; }
  156. if (this.bboxComputed) {
  157. return this.bbox;
  158. }
  159. var bbox = (save ? this.bbox : BBox_js_1.BBox.zero());
  160. this.computeBBox(bbox);
  161. this.bboxComputed = save;
  162. return bbox;
  163. };
  164. CommonWrapper.prototype.getOuterBBox = function (save) {
  165. var e_1, _a;
  166. if (save === void 0) { save = true; }
  167. var bbox = this.getBBox(save);
  168. if (!this.styles)
  169. return bbox;
  170. var obox = new BBox_js_1.BBox();
  171. Object.assign(obox, bbox);
  172. try {
  173. for (var _b = __values(BBox_js_1.BBox.StyleAdjust), _c = _b.next(); !_c.done; _c = _b.next()) {
  174. var _d = __read(_c.value, 2), name_1 = _d[0], side = _d[1];
  175. var x = this.styles.get(name_1);
  176. if (x) {
  177. obox[side] += this.length2em(x, 1, obox.rscale);
  178. }
  179. }
  180. }
  181. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  182. finally {
  183. try {
  184. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  185. }
  186. finally { if (e_1) throw e_1.error; }
  187. }
  188. return obox;
  189. };
  190. CommonWrapper.prototype.computeBBox = function (bbox, recompute) {
  191. var e_2, _a;
  192. if (recompute === void 0) { recompute = false; }
  193. bbox.empty();
  194. try {
  195. for (var _b = __values(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
  196. var child = _c.value;
  197. bbox.append(child.getOuterBBox());
  198. }
  199. }
  200. catch (e_2_1) { e_2 = { error: e_2_1 }; }
  201. finally {
  202. try {
  203. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  204. }
  205. finally { if (e_2) throw e_2.error; }
  206. }
  207. bbox.clean();
  208. if (this.fixesPWidth && this.setChildPWidths(recompute)) {
  209. this.computeBBox(bbox, true);
  210. }
  211. };
  212. CommonWrapper.prototype.setChildPWidths = function (recompute, w, clear) {
  213. var e_3, _a;
  214. if (w === void 0) { w = null; }
  215. if (clear === void 0) { clear = true; }
  216. if (recompute) {
  217. return false;
  218. }
  219. if (clear) {
  220. this.bbox.pwidth = '';
  221. }
  222. var changed = false;
  223. try {
  224. for (var _b = __values(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
  225. var child = _c.value;
  226. var cbox = child.getOuterBBox();
  227. if (cbox.pwidth && child.setChildPWidths(recompute, w === null ? cbox.w : w, clear)) {
  228. changed = true;
  229. }
  230. }
  231. }
  232. catch (e_3_1) { e_3 = { error: e_3_1 }; }
  233. finally {
  234. try {
  235. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  236. }
  237. finally { if (e_3) throw e_3.error; }
  238. }
  239. return changed;
  240. };
  241. CommonWrapper.prototype.invalidateBBox = function () {
  242. if (this.bboxComputed) {
  243. this.bboxComputed = false;
  244. if (this.parent) {
  245. this.parent.invalidateBBox();
  246. }
  247. }
  248. };
  249. CommonWrapper.prototype.copySkewIC = function (bbox) {
  250. var first = this.childNodes[0];
  251. if (first === null || first === void 0 ? void 0 : first.bbox.sk) {
  252. bbox.sk = first.bbox.sk;
  253. }
  254. if (first === null || first === void 0 ? void 0 : first.bbox.dx) {
  255. bbox.dx = first.bbox.dx;
  256. }
  257. var last = this.childNodes[this.childNodes.length - 1];
  258. if (last === null || last === void 0 ? void 0 : last.bbox.ic) {
  259. bbox.ic = last.bbox.ic;
  260. bbox.w += bbox.ic;
  261. }
  262. };
  263. CommonWrapper.prototype.getStyles = function () {
  264. var styleString = this.node.attributes.getExplicit('style');
  265. if (!styleString)
  266. return;
  267. var style = this.styles = new Styles_js_1.Styles(styleString);
  268. for (var i = 0, m = CommonWrapper.removeStyles.length; i < m; i++) {
  269. var id = CommonWrapper.removeStyles[i];
  270. if (style.get(id)) {
  271. if (!this.removedStyles)
  272. this.removedStyles = {};
  273. this.removedStyles[id] = style.get(id);
  274. style.set(id, '');
  275. }
  276. }
  277. };
  278. CommonWrapper.prototype.getVariant = function () {
  279. if (!this.node.isToken)
  280. return;
  281. var attributes = this.node.attributes;
  282. var variant = attributes.get('mathvariant');
  283. if (!attributes.getExplicit('mathvariant')) {
  284. var values = attributes.getList('fontfamily', 'fontweight', 'fontstyle');
  285. if (this.removedStyles) {
  286. var style = this.removedStyles;
  287. if (style.fontFamily)
  288. values.family = style.fontFamily;
  289. if (style.fontWeight)
  290. values.weight = style.fontWeight;
  291. if (style.fontStyle)
  292. values.style = style.fontStyle;
  293. }
  294. if (values.fontfamily)
  295. values.family = values.fontfamily;
  296. if (values.fontweight)
  297. values.weight = values.fontweight;
  298. if (values.fontstyle)
  299. values.style = values.fontstyle;
  300. if (values.weight && values.weight.match(/^\d+$/)) {
  301. values.weight = (parseInt(values.weight) > 600 ? 'bold' : 'normal');
  302. }
  303. if (values.family) {
  304. variant = this.explicitVariant(values.family, values.weight, values.style);
  305. }
  306. else {
  307. if (this.node.getProperty('variantForm'))
  308. variant = '-tex-variant';
  309. variant = (CommonWrapper.BOLDVARIANTS[values.weight] || {})[variant] || variant;
  310. variant = (CommonWrapper.ITALICVARIANTS[values.style] || {})[variant] || variant;
  311. }
  312. }
  313. this.variant = variant;
  314. };
  315. CommonWrapper.prototype.explicitVariant = function (fontFamily, fontWeight, fontStyle) {
  316. var style = this.styles;
  317. if (!style)
  318. style = this.styles = new Styles_js_1.Styles();
  319. style.set('fontFamily', fontFamily);
  320. if (fontWeight)
  321. style.set('fontWeight', fontWeight);
  322. if (fontStyle)
  323. style.set('fontStyle', fontStyle);
  324. return '-explicitFont';
  325. };
  326. CommonWrapper.prototype.getScale = function () {
  327. var scale = 1, parent = this.parent;
  328. var pscale = (parent ? parent.bbox.scale : 1);
  329. var attributes = this.node.attributes;
  330. var scriptlevel = Math.min(attributes.get('scriptlevel'), 2);
  331. var fontsize = attributes.get('fontsize');
  332. var mathsize = (this.node.isToken || this.node.isKind('mstyle') ?
  333. attributes.get('mathsize') : attributes.getInherited('mathsize'));
  334. if (scriptlevel !== 0) {
  335. scale = Math.pow(attributes.get('scriptsizemultiplier'), scriptlevel);
  336. var scriptminsize = this.length2em(attributes.get('scriptminsize'), .8, 1);
  337. if (scale < scriptminsize)
  338. scale = scriptminsize;
  339. }
  340. if (this.removedStyles && this.removedStyles.fontSize && !fontsize) {
  341. fontsize = this.removedStyles.fontSize;
  342. }
  343. if (fontsize && !attributes.getExplicit('mathsize')) {
  344. mathsize = fontsize;
  345. }
  346. if (mathsize !== '1') {
  347. scale *= this.length2em(mathsize, 1, 1);
  348. }
  349. this.bbox.scale = scale;
  350. this.bbox.rscale = scale / pscale;
  351. };
  352. CommonWrapper.prototype.getSpace = function () {
  353. var isTop = this.isTopEmbellished();
  354. var hasSpacing = this.node.hasSpacingAttributes();
  355. if (this.jax.options.mathmlSpacing || hasSpacing) {
  356. isTop && this.getMathMLSpacing();
  357. }
  358. else {
  359. this.getTeXSpacing(isTop, hasSpacing);
  360. }
  361. };
  362. CommonWrapper.prototype.getMathMLSpacing = function () {
  363. var node = this.node.coreMO();
  364. var child = node.coreParent();
  365. var parent = child.parent;
  366. if (!parent || !parent.isKind('mrow') || parent.childNodes.length === 1)
  367. return;
  368. var attributes = node.attributes;
  369. var isScript = (attributes.get('scriptlevel') > 0);
  370. this.bbox.L = (attributes.isSet('lspace') ?
  371. Math.max(0, this.length2em(attributes.get('lspace'))) :
  372. MathMLSpace(isScript, node.lspace));
  373. this.bbox.R = (attributes.isSet('rspace') ?
  374. Math.max(0, this.length2em(attributes.get('rspace'))) :
  375. MathMLSpace(isScript, node.rspace));
  376. var n = parent.childIndex(child);
  377. if (n === 0)
  378. return;
  379. var prev = parent.childNodes[n - 1];
  380. if (!prev.isEmbellished)
  381. return;
  382. var bbox = this.jax.nodeMap.get(prev).getBBox();
  383. if (bbox.R) {
  384. this.bbox.L = Math.max(0, this.bbox.L - bbox.R);
  385. }
  386. };
  387. CommonWrapper.prototype.getTeXSpacing = function (isTop, hasSpacing) {
  388. if (!hasSpacing) {
  389. var space = this.node.texSpacing();
  390. if (space) {
  391. this.bbox.L = this.length2em(space);
  392. }
  393. }
  394. if (isTop || hasSpacing) {
  395. var attributes = this.node.coreMO().attributes;
  396. if (attributes.isSet('lspace')) {
  397. this.bbox.L = Math.max(0, this.length2em(attributes.get('lspace')));
  398. }
  399. if (attributes.isSet('rspace')) {
  400. this.bbox.R = Math.max(0, this.length2em(attributes.get('rspace')));
  401. }
  402. }
  403. };
  404. CommonWrapper.prototype.isTopEmbellished = function () {
  405. return (this.node.isEmbellished &&
  406. !(this.node.parent && this.node.parent.isEmbellished));
  407. };
  408. CommonWrapper.prototype.core = function () {
  409. return this.jax.nodeMap.get(this.node.core());
  410. };
  411. CommonWrapper.prototype.coreMO = function () {
  412. return this.jax.nodeMap.get(this.node.coreMO());
  413. };
  414. CommonWrapper.prototype.getText = function () {
  415. var e_4, _a;
  416. var text = '';
  417. if (this.node.isToken) {
  418. try {
  419. for (var _b = __values(this.node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
  420. var child = _c.value;
  421. if (child instanceof MmlNode_js_1.TextNode) {
  422. text += child.getText();
  423. }
  424. }
  425. }
  426. catch (e_4_1) { e_4 = { error: e_4_1 }; }
  427. finally {
  428. try {
  429. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  430. }
  431. finally { if (e_4) throw e_4.error; }
  432. }
  433. }
  434. return text;
  435. };
  436. CommonWrapper.prototype.canStretch = function (direction) {
  437. this.stretch = FontData_js_1.NOSTRETCH;
  438. if (this.node.isEmbellished) {
  439. var core = this.core();
  440. if (core && core.node !== this.node) {
  441. if (core.canStretch(direction)) {
  442. this.stretch = core.stretch;
  443. }
  444. }
  445. }
  446. return this.stretch.dir !== 0;
  447. };
  448. CommonWrapper.prototype.getAlignShift = function () {
  449. var _a;
  450. var _b = (_a = this.node.attributes).getList.apply(_a, __spreadArray([], __read(MmlNode_js_1.indentAttributes), false)), indentalign = _b.indentalign, indentshift = _b.indentshift, indentalignfirst = _b.indentalignfirst, indentshiftfirst = _b.indentshiftfirst;
  451. if (indentalignfirst !== 'indentalign') {
  452. indentalign = indentalignfirst;
  453. }
  454. if (indentalign === 'auto') {
  455. indentalign = this.jax.options.displayAlign;
  456. }
  457. if (indentshiftfirst !== 'indentshift') {
  458. indentshift = indentshiftfirst;
  459. }
  460. if (indentshift === 'auto') {
  461. indentshift = this.jax.options.displayIndent;
  462. if (indentalign === 'right' && !indentshift.match(/^\s*0[a-z]*\s*$/)) {
  463. indentshift = ('-' + indentshift.trim()).replace(/^--/, '');
  464. }
  465. }
  466. var shift = this.length2em(indentshift, this.metrics.containerWidth);
  467. return [indentalign, shift];
  468. };
  469. CommonWrapper.prototype.getAlignX = function (W, bbox, align) {
  470. return (align === 'right' ? W - (bbox.w + bbox.R) * bbox.rscale :
  471. align === 'left' ? bbox.L * bbox.rscale :
  472. (W - bbox.w * bbox.rscale) / 2);
  473. };
  474. CommonWrapper.prototype.getAlignY = function (H, D, h, d, align) {
  475. return (align === 'top' ? H - h :
  476. align === 'bottom' ? d - D :
  477. align === 'center' ? ((H - h) - (D - d)) / 2 :
  478. 0);
  479. };
  480. CommonWrapper.prototype.getWrapWidth = function (i) {
  481. return this.childNodes[i].getBBox().w;
  482. };
  483. CommonWrapper.prototype.getChildAlign = function (_i) {
  484. return 'left';
  485. };
  486. CommonWrapper.prototype.percent = function (m) {
  487. return LENGTHS.percent(m);
  488. };
  489. CommonWrapper.prototype.em = function (m) {
  490. return LENGTHS.em(m);
  491. };
  492. CommonWrapper.prototype.px = function (m, M) {
  493. if (M === void 0) { M = -LENGTHS.BIGDIMEN; }
  494. return LENGTHS.px(m, M, this.metrics.em);
  495. };
  496. CommonWrapper.prototype.length2em = function (length, size, scale) {
  497. if (size === void 0) { size = 1; }
  498. if (scale === void 0) { scale = null; }
  499. if (scale === null) {
  500. scale = this.bbox.scale;
  501. }
  502. return LENGTHS.length2em(length, size, scale, this.jax.pxPerEm);
  503. };
  504. CommonWrapper.prototype.unicodeChars = function (text, name) {
  505. if (name === void 0) { name = this.variant; }
  506. var chars = (0, string_js_1.unicodeChars)(text);
  507. var variant = this.font.getVariant(name);
  508. if (variant && variant.chars) {
  509. var map_1 = variant.chars;
  510. chars = chars.map(function (n) { return ((map_1[n] || [])[3] || {}).smp || n; });
  511. }
  512. return chars;
  513. };
  514. CommonWrapper.prototype.remapChars = function (chars) {
  515. return chars;
  516. };
  517. CommonWrapper.prototype.mmlText = function (text) {
  518. return this.node.factory.create('text').setText(text);
  519. };
  520. CommonWrapper.prototype.mmlNode = function (kind, properties, children) {
  521. if (properties === void 0) { properties = {}; }
  522. if (children === void 0) { children = []; }
  523. return this.node.factory.create(kind, properties, children);
  524. };
  525. CommonWrapper.prototype.createMo = function (text) {
  526. var mmlFactory = this.node.factory;
  527. var textNode = mmlFactory.create('text').setText(text);
  528. var mml = mmlFactory.create('mo', { stretchy: true }, [textNode]);
  529. mml.inheritAttributesFrom(this.node);
  530. var node = this.wrap(mml);
  531. node.parent = this;
  532. return node;
  533. };
  534. CommonWrapper.prototype.getVariantChar = function (variant, n) {
  535. var char = this.font.getChar(variant, n) || [0, 0, 0, { unknown: true }];
  536. if (char.length === 3) {
  537. char[3] = {};
  538. }
  539. return char;
  540. };
  541. CommonWrapper.kind = 'unknown';
  542. CommonWrapper.styles = {};
  543. CommonWrapper.removeStyles = [
  544. 'fontSize', 'fontFamily', 'fontWeight',
  545. 'fontStyle', 'fontVariant', 'font'
  546. ];
  547. CommonWrapper.skipAttributes = {
  548. fontfamily: true, fontsize: true, fontweight: true, fontstyle: true,
  549. color: true, background: true,
  550. 'class': true, href: true, style: true,
  551. xmlns: true
  552. };
  553. CommonWrapper.BOLDVARIANTS = {
  554. bold: {
  555. normal: 'bold',
  556. italic: 'bold-italic',
  557. fraktur: 'bold-fraktur',
  558. script: 'bold-script',
  559. 'sans-serif': 'bold-sans-serif',
  560. 'sans-serif-italic': 'sans-serif-bold-italic'
  561. },
  562. normal: {
  563. bold: 'normal',
  564. 'bold-italic': 'italic',
  565. 'bold-fraktur': 'fraktur',
  566. 'bold-script': 'script',
  567. 'bold-sans-serif': 'sans-serif',
  568. 'sans-serif-bold-italic': 'sans-serif-italic'
  569. }
  570. };
  571. CommonWrapper.ITALICVARIANTS = {
  572. italic: {
  573. normal: 'italic',
  574. bold: 'bold-italic',
  575. 'sans-serif': 'sans-serif-italic',
  576. 'bold-sans-serif': 'sans-serif-bold-italic'
  577. },
  578. normal: {
  579. italic: 'normal',
  580. 'bold-italic': 'bold',
  581. 'sans-serif-italic': 'sans-serif',
  582. 'sans-serif-bold-italic': 'bold-sans-serif'
  583. }
  584. };
  585. return CommonWrapper;
  586. }(Wrapper_js_1.AbstractWrapper));
  587. exports.CommonWrapper = CommonWrapper;
  588. //# sourceMappingURL=Wrapper.js.map