4.2.2 breaks font fallback on macOS #9985

Closed
opened 2026-02-21 20:29:48 -05:00 by deekerman · 6 comments
Owner

Originally created by @iichttt on GitHub (Mar 27, 2020).

Please provide the following information

qBittorrent version and Operating System

qBittorrent 4.2.2
macOS 10.15.4

What is the problem

In 4.2.2, font fallback no longer follows system rules. Kanji characters always fall back to PingFang first, whatever the system preferred language is. 4.2.1 doesn’t have this issue. And oddly, kana characters seem fine.

↓ This is 4.2.2
Screen Shot 2020-03-27 at 17 59 43

↓ This is 4.2.1
Screen Shot 2020-03-27 at 18 02 07

What is the expected behavior

When Japanese is the system preferred language, all CJK characters should fall back to Hiragino Sans first, then Hiragino Sans GB, then PingFang, a behavior hardcoded in CoreText.

Extra info (if any)

Though in 4.2.1 the issue mentioned above doesn’t occur, still font fallback is broken. It should follow CoreText rules as described above.

↓ The 2nd and 4th characters are visually larger than the 1st and 3rd ones.
Screen Shot 2020-03-27 at 18 04 50

Originally created by @iichttt on GitHub (Mar 27, 2020). **Please provide the following information** ### qBittorrent version and Operating System qBittorrent 4.2.2 macOS 10.15.4 ### What is the problem In 4.2.2, font fallback no longer follows system rules. Kanji characters always fall back to PingFang first, whatever the system preferred language is. 4.2.1 doesn’t have this issue. And oddly, kana characters seem fine. ↓ This is 4.2.2 <img width="349" alt="Screen Shot 2020-03-27 at 17 59 43" src="https://user-images.githubusercontent.com/12984268/77741214-e1253880-7057-11ea-8545-1b243e4cc6bd.png"> ↓ This is 4.2.1 <img width="346" alt="Screen Shot 2020-03-27 at 18 02 07" src="https://user-images.githubusercontent.com/12984268/77741987-14b49280-7059-11ea-92cf-3c2b2f91b963.png"> ### What is the expected behavior When Japanese is the system preferred language, all CJK characters should fall back to Hiragino Sans first, then Hiragino Sans GB, then PingFang, a behavior hardcoded in CoreText. ### Extra info (if any) Though in 4.2.1 the issue mentioned above doesn’t occur, still font fallback is broken. It should follow CoreText rules as described above. ↓ The 2nd and 4th characters are visually larger than the 1st and 3rd ones. <img width="58" alt="Screen Shot 2020-03-27 at 18 04 50" src="https://user-images.githubusercontent.com/12984268/77741262-f1d5ae80-7057-11ea-9db6-7eca1d4d1772.png">
deekerman 2026-02-21 20:29:48 -05:00
Author
Owner

@maboroshin commented on GitHub (Mar 27, 2020):

I didn't develop this software. But I'm creating a theme.

I don't have a Mac. In the theme, I can specify a font-family. Can you write the font-family as CSS? Please let me know if you can.

And, Are you using a 4K screen? Related issue : https://github.com/qbittorrent/qBittorrent/issues/12295

@maboroshin commented on GitHub (Mar 27, 2020): I didn't develop this software. But I'm creating a theme. I don't have a Mac. In the theme, I can specify a font-family. Can you write the font-family as CSS? Please let me know if you can. And, Are you using a 4K screen? Related issue : https://github.com/qbittorrent/qBittorrent/issues/12295
Author
Owner

@iichttt commented on GitHub (Mar 30, 2020):

In the theme, I can specify a font-family. Can you write the font-family as CSS? Please let me know if you can.

It’s recommended by Apple to always use the -apple-system alias, so a standard implementation for macOS would be: font-family: -apple-system, sans-serif;. But it probably won’t work in Qt’s style sheets, since -apple-system is specific to WebKit.

So to mimic -apple-system’s behavior, an acceptable implementation would be: font-family: ".SFNS-Regular", ".HiraKakuInterface-W3”, ".HiraginoSansGBInterface-W3", sans-serif;, as far as font weights are not considered.

Chinese (simplified and traditional) users may not prefer this flavor, so for them it should be: font-family: ".SFNS-Regular", "PingFang SC", sans-serif; and font-family: ".SFNS-Regular", "PingFang TC", sans-serif;, respectively. But I’m not sure whether a language-specific implementation like this can be achieved.

And, Are you using a 4K screen? Related issue : #12295

No, I’m using a 2K screen. The issue I mentioned is not related to HiDPI, AFAIK.

@iichttt commented on GitHub (Mar 30, 2020): > In the theme, I can specify a font-family. Can you write the font-family as CSS? Please let me know if you can. It’s recommended by Apple to always use the -apple-system alias, so a standard implementation for macOS would be: `font-family: -apple-system, sans-serif;`. But it probably won’t work in Qt’s style sheets, since -apple-system is specific to WebKit. So to mimic -apple-system’s behavior, an acceptable implementation would be: `font-family: ".SFNS-Regular", ".HiraKakuInterface-W3”, ".HiraginoSansGBInterface-W3", sans-serif;`, as far as font weights are not considered. Chinese (simplified and traditional) users may not prefer this flavor, so for them it should be: `font-family: ".SFNS-Regular", "PingFang SC", sans-serif;` and `font-family: ".SFNS-Regular", "PingFang TC", sans-serif;`, respectively. But I’m not sure whether a language-specific implementation like this can be achieved. > And, Are you using a 4K screen? Related issue : #12295 No, I’m using a 2K screen. The issue I mentioned is not related to HiDPI, AFAIK.
Author
Owner

@maboroshin commented on GitHub (Apr 2, 2020):

Thank you. This issue maybe related to: Improve Transfer list architecture. And 4.2.3 is released. You can also try it.

I created:

It is a theme in the options. The program's CSS is not "Modern". So, "-apple-system" may not work. Please try 2 themes (jp and sys).

@maboroshin commented on GitHub (Apr 2, 2020): Thank you. This issue maybe related to: [Improve Transfer list architecture](https://github.com/qbittorrent/qBittorrent/pull/11708). And 4.2.3 is released. You can also try it. I created: * [fontjp.qbtheme](https://github.com/maboroshin/qBittorrentDarktheme/blob/master/MacOSfont/fontjp.qbtheme) ([contains](https://github.com/maboroshin/qBittorrentDarktheme/blob/master/MacOSfont/stylesheetjp.qss)) * [fontsys.qbtheme](https://github.com/maboroshin/qBittorrentDarktheme/blob/master/MacOSfont/fontsys.qbtheme) ([contains](https://github.com/maboroshin/qBittorrentDarktheme/blob/master/MacOSfont/stylesheetsys.qss)) * [And for chinese in here](https://github.com/maboroshin/qBittorrentDarktheme/tree/master/MacOSfont) It is a theme in the options. The program's CSS is not "Modern". So, "-apple-system" may not work. Please try 2 themes (jp and sys).
Author
Owner

@iichttt commented on GitHub (May 2, 2020):

This issue maybe related to: Improve Transfer list architecture.

Actually the issue is not limited to the transfer list. All GUI elements are affected.
Can confirm that 4.2.3-4.2.5 didn’t fix the issue.
The theme files didn’t work either.
It’s quite odd that only kanjis are affected, so some mechanism similar to unicode-range must’ve been specified.

@iichttt commented on GitHub (May 2, 2020): > This issue maybe related to: Improve Transfer list architecture. Actually the issue is not limited to the transfer list. All GUI elements are affected. Can confirm that 4.2.3-4.2.5 didn’t fix the issue. The theme files didn’t work either. It’s quite odd that only kanjis are affected, so some mechanism similar to `unicode-range` must’ve been specified.
Author
Owner

@maboroshin commented on GitHub (May 2, 2020):

Thanks for the test. I can't support you any more.

@maboroshin commented on GitHub (May 2, 2020): Thanks for the test. I can't support you any more.
Author
Owner

@luzpaz commented on GitHub (Nov 18, 2023):

@cheeexq can you still reproduce on latest stable ?

@luzpaz commented on GitHub (Nov 18, 2023): @cheeexq can you still reproduce on latest stable ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#9985
No description provided.