ValveSoftware / portal2

Issues for the Linux port of Portal 2
145 stars 11 forks source link

Asian fonts (such as Chinese, Japanese) cannot be displayed #346

Closed Life4gal closed 3 years ago

Life4gal commented 3 years ago

Same as issue #200
Only Chinese and Japanese are tested, other Asian fonts should be the same.(Latin characters are displayed normally) OS: Linux 5.4.0-66-generic X86_64 KDE neon(20.04) Use the console to open steam or run with lutris, check the log is because of FontConfig problems, but can not find a solution (I have Google searched many times) portal2

By the way, I am vanilla KDE(reinstalled not long ago), NVIDIA 450.102.04 graphics driver.

Life4gal commented 3 years ago

life4gal@life4gal-desktop:~$ ll /etc/fonts/conf.d total 20 drwxr-xr-x 2 root root 4096 3月 9 17:38 ./ drwxr-xr-x 4 root root 4096 2月 11 17:50 ../ lrwxrwxrwx 1 root root 31 4月 6 2020 10-antialias.conf -> ../conf.avail/10-antialias.conf lrwxrwxrwx 1 root root 36 4月 6 2020 10-hinting-slight.conf -> ../conf.avail/10-hinting-slight.conf lrwxrwxrwx 1 root root 40 4月 6 2020 10-scale-bitmap-fonts.conf -> ../conf.avail/10-scale-bitmap-fonts.conf lrwxrwxrwx 1 root root 39 4月 6 2020 11-lcdfilter-default.conf -> ../conf.avail/11-lcdfilter-default.conf lrwxrwxrwx 1 root root 50 8月 17 2016 20-unhint-small-dejavu-lgc-sans.conf -> ../conf.avail/20-unhint-small-dejavu-lgc-sans.conf lrwxrwxrwx 1 root root 55 8月 17 2016 20-unhint-small-dejavu-lgc-sans-mono.conf -> ../conf.avail/20-unhint-small-dejavu-lgc-sans-mono.conf lrwxrwxrwx 1 root root 51 8月 17 2016 20-unhint-small-dejavu-lgc-serif.conf -> ../conf.avail/20-unhint-small-dejavu-lgc-serif.conf lrwxrwxrwx 1 root root 46 8月 17 2016 20-unhint-small-dejavu-sans.conf -> ../conf.avail/20-unhint-small-dejavu-sans.conf lrwxrwxrwx 1 root root 51 8月 17 2016 20-unhint-small-dejavu-sans-mono.conf -> ../conf.avail/20-unhint-small-dejavu-sans-mono.conf lrwxrwxrwx 1 root root 47 8月 17 2016 20-unhint-small-dejavu-serif.conf -> ../conf.avail/20-unhint-small-dejavu-serif.conf lrwxrwxrwx 1 root root 39 4月 6 2020 20-unhint-small-vera.conf -> ../conf.avail/20-unhint-small-vera.conf lrwxrwxrwx 1 root root 40 11月 2 2019 25-arphic-ukai-render.conf -> ../conf.avail/25-arphic-ukai-render.conf lrwxrwxrwx 1 root root 41 6月 28 2019 25-arphic-uming-render.conf -> ../conf.avail/25-arphic-uming-render.conf lrwxrwxrwx 1 root root 33 9月 28 04:07 30-cjk-aliases.conf -> ../conf.avail/30-cjk-aliases.conf lrwxrwxrwx 1 root root 36 4月 6 2020 30-metric-aliases.conf -> ../conf.avail/30-metric-aliases.conf lrwxrwxrwx 1 root root 41 11月 2 2019 35-arphic-ukai-aliases.conf -> ../conf.avail/35-arphic-ukai-aliases.conf lrwxrwxrwx 1 root root 42 6月 28 2019 35-arphic-uming-aliases.conf -> ../conf.avail/35-arphic-uming-aliases.conf lrwxrwxrwx 1 root root 30 4月 6 2020 40-nonlatin.conf -> ../conf.avail/40-nonlatin.conf lrwxrwxrwx 1 root root 33 11月 2 2019 41-arphic-ukai.conf -> ../conf.avail/41-arphic-ukai.conf lrwxrwxrwx 1 root root 34 6月 28 2019 41-arphic-uming.conf -> ../conf.avail/41-arphic-uming.conf lrwxrwxrwx 1 root root 29 4月 6 2020 45-generic.conf -> ../conf.avail/45-generic.conf lrwxrwxrwx 1 root root 45 11月 10 2019 45-Hack.conf -> /usr/share/fontconfig/conf.avail/45-Hack.conf lrwxrwxrwx 1 root root 27 4月 6 2020 45-latin.conf -> ../conf.avail/45-latin.conf lrwxrwxrwx 1 root root 31 4月 6 2020 49-sansserif.conf -> ../conf.avail/49-sansserif.conf lrwxrwxrwx 1 root root 26 4月 6 2020 50-user.conf -> ../conf.avail/50-user.conf lrwxrwxrwx 1 root root 27 4月 6 2020 51-local.conf -> ../conf.avail/51-local.conf lrwxrwxrwx 1 root root 42 9月 28 04:07 56-language-selector-ar.conf -> ../conf.avail/56-language-selector-ar.conf lrwxrwxrwx 1 root root 31 3月 3 19:57 56-neon-hack.conf -> ../conf.avail/56-neon-hack.conf lrwxrwxrwx 1 root root 31 3月 3 19:57 56-neon-noto.conf -> ../conf.avail/56-neon-noto.conf lrwxrwxrwx 1 root root 33 8月 17 2016 57-dejavu-sans.conf -> ../conf.avail/57-dejavu-sans.conf lrwxrwxrwx 1 root root 38 8月 17 2016 57-dejavu-sans-mono.conf -> ../conf.avail/57-dejavu-sans-mono.conf lrwxrwxrwx 1 root root 34 8月 17 2016 57-dejavu-serif.conf -> ../conf.avail/57-dejavu-serif.conf lrwxrwxrwx 1 root root 37 8月 17 2016 58-dejavu-lgc-sans.conf -> ../conf.avail/58-dejavu-lgc-sans.conf lrwxrwxrwx 1 root root 42 8月 17 2016 58-dejavu-lgc-sans-mono.conf -> ../conf.avail/58-dejavu-lgc-sans-mono.conf lrwxrwxrwx 1 root root 38 8月 17 2016 58-dejavu-lgc-serif.conf -> ../conf.avail/58-dejavu-lgc-serif.conf lrwxrwxrwx 1 root root 29 4月 6 2020 60-generic.conf -> ../conf.avail/60-generic.conf lrwxrwxrwx 1 root root 27 4月 6 2020 60-latin.conf -> ../conf.avail/60-latin.conf lrwxrwxrwx 1 root root 49 9月 2 2019 61-urw-bookman.conf -> /usr/share/fontconfig/conf.avail/urw-bookman.conf lrwxrwxrwx 1 root root 46 9月 2 2019 61-urw-c059.conf -> /usr/share/fontconfig/conf.avail/urw-c059.conf lrwxrwxrwx 1 root root 50 9月 2 2019 61-urw-d050000l.conf -> /usr/share/fontconfig/conf.avail/urw-d050000l.conf lrwxrwxrwx 1 root root 60 9月 2 2019 61-urw-fallback-backwards.conf -> /usr/share/fontconfig/conf.avail/urw-fallback-backwards.conf lrwxrwxrwx 1 root root 59 9月 2 2019 61-urw-fallback-generics.conf -> /usr/share/fontconfig/conf.avail/urw-fallback-generics.conf lrwxrwxrwx 1 root root 48 9月 2 2019 61-urw-gothic.conf -> /usr/share/fontconfig/conf.avail/urw-gothic.conf lrwxrwxrwx 1 root root 56 9月 2 2019 61-urw-nimbus-mono-ps.conf -> /usr/share/fontconfig/conf.avail/urw-nimbus-mono-ps.conf lrwxrwxrwx 1 root root 54 9月 2 2019 61-urw-nimbus-roman.conf -> /usr/share/fontconfig/conf.avail/urw-nimbus-roman.conf lrwxrwxrwx 1 root root 53 9月 2 2019 61-urw-nimbus-sans.conf -> /usr/share/fontconfig/conf.avail/urw-nimbus-sans.conf lrwxrwxrwx 1 root root 46 9月 2 2019 61-urw-p052.conf -> /usr/share/fontconfig/conf.avail/urw-p052.conf lrwxrwxrwx 1 root root 61 9月 2 2019 61-urw-standard-symbols-ps.conf -> /usr/share/fontconfig/conf.avail/urw-standard-symbols-ps.conf lrwxrwxrwx 1 root root 46 9月 2 2019 61-urw-z003.conf -> /usr/share/fontconfig/conf.avail/urw-z003.conf lrwxrwxrwx 1 root root 46 9月 28 04:07 64-language-selector-prefer.conf -> ../conf.avail/64-language-selector-prefer.conf lrwxrwxrwx 1 root root 41 2月 16 2017 65-droid-sans-fallback.conf -> ../conf.avail/65-droid-sans-fallback.conf lrwxrwxrwx 1 root root 39 11月 2 2019 65-fonts-arphic-ukai.conf -> ../conf.avail/65-fonts-arphic-ukai.conf lrwxrwxrwx 1 root root 40 6月 28 2019 65-fonts-arphic-uming.conf -> ../conf.avail/65-fonts-arphic-uming.conf lrwxrwxrwx 1 root root 35 4月 6 2020 65-fonts-persian.conf -> ../conf.avail/65-fonts-persian.conf lrwxrwxrwx 1 root root 30 4月 6 2020 65-nonlatin.conf -> ../conf.avail/65-nonlatin.conf lrwxrwxrwx 1 root root 42 9月 28 04:07 69-language-selector-ja.conf -> ../conf.avail/69-language-selector-ja.conf lrwxrwxrwx 1 root root 45 9月 28 04:07 69-language-selector-zh-cn.conf -> ../conf.avail/69-language-selector-zh-cn.conf lrwxrwxrwx 1 root root 45 9月 28 04:07 69-language-selector-zh-hk.conf -> ../conf.avail/69-language-selector-zh-hk.conf lrwxrwxrwx 1 root root 45 9月 28 04:07 69-language-selector-zh-mo.conf -> ../conf.avail/69-language-selector-zh-mo.conf lrwxrwxrwx 1 root root 45 9月 28 04:07 69-language-selector-zh-sg.conf -> ../conf.avail/69-language-selector-zh-sg.conf lrwxrwxrwx 1 root root 45 9月 28 04:07 69-language-selector-zh-tw.conf -> ../conf.avail/69-language-selector-zh-tw.conf lrwxrwxrwx 1 root root 29 4月 6 2020 69-unifont.conf -> ../conf.avail/69-unifont.conf lrwxrwxrwx 1 root root 55 11月 7 2019 70-fonts-noto-cjk.conf -> /usr/share/fontconfig/conf.avail/70-fonts-noto-cjk.conf lrwxrwxrwx 1 root root 32 4月 6 2020 70-no-bitmaps.conf -> ../conf.avail/70-no-bitmaps.conf lrwxrwxrwx 1 root root 40 11月 2 2019 75-arphic-ukai-select.conf -> ../conf.avail/75-arphic-ukai-select.conf lrwxrwxrwx 1 root root 31 4月 6 2020 80-delicious.conf -> ../conf.avail/80-delicious.conf lrwxrwxrwx 1 root root 42 11月 2 2019 90-arphic-ukai-embolden.conf -> ../conf.avail/90-arphic-ukai-embolden.conf lrwxrwxrwx 1 root root 43 6月 28 2019 90-arphic-uming-embolden.conf -> ../conf.avail/90-arphic-uming-embolden.conf lrwxrwxrwx 1 root root 31 4月 6 2020 90-synthetic.conf -> ../conf.avail/90-synthetic.conf lrwxrwxrwx 1 root root 42 9月 28 04:07 99-language-selector-zh.conf -> ../conf.avail/99-language-selector-zh.conf -rw-r--r-- 1 root root 978 4月 6 2020 README

