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

Wrong CJK font in the UI #536

Open
Z-Clive opened this issue Apr 18, 2016 · 20 comments
Open

Wrong CJK font in the UI #536

Z-Clive opened this issue Apr 18, 2016 · 20 comments

Comments

@Z-Clive
Copy link

Z-Clive commented Apr 18, 2016

Hello guys,

Thanks for this amazing work.

I'm currently using the latest version of Zeal on Windows 10 and the default font in the list and other stuff like settings panel is not so good. Hopefully you could implement a feature to allow users change the default font shows inside the app.

@trollixx
Copy link
Member

Zeal should use the font your system provides, but I do see the problem on your screenshot in #537.

@Z-Clive
Copy link
Author

Z-Clive commented Apr 20, 2016

I thought so, for Zeal shows the default font (aka. Segoe UI) in the list pane. However, either in the search result pane or in the list pane where the item was truncated, it shows a different font. Here's an example (the example for the search results are shown in #537 ):

2016_04_20_10_33_09_mousegesturel

@trollixx
Copy link
Member

Could you check if the latest CI build has the same problem?

@Z-Clive
Copy link
Author

Z-Clive commented Apr 20, 2016

@trollixx Yep, those 2 problems seem to be fixed in the latest CI Build. Although that ugly font still shows in few places like settings panel, it's much more usable and pretty now.

@trollixx
Copy link
Member

Where exactly in settings? Available/Installed docset lists?

@Z-Clive
Copy link
Author

Z-Clive commented Apr 20, 2016

@trollixx Here's another screenshot to demonstrate such issue:

1

@trollixx
Copy link
Member

trollixx commented Apr 20, 2016 via email

@Z-Clive
Copy link
Author

Z-Clive commented Apr 20, 2016

The language is zh-CN. And absolutely no modification to default font or theme.

@trollixx
Copy link
Member

trollixx commented Sep 19, 2016

@Z-Clive There were several improvements in the related code, could you give a CI build another try?

@bosbyj
Copy link

bosbyj commented Mar 10, 2017

This is a bug of long history from QT, that messes up with Chinese/Japanese/Korean fonts. Unless Zeal presets the UI font globally as san-serif/serif, there is no quick remedy.

@trollixx
Copy link
Member

trollixx commented Jan 2, 2018

Indeed seems like a bug in Qt, but I am not sure how to debug this, considering I don't have Chinese Windows.

@liangqi I saw people talking to you on IRC regarding Qt issues on Chinese Windows. Any ideas about what could be wrong here?

@bosbyj
Copy link

bosbyj commented Jan 3, 2018 via email

@trollixx
Copy link
Member

trollixx commented Jan 3, 2018

Considering that in certain places fonts are rendered properly, it feels like the bug should be easy to fix.

@trollixx
Copy link
Member

trollixx commented Jan 3, 2018

@bosbyj @Z-Clive Could you give Zeal v0.5.0 a try and see if the problem is exactly the same? I think the screenshots above are from v0.3.1, and there were some changes since then.

@bosbyj
Copy link

bosbyj commented Jan 6, 2018

I call this a "SimSun Ghost in QT".

Back in the old days, when people were using Windows 95, 98, XP, Simsun was the prevailing font set in simplifed Chinese operation systems. QT3/QT4 would detect this font and put it into default use.

However, even if you changed the default font system wide, for example, to TAHOMA, some parts of QT's widget still got rendered by Simsun font type. This also occured in the later Windows Vista, 7, 8, 10, while the simplified Chinese version OS chose Segoe or MS Yahei as its default font.

A mixture of the real system default font and "Simsun".

Respectively, it could also happen in Japanese Windows, with the Mincho and Gothic fonts.

image

image

@trollixx
Copy link
Member

trollixx commented Jan 6, 2018

@bosbyj Thanks for the background story.

It looks like parts rendered by the application itself (list delegates) are fine, and all default Qt's rendering is off. Considering we have a lot of Chinese users, I would love to have this fixed, but I need to find some time and dig into how Qt chooses fonts. This seems like a font priority bug, or Qt not reading the system preference by default.

@bosbyj
Copy link

bosbyj commented Jan 7, 2018

You are welcome and thank you for your effort.

I am user of many QT based gui apps, to name a few, GoldenDict, Anki, Calibre ... and they all look alike, with font messed up by Simsun. I now take this a feature of QT, trying to avoid perfectionism.

If you want to fix it, you may ship an open source cjk font and override the setting globally for all Chinese-Japanese-Korean users.

@trollixx
Copy link
Member

trollixx commented Jan 7, 2018

I would rather prefer to fix this in Qt. And it's definitely possible since we already have some parts of the application rendered properly. I'll try to find some time to figure out why the wrong font gets selected.

@bosbyj
Copy link

bosbyj commented Jan 7, 2018 via email

@trollixx trollixx changed the title Add support for changing the font shows inside the app Wrong CJK font in the UI Jan 8, 2018
@trollixx
Copy link
Member

trollixx commented Jan 19, 2018

Found this SO thread, that basically says that using SimSun is the correct behavior.

Also, can anyone try setting locale? Just add the following line in the very beginning of main().

QLocale::setDefault(QLocale::C);

// or

QLocale::setDefault(QStringLiteral("en_US"));

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

No branches or pull requests

3 participants