libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.3k stars 1.84k forks source link

CN characters are not displayed properly in RetroArch #12215

Closed ws02589111 closed 3 years ago

ws02589111 commented 3 years ago

Description

CN characters are not displayed properly in RetroArch, I have tried replace to yahei and other cn supported fonts, but it doesn't work, in 1.9.0 the issue is not existed

Expected behavior

The font display properly,not show square

Steps to reproduce the bug

1.Default is English in retroarch, set it to cn, now you can see it display properly, image but after you save the config and reboot, you can see the below: image

  1. Then , set it back to en, you can get the below: image

Bisect Results

Commit: 7450f049e72dd3388dfed2439c1af73e088e4fd9

Version/Commit

1.Now I use the commit: 01944dd80ea79fefb335f8f2c437fc1c106482cf ,the issues is existed。 2.The commit before 7450f049e72dd3388dfed2439c1af73e088e4fd9 is fine

Environment information

insmagic commented 3 years ago

朋友找到解决办法了吗

ws02589111 commented 3 years ago

朋友找到解决办法了吗

Sorry, no idea now, but the commit 4e8a71d034c22a831ed3fd17c4d84e5ab9973c74 may give you some hint, the fix just only for gdi(It’s just my guess, I don’t have time to test recently), we may need similar fix for gl driver

insmagic commented 3 years ago

In my test,if replace the font.ttf but not change language to chinese,then restart retroarch,everything is OK,the new font displayed properly.If change language to chinese,it seems can not find the font.ttf after restart.I considered that when restart the retroarch,it using another font.ttf not the saved in config,but the font in English is properly,so you are right,the problem may be iocharset.

gouchi commented 3 years ago

Hi,

Do you reproduce the issue if you update the assets ?

First set your system language to English. Then restart RetroArch, go to Online Updater -> Download Assets. After download finished, you can change your system language back to Chinese. Finally, restart RetroArch.

Source

ws02589111 commented 3 years ago

Hi,

Do you reproduce the issue if you update the assets ?

First set your system language to English. Then restart RetroArch, go to Online Updater -> Download Assets. After download finished, you can change your system language back to Chinese. Finally, restart RetroArch.

Source

Yes, I updated the assets before test

gouchi commented 3 years ago

Is it possible to get the output of retroarch -v ?

Thank you.

ws02589111 commented 3 years ago

Is it possible to get the output of retroarch -v ?

Thank you.

[INFO] RetroArch 1.9.1 (Git cf6ca2a47f) [INFO] === Build ======================================= [INFO] 容量: ASIMD [INFO] Built: Apr 8 2021 [INFO] Version: 1.9.1 [INFO] Git: cf6ca2a47f

[INFO] RetroArch 1.9.1 (Git d2af1e905c) [INFO] === Build ======================================= [INFO] 容量: ASIMD [INFO] Built: Apr 25 2021 [INFO] Version: 1.9.1 [INFO] Git: d2af1e905c

the issue only reproduce in xmb, and the latest RetroArch have not tested

gouchi commented 3 years ago

Thank you but is it possible to get full output ?

It should be interesting to make some test with latest RetroArch if possible.

ws02589111 commented 3 years ago

Is the following output sufficient?

