Skip to content

Settings - Editor - Font is garbled on macOS #13713

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

Closed
3 tasks done
tinywaves opened this issue Jan 3, 2025 · 13 comments
Closed
3 tasks done

Settings - Editor - Font is garbled on macOS #13713

tinywaves opened this issue Jan 3, 2025 · 13 comments
Assignees
Labels
Milestone

Comments

@tinywaves
Copy link

tinywaves commented Jan 3, 2025

文档的标题中文渲染似乎有问题

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

中文标题似乎在渲染上有问题,正文也有这个问题,有点像编码问题
CleanShot_2025-01-03_16 02 23@2x
CleanShot_2025-01-03_16 04 13@2x
我发现在选择字体的时候,选项全都乱码了,这个该咋解决
CleanShot_2025-01-03_16 04 47@2x

Expected result

/

Screenshot or screen recording presentation

No response

Version environment

- Version: Version 3.1.18 (3.1.18)
- Operating System: macOS 15.2
- Browser (if used):

Log file

/

More information

No response

@88250
Copy link
Member

88250 commented Jan 3, 2025

标题的字体问题: #13688

设置字体列表乱码稍后排查。

@88250 88250 self-assigned this Jan 3, 2025
@88250 88250 changed the title 文档的标题中文渲染似乎有问题 Settings - Editor - Font is garbled on macOS Jan 3, 2025
@88250 88250 added the Bug label Jan 3, 2025
@TCOTC
Copy link
Contributor

TCOTC commented Jan 3, 2025

我那个PR应该只影响Windows,Mac上的字体问题我不清楚

@tinywaves 麻烦像这样操作看看标题渲染的字体是什么:

video-uMuCWtO.mp4

@tinywaves
Copy link
Author

tinywaves commented Jan 3, 2025

我那个PR应该只影响Windows,Mac上的字体问题我不清楚

@tinywaves 麻烦像这样操作看看标题渲染的字体是什么:

video-uMuCWtO.mp4

CleanShot_2025-01-03_17 24 45@2x
是一个很奇怪的字体 @TCOTC

@TCOTC
Copy link
Contributor

TCOTC commented Jan 3, 2025

麻烦用下面这个 CSS 代码片段测试一下,从 BlinkMacSystemFont, Helvetica, ... 开始,每次删一个,看看删掉哪个字体之后能正常显示

:root:lang(zh_CN) {
    --emoji-font-family: "Emojis Additional", "Emojis Reset";
    --b3-font-family: var(--emoji-font-family), BlinkMacSystemFont, Helvetica, "PingFang SC", "Luxi Sans", "DejaVu Sans", arial, "Microsoft Yahei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif, emojis;
}

@88250
Copy link
Member

88250 commented Jan 3, 2025 via email

88250 added a commit that referenced this issue Jan 4, 2025

Verified

This commit was signed with the committer’s verified signature.
88250 added a commit that referenced this issue Jan 4, 2025

Verified

This commit was signed with the committer’s verified signature.
88250 added a commit that referenced this issue Jan 4, 2025

Verified

This commit was signed with the committer’s verified signature.
@88250 88250 added this to the 3.1.19 milestone Jan 4, 2025
@88250 88250 closed this as completed Jan 4, 2025
@TCOTC
Copy link
Contributor

TCOTC commented Jan 4, 2025

if 和 else if 后面执行的代码不是一样的吗,为什么不合起来?

@88250
Copy link
Member

88250 commented Jan 4, 2025

稍后调整

88250 added a commit that referenced this issue Jan 4, 2025

Verified

This commit was signed with the committer’s verified signature.
@tinywaves
Copy link
Author

tinywaves commented Jan 6, 2025

看到这个问题 closed 掉了,等后续发布新的 release 我可以看看有没有问题。不过我今天发现一个细节是因为我设置整体的 language(设置-外观-语言) 为英文,如果设置为中文则渲染是正常的。 @88250 @TCOTC 可以参考一下。

不过字体列表依旧是乱码的,和语言无关
CleanShot_2025-01-07_00 26 35@2x

@TCOTC
Copy link
Contributor

TCOTC commented Jan 6, 2025

不过我今天发现一个细节是因为我设置整体的 language(设置-外观-语言) 为英文,如果设置为中文则渲染是正常的。

那这个是正常的,不同语种的字体不同。

@tinywaves
Copy link
Author

tinywaves commented Jan 6, 2025

不过我今天发现一个细节是因为我设置整体的 language(设置-外观-语言) 为英文,如果设置为中文则渲染是正常的。

那这个是正常的,不同语种的字体不同。

这个不应该是符合预期的吧,文本是否正常渲染和设置的语言之间我认为是没有关系的。如果某个字体支持某个字符那自然可以渲染正常。字体的渲染效果应该与字体本身支持的字符集有关,而不是取决于语言设置。

比如我设置的字体是 poppins,该字体支持中文和西文,但是在中文环境下渲染正常,英文环境下就会出现问题,正常来说不论设置的什么语言渲染应该都是正常的,因为poppins是支持 入门 两个字符的。
CleanShot_2025-01-07_01 47 15@2x
CleanShot_2025-01-07_01 47 35@2x

@TCOTC
Copy link
Contributor

TCOTC commented Jan 6, 2025

这个符合预期,默认是没有指定中文字体的。同一个字在简体中文、繁体中文、日语中显示的可能都不同。

@tinywaves
Copy link
Author

tinywaves commented Jan 6, 2025

所以我可以理解为这是思源在实现渲染引擎时特意实现的字体区域特化效果吗,相同的一个中文字,设置为日语和设置为简中可能看到不一样的渲染效果。

如果是特意这么实现的,那么字体设置的优先级就会非常低,某些字体没有设计地域变体,那么就会被回退,甚至无法得知回退到何种渲染方式。(比如我当前遇到的问题,所以我该如何去规避我这边遇到的问题,或者说一个美国人在使用思源,写了 入门 两个字如何保证渲染正常)

@TCOTC
Copy link
Contributor

TCOTC commented Jan 6, 2025

这个字体优先级只是简单的 CSS 样式而已,之前用英文界面也能正常显示简体中文字形是因为没有考虑国际化,后面改了。

没法保证会回退到哪个字体,这个没办法,有需要的用户必须自行选择字体系列然后使用 CSS 代码片段。


补充:在操作系统中,日语字体的优先级一般高于中文字体。

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

No branches or pull requests

3 participants