@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 CHANGED
@@ -3977,12 +3977,12 @@ var TitleLevel = /* @__PURE__ */ ((TitleLevel2) => {
3977
3977
 
3978
3978
  // src/dataset/constant/Title.ts
3979
3979
  var defaultTitleOption = {
3980
- defaultFirstSize: 26,
3981
- defaultSecondSize: 24,
3982
- defaultThirdSize: 22,
3983
- defaultFourthSize: 20,
3984
- defaultFifthSize: 18,
3985
- defaultSixthSize: 16
3980
+ defaultFirstSize: 20,
3981
+ defaultSecondSize: 16,
3982
+ defaultThirdSize: 14,
3983
+ defaultFourthSize: 12,
3984
+ defaultFifthSize: 11,
3985
+ defaultSixthSize: 11
3986
3986
  };
3987
3987
  var titleSizeMapping = {
3988
3988
  ["first" /* FIRST */]: "defaultFirstSize",
@@ -5403,7 +5403,7 @@ function convertElementToDom(element, options) {
5403
5403
  if (element.italic) {
5404
5404
  dom.style.fontStyle = "italic";
5405
5405
  }
5406
- dom.style.fontSize = `${element.size || options.defaultSize}px`;
5406
+ dom.style.fontSize = `${element.size || options.defaultSize}pt`;
5407
5407
  if (element.highlight) {
5408
5408
  dom.style.backgroundColor = element.highlight;
5409
5409
  }
@@ -5729,7 +5729,7 @@ function convertTextNodeToElement(textNode) {
5729
5729
  color: style.color,
5730
5730
  bold: Number(style.fontWeight) > 500,
5731
5731
  italic: style.fontStyle.includes("italic"),
5732
- size: Math.floor(parseFloat(style.fontSize))
5732
+ size: Math.round(parseFloat(style.fontSize) * 0.75)
5733
5733
  };
5734
5734
  if (anchorNode.nodeName === "SUB" || style.verticalAlign === "sub") {
5735
5735
  element.type = "subscript" /* SUBSCRIPT */;
@@ -21170,7 +21170,8 @@ var Draw = class {
21170
21170
  const { defaultSize, defaultFont } = this.options;
21171
21171
  const font = el.font || defaultFont;
21172
21172
  const size = el.actualSize || el.size || defaultSize;
21173
- return `${el.italic ? "italic " : ""}${el.bold ? "bold " : ""}${size * scale}px ${font}`;
21173
+ const sizePx = size * (96 / 72) * scale;
21174
+ return `${el.italic ? "italic " : ""}${el.bold ? "bold " : ""}${sizePx}px ${font}`;
21174
21175
  }
21175
21176
  getElementSize(el) {
21176
21177
  return el.actualSize || el.size || this.options.defaultSize;