retroarch -v
[INFO] RetroArch 1.9.1 (Git d2af1e905c)
[INFO] === Build =======================================
[INFO] 容量:  ASIMD
[INFO] Built: Apr 25 2021
[INFO] Version: 1.9.1
[INFO] Git: d2af1e905c
[INFO] =================================================
[INFO] [Input]: Found input driver: "udev".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] Cannot resolve save file path.
[INFO] libretro API 版本: 1
[INFO] 未按照 API 编译: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Video]: Starting threaded video driver ...
[INFO] [EGL] Falling back to eglGetDisplay
[INFO] [EGL]: EGL version: 1.4
[INFO] [GL]: Found GL context: fbdev_mali
[INFO] [GL]: Detecting screen resolution 0x0.
[INFO] [EGL]: Current context: 0x40000001.
[INFO] [GL]: Vendor: ARM, Renderer: Mali-450 MP.
[INFO] [GL]: Version: OpenGL ES 2.0.
[INFO] [GL]: Using resolution 1920x1080
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] Setting up menu pipeline shaders for XMB ... 
[INFO] [GLSL]: Compiling ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling simple ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling modern snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling bokeh shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snowflake shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Graphics driver did not initialize an input driver. Attempting to pick a suitable driver.
[WARN] [udev]: Full-screen pointer won't be available.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Video]: Found display server: null
[WARN] [udev]: Mouse grab/ungrab feature unavailable.
[INFO] ALSA: Using signed 16-bit format.
[INFO] ALSA: Period size: 512 frames
[INFO] ALSA: Buffer size: 1536 frames
wifi is already enabled
[INFO] [Display]: Found display driver: "gl".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [SRAM]: 游戏存档不会被保存。
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_music_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_video_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_image_history.lpl].
[INFO] [Playlist]: 正在加载收藏文件: [/storage/.config/retroarch/content_favorites.lpl].

This is my other version

retroarch -v
[INFO] RetroArch 1.9.1 (Git cf6ca2a47f)
[INFO] === Build =======================================
[INFO] 容量:  ASIMD
[INFO] Built: Apr  8 2021
[INFO] Version: 1.9.1
[INFO] Git: cf6ca2a47f
[INFO] =================================================
[INFO] [Input]: Found input driver: "udev".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] Cannot resolve save file path.
[INFO] libretro API 版本: 1
[INFO] 未按照 API 编译: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Video]: Starting threaded video driver ...
[INFO] [EGL] Falling back to eglGetDisplay
[INFO] [EGL]: EGL version: 1.4
[INFO] [GL]: Found GL context: fbdev_mali
[INFO] [GL]: Detecting screen resolution 0x0.
[INFO] [EGL]: Current context: 0x40000001.
[INFO] [GL]: Vendor: ARM, Renderer: Mali-450 MP.
[INFO] [GL]: Version: OpenGL ES 2.0.
[INFO] [GL]: Using resolution 1920x1080
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] Setting up menu pipeline shaders for XMB ... 
[INFO] [GLSL]: Compiling ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling simple ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling modern snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling bokeh shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snowflake shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Graphics driver did not initialize an input driver. Attempting to pick a suitable driver.
[WARN] [udev]: Full-screen pointer won't be available.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Video]: Found display server: null
[WARN] [udev]: Mouse grab/ungrab feature unavailable.
[INFO] ALSA: Using signed 16-bit format.
[INFO] ALSA: Period size: 512 frames
[INFO] ALSA: Buffer size: 1536 frames
wifi is already enabled
[INFO] [Display]: Found display driver: "gl".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [SRAM]: 游戏存档不会被保存。
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_music_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_video_history.lpl].
[INFO] [Playlist]: 正在读取历史文件: [/storage/.config/retroarch/content_image_history.lpl].
[INFO] [Playlist]: 正在加载收藏文件: [/storage/.config/retroarch/content_favorites.lpl].
gouchi commented 3 years ago

Can you use latest stable RetroArch at least 1.9.5 as the log still indicates 1.9.1 version ?

Thank you.

P.S = Version 1.9.6 will be released soon also.

gouchi commented 3 years ago

I did bisect and the first bad commit is [8132303d4f9400e0a37051a4f7b43e26c6eb958e] (FontRenderer/FreeType) Use fontconfig to select fonts if available.

@liushuyu Do you have any idea what could cause the issue ? Chinese, Korean, Arabic and Persian languages are affected. When you restart RetroArch you got square instead of the correct display of the font.

liushuyu commented 3 years ago

I did bisect and the first bad commit is [8132303d4f9400e0a37051a4f7b43e26c6eb958e] (FontRenderer/FreeType) Use fontconfig to select fonts if available.

@liushuyu Do you have any idea what could cause the issue ? Chinese, Korean, Arabic and Persian languages are affected. When you restart RetroArch you got square instead of the correct display of the font.

What platform/operating system are you using? Also, if Linux, which distro are you using?

gouchi commented 3 years ago

