arch1t3cht / Aegisub

Cross-platform advanced subtitle editor, with new feature branches. Read the README on the feature branch.
http://www.aegisub.org
Other
695 stars 32 forks source link

Remove the default font of subtitle grid; use system UI font when config font is empty #139

Open 0tkl opened 1 month ago

0tkl commented 1 month ago

One of the first batch of things that any new Chinese user of Aegisub does after installing the software is to change the font of the subtitle grid. The default typeface, Tahoma, will fallback to SimSun (宋体) / MingLiU (新細明體) under Chinese locales, which looks quite bizarre.

image

According to Microsoft's documentation, this is a composite font defined in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink. The value in it seems to be some ancient settings date back to Windows 2000.

image

I strongly recommend using different default fonts for each platform. Considering that the current Windows version requirement is Windows 7, using the Segoe UI should result in a good fallback sequence across locales. For example, on Windows 10/11 it could fallback to Microsoft YaHei UI, the default system UI font on zh-cn locale.

image

In addition, the default font size is too small for Chinese. This PR has increased the default font size from 8pt to 10pt.


I have no mac to test so I'm not sure if SF Pro is variable, and whether it can be displayed in proper font weight in Aegisub. Looking for feedbacks from mac users.


As on Linux, I'm quite unsure. KDE users will have Noto installed (I use KDE only), but what about GNOME or XFCE or any other desktop environments? Or, can we use the generic font name "Sans" on wxGTK?

0tkl commented 1 month ago

…I got a better idea. We can just read the system UI font face name from wxNORMAL_FONT when the config font name is blank. Now in Chinese (China) locale, it would be displayed in the precise UI font (Microsoft YaHei UI in the screenshot) rather than the composite Segoe UI font.

image

If any user wanna switch from custom font to system UI font, they can just remove the font name in the text ctrl. The placeholder text added in this PR will prompt the user that this entry have fallbacked to the system font, plus to what font.

While any typical Europe-language-locale Windows would display the placeholder in “Segoe UI”, I encourge Chinese (Taiwan), Japanese, Korean and Thai users to check if your placeholder is “Microsoft JhengHei UI”, “Yu Gothic UI”, “Malgun Gothic” and “Leelawadee UI”, respectively.

image

3gf8jv4dv commented 1 month ago

@0tkl

Great idea! I guess I will do some testing on Windows later.

By the way, GHA builds triggered by new commits seem to fail...

0tkl commented 1 month ago

Btw, there's still two “Verdana” left, one is the font of Audio/karaoke, another is hard-coded in:

https://github.com/arch1t3cht/Aegisub/blob/80491bacbfe2b684d1b2be0e031c72e27e39f85b/src/visual_tool_cross.cpp#L83

Both of them are only used to display numbers and punctuations so Verdana should be fine across different locales in Windows/macOS. But I'll probably open another PR, turning the hard-coded font face into a user option, and making Verdana the “platform-specific” default rather than generic default.

3gf8jv4dv commented 1 month ago

I tried compiling a binary myself based on your new commit. I tested it on Windows 10, version 22H2. The results were as you predicted.

Preview _Chinese (Taiwan)_ ![](https://github.com/arch1t3cht/Aegisub/assets/158490944/a70fb84e-92c7-4cc8-af61-b5801cf33f83) _Japanese_ ![](https://github.com/arch1t3cht/Aegisub/assets/158490944/ff2c7c77-1ad2-4868-b29d-b7df80381944) _Korean_ ![](https://github.com/arch1t3cht/Aegisub/assets/158490944/3bf94bbd-7cca-40ad-888b-b50b599e63a9) _Thai_ ![](https://github.com/arch1t3cht/Aegisub/assets/158490944/c3bfa630-d538-4ff1-9693-4b5d75ab56b5)
0tkl commented 2 weeks ago

But I'll probably open another PR, turning the hard-coded font face into a user option…

https://github.com/arch1t3cht/Aegisub/pull/145.

…and making Verdana the “platform-specific” default

New PR will come after https://github.com/arch1t3cht/Aegisub/pull/145 is merged.