be5invis / Sarasa-Gothic

Sarasa Gothic / 更纱黑体 / 更紗黑體 / 更紗ゴシック / 사라사 고딕
SIL Open Font License 1.1
10.12k stars 368 forks source link

Term/Fixed fonts cannot be recoginzed as monospace font by fontconfig #230

Closed gnaggnoyil closed 3 years ago

gnaggnoyil commented 3 years ago

Steps to reproduce

Run command fc-list :mono | grep --ignore-case 'sarasa'

Environment

Archlinux 20210216, with package ttf-sarasa-gothic from official Arch repository installed:

gnaggnoyil@gnaggnoyil-pc ~ % pacman -Ss | grep -E '(/fontconfig )|(/ttf-sarasa-gothic )'
extra/fontconfig 2:2.13.91+48+gfcb0420-2 [installed]
community/ttf-sarasa-gothic 0.18.1-1 [installed]

Additional Info

The spacing of those sarasa monospace fonts seems to be a bit weird:

gnaggnoyil@gnaggnoyil-pc ~ % fc-query -f "%{family=} %{spacing=}\n" /usr/share/fonts/sarasa-gothic/sarasa-regular.ttc | grep spacing
family=Sarasa Term CL spacing=90
family=Sarasa Term SC spacing=90
family=Sarasa Term TC spacing=90
family=Sarasa Term HC spacing=90
family=Sarasa Term J spacing=90
family=Sarasa Term K spacing=90
family=Sarasa Term Slab CL spacing=90
family=Sarasa Term Slab SC spacing=90
family=Sarasa Term Slab TC spacing=90
family=Sarasa Term Slab HC spacing=90
family=Sarasa Term Slab J spacing=90
family=Sarasa Term Slab K spacing=90
family=Sarasa Fixed CL spacing=90
family=Sarasa Fixed SC spacing=90
family=Sarasa Fixed TC spacing=90
family=Sarasa Fixed HC spacing=90
family=Sarasa Fixed J spacing=90
family=Sarasa Fixed K spacing=90
family=Sarasa Fixed Slab CL spacing=90
family=Sarasa Fixed Slab SC spacing=90
family=Sarasa Fixed Slab TC spacing=90
family=Sarasa Fixed Slab HC spacing=90
family=Sarasa Fixed Slab J spacing=90
family=Sarasa Fixed Slab K spacing=90

For comparison, below are how Source Code Pro Medium and DejaVu Sans Mono behaves on my environment:

gnaggnoyil@gnaggnoyil-pc ~ % fc-list :mono | grep -E '(SourceCodePro-Medium.otf)|(DejaVuSansMono.ttf)'
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Medium.otf: Source Code Pro,Source Code Pro Medium:style=Medium,Regular
/usr/share/fonts/TTF/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
gnaggnoyil@gnaggnoyil-pc ~ % fc-query -f "%{family=} %{spacing=}\n" /usr/share/fonts/adobe-source-code-pro/SourceCodePro-Medium.otf /usr/share/fonts/TTF/DejaVuSansMono.ttf
family=Source Code Pro,Source Code Pro Medium spacing=100
family=DejaVu Sans Mono spacing=100

Both have their spacing set to 100.

be5invis commented 3 years ago

Sarasa has CJK so it is impossible to make fontconfig think it is monospace. Perhaps I should remove the "Fixed" families.

gnaggnoyil commented 3 years ago

That's... interesting. So that basically means a CJK font cannot be marked as monospace, even if it has been widely recognized, and indeed has been accepted by Windows conhost? I didn't expect fontconfig has such strict requirements regarding monospace. That's... quite impressive I had to say.