ValveSoftware/Source-1-Games

Non-ASCII characters are not displayed in source games.

Opened this issue · 22 comments

@eisbehr posted at 2013-02-15T13:47:34Z:

Can confirm this at least for the € symbol.

Sysinfo:
https://gist.github.com/eisbehr/50759c44922ae4d959ae

Game language is English
OS language is German, keyboard locale as well.

@johndrinkwater posted at 2013-02-15T13:48:13Z:

Would you list your OS/game language + locale information please, maybe keyboard map too, in case thats useful.

@TdR91 posted at 2013-02-15T13:52:56Z:

OS: OpenSUSE 12.2 (x86_64)
Game language: English
Keyboard layout: Serbian(Latin)

https://gist.github.com/TdR91/bac2e542a1dc29734177

@johndrinkwater posted at 2013-02-15T14:17:49Z:

Just tried this, it works for me ‐ http://cloud-2.steampowered.com/ugc/902114506608587340/FFAA15BED83DF469AB2FEB424BC117808425C923/
Though I am a unicode nerd so I have a decent selection of fonts to provide codepoint coverage.
Going through my fonts, the useful ones for this are: AndroidEmoji, DejaVu, DroidSans

@TdR91 posted at 2013-02-15T15:58:29Z:

I think it is a font problem. The strange thing is that those characters are visible in Steam client chat and in GoldSrc games.

@Majkl578 posted at 2013-02-15T16:14:15Z:

Maybe duplicate/extension of #1507?

@TdR91 posted at 2013-02-15T16:25:12Z:

It is similar...
I also get in-game console output like:
m_face->glyph->bitmap.width is 0 for ch:32 TF2 Build
m_face->glyph->bitmap.width is 0 for ch:32 DejaVu Sans
...

Ok, the problem is not caused by absence of fonts. All fonts used by TF2 have those characters as you can see.
fonts

I've observed that steam itself (both client and in-game overlay) displays all characters correctly as expected, only CS:S (console, chat, voice notification etc.) doesn't.

@TdR91 as we discussed on IRC, its likely a font you have installed thats being picked up and used and it does not. Would you put the output of fc-list : family style file spacing into a gist please.

Is this the same issue as #129?

I think it is. Only difference is that in that case no characters are displayed because it is in cyrillic.

Hello,

I'm on archlinux x86_64, I had this issue too (tf2, hl2, hl2ep1 and maybe others).

I fixed it, thanks to comment in #129 (comment) with:

cd /etc/fonts/conf.d
sudo ln -s ../conf.avail/70-no-bitmaps.conf .
fc-cache

I'm not sure if fc-cache was necessary. Fonts used for non-standard characters are a little different, but readable.

before: http://steamcommunity.com/sharedfiles/filedetails/?id=149106164
after: http://steamcommunity.com/sharedfiles/filedetails/?id=149114191

Hi

I have the same problem with all Valve games (other games show characters correctly). When I'm starting HL2 from Steam Client I've this problem but when I'm starting from game folder (script hl2.sh) everything is OK.

How can I repair this?

Hello,

@bigben93 noticed that Half Life 2 started from console will show all characters correctly, while hl2 started using steam client does not. With this information (and a lot of hl2 restarts) we were able to compare environmental variables from both cases and we've found that LD_LIBRARY_PATH variable made difference. Long story short, we've trace this problem to ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 library. Fonts are OK as long as we force hl2_linux to load libfontconfig from system. Simple chmod -r ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 fixed this issue in @bigben93's case.

I've attached diff from strace before and after disabling libfontconfig.so.1.4.4 (it's not whole diff, we've removed few things to make diff readable). What is interesting: libfontconfig bundled with steam tries to load /usr/share/fonts/75dpi/helvR12-ISO8859-1.pcf.gz, while libfontconfig from system is using /usr/share/fonts/ghostscript/n019003l.pfb.

"attached" diff: https://gist.github.com/hiciu/ea7a92c0157c08bfa82a

Hello,

I'm on Fedora 20 x86_64, I have this issue too (tf2, hl2, hl2ep1,hl2ep2, LFD2 and maybe others). But nothing help me.

please help

vfjpl commented

Any news?

Can someone provide me some games whose display name is written in non-ascii characters. I did not find anything on the web for now.

On Ubuntu 18.04, I got rid of invisible characters with:

  • Exit Steam
  • Install sudo apt install fonts-wqy-zenhei
  • Add East Asian characters sudo apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core (At a quick glance, I didn't notice any differences with text rendering)
  • Refresh the icon cache fc-cache -f -v (not sure if this step is necessary. But I ran it without testing the previous step alone. So it's in the instructions now)

Now, most text should be rendered properly.

It seems that Source 1 tries to find a font named "WenQuanYi Zen Hei" and use it if it's available and ignore other fonts (no falling back to other fonts). While that font is good and covers a wide range, but some ranges are still missing, such as Latin Extended Additional, which is used by Vietnamese. And the font is currently abandoned. The workaround I'm using is taking another font that have a wide range of characters, then rename it to "WenQuanYi Zen Hei".


To use the font that I have modified, download the below file (only use one font at a time), extract and copy the font into ~/.local/share/fonts/. Don't install them to the system font directory (/usr/share/fonts/). Please note that the fonts has been renamed to "WenQuanYi Zen Hei", so the original WenQuanYi Zen Hei font won't be used, even for other applications.

2022 and I'm still facing such issues
I'm running it in Portuguese and text is not rendered fully if there are any letters with diacritics.