Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否将中文字体的斜体修改为宋体或者楷体 #8

Open
Behemoth-s opened this issue Jan 15, 2021 · 1 comment
Open

能否将中文字体的斜体修改为宋体或者楷体 #8

Behemoth-s opened this issue Jan 15, 2021 · 1 comment

Comments

@Behemoth-s
Copy link

中文斜体的显示效果几乎为0,所以中文字体的斜体修改为宋体或者楷体会更适合一点。

由于并不是很懂css,我尝试修改了一下
添加了一个中文斜体的font-family

@font-face {
    font-family: 'ChineseItalic';
    font-style: italic;
    font-weight: 300;
    font-display: swap;
    src: url('next/JetBrainsMono-Regular.ttf') format('truetype');
    unicode-range: U+4E00-9FFF;
}

修改了字体

html,
body,
#write {
    color: var(--text-color);
    font-size: var(--base-font-size);
    background: #ffffff;
    font-family: Overpass, "ChineseItalic" ,"GlowSansSC", "Helvetica Neue", "pingfang sc", "microsoft yahei", sans-serif;
    font-weight: 400;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    /* letter-spacing: -0.5px; */
}

但是似乎不起作用。

@billchen2k
Copy link
Owner

你可以这样修改你添加的 font-family:

@font-face {
    font-family: 'ChineseItalic';
    font-style: italic;
    font-weight: 400;
    src: local('Songti SC Regular'); /* 本地字体名字 */
}

然后修改字体将 ChineseItalic 放在首位:

html,
body,
#write {
    color: var(--text-color);
    font-size: var(--base-font-size);
    background: #ffffff;
    font-family: "ChineseItalic", Overpass ,"GlowSansSC", "Helvetica Neue", "pingfang sc", "microsoft yahei", sans-serif;
    font-weight: 400;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    /* letter-spacing: -0.5px; */
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants