Skip to content

Commit 87fc4fb

Browse files
committed
fix: 修复mac渲染字体宽度问题
1 parent 0264a6a commit 87fc4fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/utils/font.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const _cache = new MaxSizeCache<string, number>(10000);
99
/** canvas中使用的字体 */
1010
export let FONT = "-apple-system, BlinkMacSystemFont, MiSans, system-ui, sans-serif";
1111
if (isMac) {
12-
FONT = "-apple-system, system-ui, sans-serif";
12+
// 只有 PingFang TC 在mac中,中英文混合文字 宽度才能计算正确,离谱
13+
FONT = "PingFang SC, PingFang TC, -apple-system";
1314
}
1415

1516
// eslint-disable-next-line prefer-const

0 commit comments

Comments
 (0)