@windoc/core 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3898,12 +3898,12 @@ var TitleLevel = /* @__PURE__ */ ((TitleLevel2) => {
|
|
|
3898
3898
|
|
|
3899
3899
|
// src/dataset/constant/Title.ts
|
|
3900
3900
|
var defaultTitleOption = {
|
|
3901
|
-
defaultFirstSize:
|
|
3902
|
-
defaultSecondSize:
|
|
3903
|
-
defaultThirdSize:
|
|
3904
|
-
defaultFourthSize:
|
|
3905
|
-
defaultFifthSize:
|
|
3906
|
-
defaultSixthSize:
|
|
3901
|
+
defaultFirstSize: 20,
|
|
3902
|
+
defaultSecondSize: 16,
|
|
3903
|
+
defaultThirdSize: 14,
|
|
3904
|
+
defaultFourthSize: 12,
|
|
3905
|
+
defaultFifthSize: 11,
|
|
3906
|
+
defaultSixthSize: 11
|
|
3907
3907
|
};
|
|
3908
3908
|
var titleSizeMapping = {
|
|
3909
3909
|
["first" /* FIRST */]: "defaultFirstSize",
|
|
@@ -5324,7 +5324,7 @@ function convertElementToDom(element, options) {
|
|
|
5324
5324
|
if (element.italic) {
|
|
5325
5325
|
dom.style.fontStyle = "italic";
|
|
5326
5326
|
}
|
|
5327
|
-
dom.style.fontSize = `${element.size || options.defaultSize}
|
|
5327
|
+
dom.style.fontSize = `${element.size || options.defaultSize}pt`;
|
|
5328
5328
|
if (element.highlight) {
|
|
5329
5329
|
dom.style.backgroundColor = element.highlight;
|
|
5330
5330
|
}
|
|
@@ -5650,7 +5650,7 @@ function convertTextNodeToElement(textNode) {
|
|
|
5650
5650
|
color: style.color,
|
|
5651
5651
|
bold: Number(style.fontWeight) > 500,
|
|
5652
5652
|
italic: style.fontStyle.includes("italic"),
|
|
5653
|
-
size: Math.
|
|
5653
|
+
size: Math.round(parseFloat(style.fontSize) * 0.75)
|
|
5654
5654
|
};
|
|
5655
5655
|
if (anchorNode.nodeName === "SUB" || style.verticalAlign === "sub") {
|
|
5656
5656
|
element.type = "subscript" /* SUBSCRIPT */;
|
|
@@ -21091,7 +21091,8 @@ var Draw = class {
|
|
|
21091
21091
|
const { defaultSize, defaultFont } = this.options;
|
|
21092
21092
|
const font = el.font || defaultFont;
|
|
21093
21093
|
const size = el.actualSize || el.size || defaultSize;
|
|
21094
|
-
|
|
21094
|
+
const sizePx = size * (96 / 72) * scale;
|
|
21095
|
+
return `${el.italic ? "italic " : ""}${el.bold ? "bold " : ""}${sizePx}px ${font}`;
|
|
21095
21096
|
}
|
|
21096
21097
|
getElementSize(el) {
|
|
21097
21098
|
return el.actualSize || el.size || this.options.defaultSize;
|