New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MacOS Mojava] Chinese charator display incorrect #2167
Comments
one more issue: |
社区服中文乱码这么多年就没有修复过。v社度假社名不虚传。隔壁dota2多少年前就上了vulkanAPI,再看看csgo,整体除了新箱子就是地图改动。 |
包括所有source engineSDK也没有mac版本。这些sdk在wine下面运行的风生水起,官方连个封装包都懒的做。连arma3和rust的sdk都有mac版。 |
老版本os x好像可以显示中文,但是字距非常非常短以至于重叠那种。 我现在这个乱码问题已经至少浪费了两天时间在里面了,试过装 fontconf 怎么调也不行,然后发现游戏程序内 csgo/panorama 里面也有 fontconf 配置,也是各种调,还是不能解决,参照了N个 YouTube 教程还有国内一些修复 Linux 上中文乱码的教程,依然是没搞好,我已经放弃了。 附上 Linux 乱码解决方案: |
抱歉回复晚了,不经常上github,毕竟不是程序员。这个linux下的解决方案我半年前就看过了,包括更换系统字体什么方法都试过了,不管用,游戏目录里也有字体的配置文件,只能说自己不够强没法解决相关问题。 |
刚刚进了dota2看了一眼,dota2的显示没有问题 |
有一个暂时的解决方法是把系统自带的 Helvetica 字体复制一份,然后用 FontForge 把它和其他有汉字字形的字体(例如 Arial Unicode)合并,然后再安装到系统,就可以在游戏里显示汉字了。 |
感谢分享,回头我试试。(有生之年居然还能收到回复) |
已经合并了字体,然后发现 Catalina 好像不能操作系统的字体目录。。应该是最后一步了 |
老哥能把合并好的字体发一份给我嘛,那个fontforge下下来不会用,merge完字体没法生成ttc |
进root用户,然后终端里sudo mount -uw /,就可以读写系统文件了。老哥要是成功了的话把合并好的ttc给我一份行不,chenanran123@gmail.com |
已经解决了,sudo cp 直接把文件拷贝过去也可以,现在终于能显示中文了,泪目。 |
我合并了系统的主字体(苹方),然后弄成了一个 ttc 文件,直接双击打开安装就可以了,不需要关 SIP 或者用终端指令,Arial Unicode 毕竟还是有点丑 |
根据 @SoraAzure 提供的方法写了一篇B站专栏, 特此感谢 |
Big Surf更新了。。。。有啥新方法解决吗 |
暂时找不到方法,big sur之后甚至锁死系统字体不让替换了,反正我已经配了一台windows用于打游戏( |
或者有啥办法改改csgo的config文件呢?本人太菜找不到在哪。。。 |
steam游戏库中csgo右键,本地文件,在finder中打开 |
我的意思是改哪些。。。看了半天xml没搞明白它字体咋设置的。。。 |
在 Big Sur 之前,是可以通过直接安装和 Helvetica 同名的、支持汉字的字体文件来解决问题的,但是现在不行了,我也在纠结 |
大行动开始啦!!!发现貌似国服和国际服有的字体换了,所以有啥官方文件里有字体配置方法吗 |
关注+1 |
有一个可以参考的解决方案: std::string GBK_To_UTF8(const std::string& strGbk)//传入的strGbk是GBK编码
{
//gbk转unicode
auto len = MultiByteToWideChar(CP_ACP, 0, strGbk.c_str(), -1, NULL, 0);
std::unique_ptr<wchar_t[]> strUnicode(new wchar_t[len + 1] {});
MultiByteToWideChar(CP_ACP, 0, strGbk.c_str(), -1, strUnicode.get(), len);
//unicode转UTF-8
len = WideCharToMultiByte(CP_UTF8, 0, strUnicode.get(), -1, NULL, 0, NULL, NULL);
std::unique_ptr<char[]> strUtf8(new char[len + 1] {});
WideCharToMultiByte(CP_UTF8, 0, strUnicode.get(), -1, strUtf8.get(), len, NULL, NULL);
//此时的strUtf8是UTF-8编码
return std::string(strUtf8.get());
}
std::string UTF8_To_GBK(const std::string& strUtf8)
{
//UTF-8转unicode
int len = MultiByteToWideChar(CP_UTF8, 0, strUtf8.c_str(), -1, NULL, 0);
std::unique_ptr<wchar_t[]> strUnicode(new wchar_t[len + 1] {});//len = 2
MultiByteToWideChar(CP_UTF8, 0, strUtf8.c_str(), -1, strUnicode.get(), len);
//unicode转gbk
len = WideCharToMultiByte(CP_ACP, 0, strUnicode.get(), -1, NULL, 0, NULL, NULL);
std::unique_ptr<char[]>strGbk(new char[len + 1] {});//len=3 本来为2,但是char*后面自动加上了\0
WideCharToMultiByte(CP_ACP, 0, strUnicode.get(), -1, strGbk.get(), len, NULL, NULL);
//此时的strTemp是GBK编码
return std::string(strGbk.get());
} |
Big Sur 删除快照之后再
就可以 |
这个bug似乎已经修好了 |
有生之年了属于是。。。。 |
我之前借到了个mac然后进我服里看了眼 发现字体一切正常 大概率是V社直接拿走我之前PR的代码复制粘贴了 |
啥时候修了啊。。。刚进游戏看了下还是老样子。。。 |
@CrazyKidCN @kisak-valve Please check this part of code if needed to fix (gb2312, utf8), can be used at all-platforms, at least I've tested and well-performance. |
v社只把时间花到赚钱去了,社区服务器不显示鼠标这个问题7年了也不解决 |
Chinese charator display incorrect on community server browser, Game HUD, Game Instructor Messages and in-game menu. (But display correctly on panorama UI)
System information here:
I have already checked for system updates and never installed any other 3rd custom fonts
https://imgur.com/a/wohDzEZ
Community server browser:
server name and browser title is include chinese charators, but not display correctly
https://imgur.com/a/Da0CTjT
Game Instructor Messages:
https://imgur.com/a/bVw1VJi
Game HUD and in-game menu (this is in community server, zombie escape mode):
https://imgur.com/a/ZKHWl1u
Steps for reproducing this issue:
-language schinese
The text was updated successfully, but these errors were encountered: