Bug Hunting Session
Bug 114768 - Preferred font order for Chinese locales
Summary: Preferred font order for Chinese locales
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks: CJK-Chinese-Traditional CJK-Chinese-Simplified Fonts-Locale
  Show dependency treegraph
 
Reported: 2017-12-30 10:25 UTC by Yousuf Philips (jay) (retired)
Modified: 2018-02-23 12:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Suggest fix for Simplified Chinese (1.82 KB, text/plain)
2018-02-10 01:53 UTC, Kevin Suo
Details
Chinese System Font in Latest OS (108.60 KB, image/png)
2018-02-13 16:36 UTC, Yousuf Philips (jay) (retired)
Details
PDF file showing Simplified Chinese fonts - compare (124.08 KB, application/pdf)
2018-02-14 00:15 UTC, Kevin Suo
Details
nsimsun vs simsun (58.35 KB, image/png)
2018-02-14 13:23 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2017-12-30 10:25:59 UTC
Similar to bug 114751, we need to improve the default fonts used in VCL.xcu for both simplified chinese[1] (zh-cn) and traditional chinese[2] (zh-tw), as well as the fallback UI-SANS[3].

[1] https://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/VCL.xcu#247

[2] https://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/VCL.xcu#276

[3] https://opengrok.libreoffice.org/xref/core/unotools/source/config/fontcfg.cxx#252
Comment 1 Yousuf Philips (jay) (retired) 2017-12-30 11:01:15 UTC
The first fix for traditional chinese would be to add Noto CJK TC to the list, as the current first entry is Source Han which isnt distributed on debian-based distros.

https://gerrit.libreoffice.org/47191
Comment 2 Cheng-Chia Tseng 2017-12-30 11:22:04 UTC
You should make users see the fonts in their localized names, so it should be always picking 思源黑體 or 思源宋體 (Source Han Sans and Source Han Serif) first when both of them available on the system.

No matter what you ship in the system, LireOffice will match the font list one by one. The BIG problem is that Chinese users generally neglect fonts in English names such as Noto Sans CJK TC and see those as English fonts. 

