Skip to content

Commit 81ae1c7

Browse files
committed
fix(theme): improve Chinese font handling
close #2036
1 parent 9b85e43 commit 81ae1c7

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/client/theme-default/styles/base.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ body {
2626
color: var(--vp-c-text-1);
2727
background-color: var(--vp-c-bg);
2828
direction: ltr;
29-
font-synthesis: none;
29+
font-synthesis: style;
3030
text-rendering: optimizeLegibility;
3131
-webkit-font-smoothing: antialiased;
3232
-moz-osx-font-smoothing: grayscale;

src/client/theme-default/styles/fonts.css

+8
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,11 @@ html body {
155155
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
156156
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
157157
}
158+
159+
/* Chinese quotes rendering fix. 中英文弯引号共享 Unicode 码位,确保引号使用中文字体渲染 */
160+
@font-face {
161+
font-family: 'Chinese Quotes';
162+
src: local('PingFang SC Regular'), local('PingFang SC'), local('SimHei'),
163+
local('Source Han Sans SC');
164+
unicode-range: U+2018, U+2019, U+201C, U+201D; /* 分别是 ‘’“” */
165+
}

src/client/theme-default/styles/vars.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@
143143
* -------------------------------------------------------------------------- */
144144

145145
:root {
146-
--vp-font-family-base: 'Inter var', 'Inter', ui-sans-serif, system-ui,
147-
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
148-
Helvetica, Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
149-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
146+
--vp-font-family-base: 'Chinese Quotes', 'Inter var', 'Inter', ui-sans-serif,
147+
system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
148+
'Helvetica Neue', Helvetica, Arial, 'Noto Sans', sans-serif,
149+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
150150
--vp-font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco,
151151
Consolas, 'Liberation Mono', 'Courier New', monospace;
152152
}

0 commit comments

Comments
 (0)