Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(render): px to pt (#1382)
Univer608f9df98022
diff --git a/packages/engine-render/src/basics/tools.ts b/packages/engine-render/src/basics/tools.tsindex 79c9b928d2..c9cf94e5e8 100644--- a/packages/engine-render/src/basics/tools.ts+++ b/packages/engine-render/src/basics/tools.ts@@ -258,10 +258,10 @@ export function getFontStyleString(textStyle?: IStyleBase, localeService?: Local// TODO: @jikkai @DR-Univer should read default font from configuration, not from locale serviceconst defaultFont = 'Arial';- const defaultFontSize = 13;+ const defaultFontSize = 11;if (!textStyle) {- const fontString = `${defaultFontSize}px ${defaultFont}`;+ const fontString = `${defaultFontSize}pt ${defaultFont}`;return {fontCache: fontString,@@ -321,7 +321,7 @@ export function getFontStyleString(textStyle?: IStyleBase, localeService?: LocalfontSize *= baselineOffset === BaselineOffset.SUBSCRIPT ? sbr : spr;}- const fontStringPure = `${italic} ${bold} ${fontSize}px ${fontFamilyResult}`;+ const fontStringPure = `${italic} ${bold} ${fontSize}pt ${fontFamilyResult}`;const fontString = `${fontStringPure}, ${DEFAULT_FONTFACE_PLANE} `;@@ -415,7 +415,7 @@ export function hasSpace(text: string) {const one_thousand = 1000;-// 返回屏幕DPI+// 返回屏幕 DPIlet dpi_cache: Nullable<number>;export function getDPI() {if (dpi_cache) {