Thus, there is no reason to pick Noto Sans CJK TC or Noto Serif CJK first before 思源黑體 and 思源宋體. The list should honor the fonts in users' locale first.
Comment 3 V字龍(Vdragon) 2017-12-30 12:29:18 UTC
I agree with Cheng-Chia that Noto CJK fonts should be put after Source Han fonts due to UX reasons (Noto CJK fonts doesn't have a Chinese localized name).
Comment 4 Cheng-Chia Tseng 2017-12-31 10:09:43 UTC
For your information. 

Traditional Chinese system includes zh-tw, zh-hk and zh-mo locales, while most of the time it refers to zh-tw.

Simplified Chinese system includes zh-cn and zh-sg locales, while most of the time it refers to zh-cn.

If it is going to change, those locales should be considered together as well.

In the patch set of the gerrit issue 47191 from Mark Hung, the traditional Chinese part (zh-tw, zh-hk and zh-mo) is all changed together as well to meet the users needs.
Comment 5 Yousuf Philips (jay) (retired) 2017-12-31 13:43:05 UTC
Fix should also be made to the coded fallback ui_sans fonts for chinese, if necessary.

https://opengrok.libreoffice.org/xref/core/unotools/source/config/fontcfg.cxx#252
Comment 6 Commit Notification 2018-01-09 12:20:46 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=847d20b3466a6358396c923e9b4754cbdd53863a

tdf#114768: Update default font list for Traditional Chinese

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Xisco Faulí 2018-02-09 10:46:53 UTC
A polite ping to Yousuf Philips: is this bug fixed? if so, could you
please close it as RESOLVED FIXED ? Thanks
Comment 8 Yousuf Philips (jay) (retired) 2018-02-09 16:11:37 UTC
@Kevin: are there any order preferences for simplified chinese that you would like made other than adding Source Han and Noto CJK?
Comment 9 Yousuf Philips (jay) (retired) 2018-02-09 20:28:44 UTC
work in progress patch for simplified, awaiting feedback

https://gerrit.libreoffice.org/49520
Comment 10 Kevin Suo 2018-02-10 00:05:05 UTC
(In reply to Yousuf Philips (jay) from comment #8)
Yes, I do have some ideas. Will provide soon.
Comment 11 Kevin Suo 2018-02-10 01:53:08 UTC
Created attachment 139747 [details]
Suggest fix for Simplified Chinese

See attachment. It is simple, and it should work.

In Linux, we have "思源黑体 [Source Han Sans CN]" which is sans like, and "思源宋体 [Source Han Serif CN]" which is actually serif like. In some linux distributions they may have "Noto Sans CJK SC" and "Noto Serif CJK SC".

In Windows, they have "微软雅黑 [Microsoft Yahei]" shipped by default by Microsoft Windows which is actually sans. They also have "宋体 [SimSun]" which is actually serif. These are all commonly used.

Chinese "Sans" like fonts are good for headings, and for spreadsheets as well as for presentations. Chinese "Serif" like fonts are good for Text. Many Chinese people also widely use "仿宋" fonts for text, esp for printing. But as we are doing the "Default fonts", we only include one which we are sure the system has. It's up to the user to use other fonts if needed.

In Mac OX X, they have 华文细黑 and 华文宋体.
Comment 12 Yousuf Philips (jay) (retired) 2018-02-13 16:36:09 UTC
Created attachment 139870 [details]
Chinese System Font in Latest OS

Found this image quite useful as a reference to what should be used.

source: https://medium.com/@bobtung/best-practice-in-chinese-layout-f933aff1728f
Comment 13 Yousuf Philips (jay) (retired) 2018-02-13 17:26:41 UTC
(In reply to Kevin Suo from comment #11)
> Created attachment 139747 [details]
> Suggest fix for Simplified Chinese

Was this a modification of my patch in comment 9 or something you created from scratch?

> In Windows, they have "微软雅黑 [Microsoft Yahei]" shipped by default by
> Microsoft Windows which is actually sans. They also have "宋体 [SimSun]" which
> is actually serif. These are all commonly used.

From what i've seen, 新宋体 [NSimSun] (monospaced) seems to be more prevalent than 宋体 [SimSun] (proportional), so you sure you want to go with SimSun?

> In Mac OX X, they have 华文细黑 and 华文宋体.

Traditional Chinese went with PingFang TC as the default sans, so it might be good to have PingFang SC as the default sans for OSX 10.11+ users, with a fallback on 华文细黑 [STXihei]. What do you think?

About 华文宋体 [Songti SC], the chart in attachment 139870 [details] has 3 characters for the localized version of the name, similar to 宋體-繁, the 3 characters for Songti TC, which we are using for traditional chinese.
Comment 14 Kevin Suo 2018-02-14 00:14:08 UTC
(In reply to Yousuf Philips (jay) from comment #13)

> Was this a modification of my patch in comment 9 or something you created from scratch?

From scratch.

> From what i've seen, 新宋体 [NSimSun] (monospaced) seems to be more prevalent than 宋体 [SimSun] (proportional), so you sure you want to go with SimSun?

You can put 新宋体 [NSimSun], both Chinese and english names, before SimSun. They are quite the same fonts (see attachment pdf) shipped with different MS versions, but any version of MS has SimSum installed.

> Traditional Chinese went with PingFang TC as the default sans, so it might be good to have PingFang SC as the default sans for OSX 10.11+ users, with a fallback on 华文细黑 [STXihei]. What do you think?

I agree with the Traditioinal team. Pingfang is a new font added in the new Mac OS. So, please use 萍方-简 [PingFang SC] 

> About 华文宋体 [Songti SC], the chart in attachment 139870 [details] has 3 characters for the localized version of the name, similar to 宋體-繁, the 3 characters for Songti TC, which we are using for traditional chinese.

I my understanding, 宋体-简 is just an aliens of 华文宋体. I do not have MAC OS installed, so I have no more comment on this. So, it may be safe to use 萍方-简 [PingFang SC]  and fall back to 宋体-简 [Songti SC]
Comment 15 Kevin Suo 2018-02-14 00:15:49 UTC
Created attachment 139880 [details]
PDF file showing Simplified Chinese fonts - compare

As you can see, NSimSun is no difference with SimSun.
Comment 16 Kevin Suo 2018-02-14 00:20:39 UTC
By the way, the screenshot named " Chinese System Font in Latest OS " is misleading. Althrough the meanings may be correct, the exact font names in this screenshot are wrong simplified Chinese, thus it's not safe to use these names in the code.
Comment 17 Yousuf Philips (jay) (retired) 2018-02-14 13:23:20 UTC
Created attachment 139907 [details]
nsimsun vs simsun

(In reply to Kevin Suo from comment #15)
> Created attachment 139880 [details]
> PDF file showing Simplified Chinese fonts - compare
> 
> As you can see, NSimSun is no difference with SimSun.

According the microsoft, there is a slight difference between the two. SimSun is slightly thinner and if you see the 5th character in the second line is wider in NSimSun than SimSun.

https://www.microsoft.com/typography/fonts/font.aspx?FMID=2166

https://www.microsoft.com/typography/fonts/font.aspx?FMID=2165
Comment 18 Kevin Suo 2018-02-14 14:14:01 UTC
(In reply to Yousuf Philips (jay) from comment #17)
That's fine. Anyway, NSimSin is newer, so please goahead to make NSimSun before SimSum. SimSun should be the last fallback, as not all systems have NSimSun.
Comment 19 Yousuf Philips (jay) (retired) 2018-02-14 14:58:46 UTC
(In reply to Kevin Suo from comment #16)
> By the way, the screenshot named " Chinese System Font in Latest OS " is
> misleading. Althrough the meanings may be correct, the exact font names in
> this screenshot are wrong simplified Chinese, thus it's not safe to use
> these names in the code.

So i'll use 华文宋体 for Songti SC, but what should i use for PingFang SC?

I'm finished with all the changes i think are needed, so please review it and give me your thoughts.

https://gerrit.libreoffice.org/49520
Comment 20 Kevin Suo 2018-02-20 08:43:18 UTC
(In reply to Yousuf Philips (jay) (retired) from comment #19)

I have made comments on gerrit. I can not modify your commit draft, so you need to do it by yourself.
Comment 21 Yousuf Philips (jay) (retired) 2018-02-20 15:09:56 UTC
(In reply to Kevin Suo from comment #20)
> I have made comments on gerrit. I can not modify your commit draft, so you
> need to do it by yourself.

Took your suggestions into consideration, but there were a number of bugs in it.
Comment 22 Commit Notification 2018-02-23 12:52:37 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=16700331da2087bbb53c1774605cef2d0411206a

tdf#114768: Update default font list for Simplified Chinese

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.