source-foundry / Hack

A typeface designed for source code
http://sourcefoundry.org/hack/
Other
16.33k stars 608 forks source link

Fix incorrect fontconfig. #535

Closed xuzhao9 closed 3 years ago

xuzhao9 commented 3 years ago

The current config/fontconfig is incorrect. Fontconfig deletes the first matched font family. Therefore, it actually unsets the "Hack" family instead of the "sans-serif" family.

Evidence: on my machine, after applying the upsteam 45-Hack.conf, "fc-match -s Hack" returns:

NotoSans-Regular.ttf: "Noto Sans" "Regular"
NotoSansJP-Regular.otf: "Noto Sans JP" "Regular"
NotoSansSC-Regular.otf: "Noto Sans SC" "Regular"
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"
Cantarell-Regular.otf: "Cantarell" "Regular"
n019003l.pfb: "Nimbus Sans L" "Regular"
luxisr.ttf: "Luxi Sans" "Regular"
wqy-microhei.ttc: "WenQuanYi Micro Hei" "Regular"

It doesn't even return Hack match, because it is deleted.

After applying the 45-Hack.conf in this PR, "fc-match -s Hack" returns:

Hack-Regular.ttf: "Hack" "Regular"
Hack-Bold.ttf: "Hack" "Bold"
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
DroidSansMono.ttf: "Droid Sans Mono" "Regular"

It returns both Hack and other monospace fonts, which is the correct behavior.

fjfnaranjo commented 3 years ago

I can confirm this behavior following installing instructions in a almost clean (installed xorg, a display manager..) Debian 10 installation.

I can also confirm that applying this patch the problem is fixed.

chrissimpkins commented 3 years ago

Tyvm! I really appreciate the update.