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

fix: chinese font display #449

Closed
wants to merge 1 commit into from

Conversation

No06
Copy link
Collaborator

@No06 No06 commented Jul 4, 2024

fix #397

before
57fd555207eadbca81653c6b2c42e8f9

after
16cff8dd0d4e71f4defdd76807496f42

@lollipopkit
Copy link
Owner

  • Check system lang at first, if Chinese (eg. LC_ALL | LANG on Linux), use it.
  • macOS doesn't have this issue

@lin-calvin
Copy link
Collaborator

Only enable on WIndows since Linux,Macos,Andorid dont have this issue? or provide a setting item to let user to decide enable it or not

@No06
Copy link
Collaborator Author

No06 commented Jul 5, 2024

更多的是修复,而不是修改,理应不会产生新的问题。

这个操作也只是为 textThemefontFamilyFallback 添加备用字体,当无法找到或渲染主字体时,它会按顺序尝试使用 fontFamilyFallback 中列出的字体。

所以不需要另外判断是否是中文用户,或者其他平台的用户。

参阅源代码 LastMonopoly/chinese_font_library/chinese_font_library.dart#L74

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It's more of a fix than a modification, and it should not cause new problems.

This operation also just adds a fallback font to the textTheme's fontFamilyFallback, which will try to use the fonts listed in the fontFamilyFallback in sequence when the main font cannot be found or rendered.

So there is no need to judge whether it is a Chinese user or a user of other platforms.

See source code LastMonopoly/chinese_font_library/chinese_font_library.dart#L74

@lollipopkit
Copy link
Owner

Sorry, this pr will be closed

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

Successfully merging this pull request may close these issues.

Windows 11 下中文字体显示问题
4 participants
-