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

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

Open
wants to merge 1 commit into
base: feature
Choose a base branch
from

Conversation

0tkl
Copy link

@0tkl 0tkl commented Jun 4, 2024

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?

Copy link

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a Microsoft Windows user, I appreciate your analysis of the Windows font-related mechanics.

For me, the build generated from this PR works as expected on Windows 11 (build 26100). I reset the Aegisub config files and used the new build.

Preview

@0tkl
Copy link
Author

0tkl commented Jun 6, 2024

…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

@0tkl 0tkl changed the title Set system UI font as default in subtitle grid and audio karaoke Remove the default font of subtitle grid; use system UI font when config font is empty Jun 6, 2024
@3gf8jv4dv
Copy link

@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
Copy link
Author

0tkl commented Jun 6, 2024

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

gl_text->SetFont("Verdana", 12, true, false);

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
Copy link

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)

Japanese

Korean

Thai

@0tkl
Copy link
Author

0tkl commented Jul 3, 2024

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

#145.

…and making Verdana the “platform-specific” default

New PR will come after #145 is merged.

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.

2 participants