adobe-fonts / source-han-serif

Source Han Serif | 思源宋体 | 思源宋體 | 思源宋體 香港 | 源ノ明朝 | 본명조
https://adobe.ly/SourceHanSerif
Other
8.12k stars 645 forks source link

Fontconfig cannot handle Super OTC's `Source Han Serif Regular` and `Source Han Serif Bold` #9

Closed trueroad closed 7 years ago

trueroad commented 7 years ago

I've noticed that fontconfig does not seem to be able to handle Super OTC's Source Han Serif Regular and Source Han Serif Bold.

$ fc-list "Source Han Serif"
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif:style=Regular
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif,Source Han Serif SemiBold,源ノ明朝 SemiBold:style=SemiBold,Regular
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif,Source Han Serif Light,源ノ明朝 Light:style=Light,Regular
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif,Source Han Serif ExtraLight,源ノ明朝 ExtraLight:style=ExtraLight,Regular
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif,Source Han Serif Heavy,源ノ明朝 Heavy:style=Heavy,Regular
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif:style=Bold
/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc: 源ノ明朝,Source Han Serif,Source Han Serif Medium,源ノ明朝 Medium:style=Medium,Regular

For Source Han Sans Super OTC, it is no problem.

$ fc-list "Source Han Sans"
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Bold,源ノ角ゴシック Bold:style=Bold,Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Light,源ノ角ゴシック Light:style=Light,Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Normal,源ノ角ゴシック Normal:style=Normal,Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Regular,源ノ角ゴシック Regular:style=Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Medium,源ノ角ゴシック Medium:style=Medium,Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans ExtraLight,源ノ角ゴシック ExtraLight:style=ExtraLight,Regular
/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc: 源ノ角ゴシック,Source Han Sans,Source Han Sans Heavy,源ノ角ゴシック Heavy:style=Heavy,Regular

If I understand correctly, the cause is that some names are inconsistent. The names of Regular and Bold do not contain its weight name, others contain its weight name.

For Source Han Sans Super OTC, the names seem to be consistent.

Here is the inconsistent names I found.

kenlunde commented 7 years ago

The main difference between Source Han Sans and Source Han Serif is that the Regular weights in the latter are style-linked to the Bold weights. I cannot see this being an issue with the Super OTC, but rather a fontconfig issue. It is highly likely that this is the first time that fontconfig has been asked to support such a font, so it is not a shock that this issue arose. Un–style-linking the fonts is a nonstarter.

Also, when Source Han Sans Version 2.000 is released, its Regular weights will also be style-linked to its Bold weights.

trueroad commented 7 years ago

Thank you for your description. I understood that the way to specify the font has been changed by style-link.

I've noticed that the fonts can be specified in the following way by fontconfig.

$ fc-match -v "Source Han Serif:style=Regular" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc"(w)
        index: 8(i)(w)
        postscriptname: "SourceHanSerif-Regular"(w)

$ fc-match -v "Source Han Serif:style=Bold" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSerif/SourceHanSerif.ttc"(w)
        index: 20(i)(w)
        postscriptname: "SourceHanSerif-Bold"(w)

$ fc-match -v "Source Han Sans:style=Regular" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc"(w)
        index: 12(i)(w)
        postscriptname: "SourceHanSans-Regular"(w)

$ fc-match -v "Source Han Sans:style=Bold" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc"(w)
        index: 24(i)(w)
        postscriptname: "SourceHanSans-Bold"(w)

I used a font name containing a weight name. Current Source Han Sans all weights can be specified by this way.

$ fc-match -v "Source Han Sans Regular" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc"(w)
        index: 12(i)(w)
        postscriptname: "SourceHanSans-Regular"(w)

$ fc-match -v "Source Han Sans Bold" | grep -e file -e index -e postscript
        file: "/home/trueroad/.local/share/fonts/SourceHanSans/SourceHanSans.ttc"(w)
        index: 24(i)(w)
        postscriptname: "SourceHanSans-Bold"(w)

But, Source Han Serif Regular and Bold cannot be specified by this way. So I wrote this issue.

$ fc-match -v "Source Han Serif Regular" | grep -e file -e index -e postscript
        file: "/usr/share/texmf-dist/fonts/truetype/public/ipaex/ipag.ttf"(w)
        index: 0(i)(w)
        postscriptname: "IPAGothic"(w)

$ fc-match -v "Source Han Serif Bold" | grep -e file -e index -e postscript
        file: "/usr/share/texmf-dist/fonts/truetype/public/ipaex/ipag.ttf"(w)
        index: 0(i)(w)
        postscriptname: "IPAGothic"(w)

Anyway, I will use the former way instead of latter way. Thank you.

kenlunde commented 7 years ago

Yes, when fonts are style-linked, it changes how they need to be specified in certain environments.