spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Is there any way to change the font for the entire application? #5942

Closed liuxsdev closed 1 year ago

liuxsdev commented 6 years ago

Is there any way to change this font

22

the font in right is "Simsun" ,so uglily

宋体在这儿(和其他地方)太违和了,好丑,有办法改掉吗?

Versions and main components

ccordoba12 commented 6 years ago

That font is controlled by Windows, not by Spyder. Does other applications in your system look the same?

liuxsdev commented 6 years ago

Thank you! Finally I found a way to change the windows default font. It looks much better now. In my computer the Mendeley has the same question and for 7 years ,it has't improved it. I hope Spyder can make font looks better in Windows(Chinese edition), for the fact that the "Simsun" font has Highest priority 。

谢谢你!最终改了windows的默认字体,基本解决了这个问题。 我电脑上mendeley也是这样的问题,原因可能是软件没有对字体进行设置(我也学过 一点点QT,控件自定义字体不是很难吧),宋体在系统中优先级很高,但其英文字体效果太差。 还是希望Spyder进行一些改进。

CAM-Gerlach commented 6 years ago

Glad you got it fixed!

@ccordoba12 Is there anything more than can be practically done on the Spyder side regarding this, or can this be closed?

loveritsu929 commented 4 years ago

Hi, sorry to bring this up. But I probably run into the same issue, and this seems to be the only one talking about this.

My spyder now show this serif font in the working directory, file title, pane title, pop-up window, and even code completion, see the screenshots: image image image image

I have tried to change the windows default font using noMeiryoUI https://github.com/Tatsu-syo/noMeiryoUI. However, these do not change, though they are supposed to follow the system setting.

I believe this issue appears after several updates I have done, includes updating win10 to version 2004 (English system with some Chinese fonts installed), updating conda, and updating spyder from 4.1.2 to 4.1.5. Rolling back spyder doesn't help. I just reinstall the lastest anaconda and spyder, the issue is still there.

What method do you use to change the default fault? @smilevent

This issue doesn't affect the function of spyder but it's pretty annoying. Could you take a look at this? @ccordoba12

Thank you

loveritsu929 commented 4 years ago

Sorry for bothering you guys, but I may find an explanation && solution for this.

  1. The windows fallback font for Chinese in win10 is set back to SimSun. Even worse, in win10 with Chinese installed as a second language, the default font for English in QT programs will be this SimSun.
  2. Qt will call two Windows APIs SystemParametersInfo and GetStockObject (older win32 API) to get system default font. So even though they are all supposed to use the default one, the widgets may have different fonts.
  3. For Chinese & Japanese communities, the default Chinese/Japanese serif font looks awful on high DPI monitors.
  4. Then I simply change the value of SimSun (宋体&新宋体) in regedit to any other desired fonts, e.g., consolas.ttf

Source:

  1. https://stackoverflow.com/questions/11011238/how-do-you-get-system-default-font-settings-in-qt
  2. https://shuhari.dev/blog/2018/10/qt-new-font (Chinese)
  3. https://zhuanlan.zhihu.com/p/120299074 (Chinese)
dalthviz commented 3 years ago

Thank you for the info @loveritsu929 , glad is working for you now :+1:

ccordoba12 commented 3 years ago

Thanks @loveritsu929 for bringing this one up to our attention again. We'll address it in our 4.2.2 version, to be released next February.

Firestar-Reimu commented 2 months ago

image

@loveritsu929 can you have a look at https://github.com/spyder-ide/spyder/issues/22445 , thanks!