@liushuyu I forgot to mention I reproduced it using Lakka for now on Generic platform where we don't use Xorg and rely on DRM/KMS.

liushuyu commented 3 years ago

@liushuyu I forgot to mention I reproduced it using Lakka for now on Generic platform where we don't use Xorg and rely on DRM/KMS.

I see. That commit in question basically boils down to "use system fonts". If there are no available Chinese/Korean/Japanese fonts installed on your system or not registered/configured with Fontconfig, it won't work. I suggest you install notosans-cjk fonts if you don't know which one to install.

liushuyu commented 3 years ago

@liushuyu I forgot to mention I reproduced it using Lakka for now on Generic platform where we don't use Xorg and rely on DRM/KMS.

Also, if making a Linux distribution and you think Noto Sans CJK / Source Sans CJK is too big, then you could consider pre-install "文泉驿微米黑" (WenQuanYi Micro Hei) or a variant of Droid Sans, which are much smaller but IIRC only contains Chinese Kanji.

gouchi commented 3 years ago

@liushuyu Thank you for the feeedback, we will continue to make some investigation.

@ws02589111 which Linux distribution are you using on which device ?

Thank you.

ws02589111 commented 3 years ago

@liushuyu Thank you for the feeedback, we will continue to make some investigation.

@ws02589111 which Linux distribution are you using on which device ?

Thank you.

uname -a

Linux 3.14.29 #1 SMP Sun Apr 25 11:53:27 UTC 2021 aarch64 GNU/Linux

cat /proc/version

Linux version 3.14.29 (gcc version 8.3.0 (GCC) ) #1 SMP Sun Apr 25 11:53:27 UTC 2021

cat /proc/cpuinfo

Processor : AArch64 Processor rev 4 (aarch64) processor : 0 processor : 1 processor : 2 processor : 3 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 CPU implementer : 0x41 CPU architecture: AArch64 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 Hardware : Amlogic Serial : 210cc20061e0e2af5d82aa9ab403c364 model name : Amlogic S905L rev c

yingw commented 3 years ago

Any update for this thread? And this issue has float to other dist such as EMUELEC and 351ELEC, I tested a lot version of them all failed with RA1.9.0+

https://github.com/EmuELEC/EmuELEC/issues/534#issuecomment-864435761

gouchi commented 3 years ago

@ws02589111 @yingw You can add fonts to this directory /storage/.kodi/media/Fonts and it will be used automatically.

You can take the font from /usr/share/retroarch-assets/pkg

mkdir -p /storage/.kodi/media/Fonts
cp /usr/share/retroarch-assets/pkg/*.ttf /storage/.kodi/media/Fonts
gouchi commented 3 years ago

@ws02589111 @yingw it should be fixed with this commit on EmuELEC.

If your tests are ok please close this issue.

Thank you.

ws02589111 commented 3 years ago

@ws02589111 @yingw it should be fixed with this commit on EmuELEC.

If your tests are ok please close this issue.

Thank you.

OK, thanks your solution, I will testing on this weekend

ssmax commented 3 years ago

in EMUELEC 4.2 , Retroarch version 1.9.4 , 32 bit (don't know why, haha) when it quit, it will set a hidden config line in retroarch.cfg: xmb_font = "" this config will lead to the problem. you should set it to your font path manually by ssh or samba. after you set it , you will resolve the problem. only when you select xmb menu_driver in Emulationsation, it will replace the menu_driver option before start retroarch.

gouchi commented 3 years ago

@ws02589111 Did you have some time to make some test with EmuELEC from nightly build or EmuELEC version > 4.2.

@ssmax Yes thank you for the workaround. But if you don't specify any font, RA will select one automatically using fontconfig.

ws02589111 commented 3 years ago

@ws02589111 Did you have some time to make some test with EmuELEC from nightly build or EmuELEC version > 4.2.

@ssmax Yes thank you for the workaround. But if you don't specify any font, RA will select one automatically using fontconfig.

Sorry I'm late. I have test the emuelec version > 4.2, the issue fixed. this is my test version: Emuelec, commit RetroArch, bd76388fc533c2b40fe20a3477fe411dcad220ba