Life4gal commented 3 years ago

https://github.com/ValveSoftware/portal2/issues/134#issuecomment-314821964 not work for me :(

Life4gal commented 3 years ago

cd .local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu ll | grep font lrwxrwxrwx 1 life4gal life4gal 22 4月 3 2019 libfontconfig.so.1 -> libfontconfig.so.1.4.4 -rw-r--r-- 1 life4gal life4gal 211660 4月 3 2019 libfontconfig.so.1.4.4 mv libfontconfig.so.1 libfontconfig.so.1.bak ln -s /usr/lib/i386-linux-gnu/libfontconfig.so.1 $(pwd)/libfontconfig.so.1 ll | grep font lrwxrwxrwx 1 life4gal life4gal 22 4月 3 2019 libfontconfig.so.1.bak -> libfontconfig.so.1.4.4 -rw-r--r-- 1 life4gal life4gal 211660 4月 3 2019 libfontconfig.so.1.4.4 lrwxrwxrwx 1 life4gal life4gal 42 3月 9 20:28 libfontconfig.so.1 -> /usr/lib/i386-linux-gnu/libfontconfig.so.1

not work for me

Life4gal commented 3 years ago

sudo install fonts-wqy-microhei kwrite ~/.config/fontconfig/portal2.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="pattern">
    <test name="family" qual="any">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>WenQuanYi Micro Hei</string>
      <string>Noto Sans CJK TC</string>
      <string>Noto Sans CJK JP</string>
      <string>Noto Sans CJK KR</string>
      <string>Noto Sans</string>
      <string>Noto Color Emoji</string>
      <string>sans-serif</string>
    </edit>
  </match>
  <dir>/usr/share/fonts</dir>
</fontconfig>

right click game -> properties -> general -> lauch option add a line below

FONTCONFIG_FILE=~/.config/fontconfig/portal2.conf %command%

This won't work if you don't set the lauch option

misyltoad commented 3 years ago

Fwiw I have this issue locally, and I'd like to devise a better solution than this across the rest of the Source titles as other apps use fallback fonts fine.

Could this be re-opened? Thanks!

kisak-valve commented 3 years ago

Hello @Joshua-Ashton, this long standing issue has been fragmented over several issue reports, and https://github.com/ValveSoftware/Source-1-Games/issues/153 is probably the best place to continue tracking this for Source 1 in general. We have #200 to track the Portal 2 specific variant of the engine as well.

misyltoad commented 3 years ago

Makes sense.