XUnity.AutoTranslator icon indicating copy to clipboard operation
XUnity.AutoTranslator copied to clipboard

XUnity.AutoTranslator replace font problem

Open IGBT-001 opened this issue 3 years ago • 17 comments

As mentioned in the title, when I used the XUnity.AutoTranslator plugin, I found that the translated text could not be displayed normally, and all displayed "口 口" After querying the development documents, I added SDF fonts according to the instructions, but the plugin seems to have only replaced one SDF font, and none of the remaining 7 SDF fonts in the game have been replaced, resulting in the display of "口 口" OverrideFontTextMeshPro, FallbackFontTextMeshPro have been modified What should I do to get it to display properly, looking forward to a reply!

IGBT-001 avatar Jun 16 '22 09:06 IGBT-001

I am quite sure that the "口口" is because of the font, because after adding the font, some content can be displayed normally, and the remaining fonts that are not displayed normally are the reason for using another SDF font

IGBT-001 avatar Jun 16 '22 09:06 IGBT-001

By querying the background log, I found that it seems to be a font problem [01:09:51.517] SceneManager is supported in this version of Unity. [01:09:51.525] Attempting to load TextMesh Pro font from asset bundle. [01:09:51.663] Loaded TextMesh Pro font uses version: 1.1.0 [01:09:51.664] [WARNING] TextMesh Pro version mismatch. Font asset version: 1.1.0, TextMesh Pro version: 1.4.0 [01:09:51.676] Loaded fallback font for TextMesh Pro: arialuni_sdf_u2018 [01:09:51.680] Loaded resize command text files. [01:09:51.687] --- Loading Global Translations ---

IGBT-001 avatar Jun 16 '22 17:06 IGBT-001

try this mod... if your game is on li2cpp https://github.com/bbepis/XUnity.AutoTranslator/issues/287#issuecomment-1158891109

Atamg1994 avatar Jun 17 '22 13:06 Atamg1994

尝试这个模组……如果你的游戏在 li2cpp #287(评论) Sorry, the problem is that my game is based on Mono, I try to replace it with another plugin, don't know why, the plugin always doesn't work,

IGBT-001 avatar Jun 17 '22 13:06 IGBT-001

尝试这个模组……如果你的游戏在 li2cpp #287(评论) Sorry, the problem is that my game is based on Mono, I try to replace it with another plugin, don't know why, the plugin always doesn't work,

send me you game Managed folder I will try to rebuild the mod for mono

Atamg1994 avatar Jun 17 '22 14:06 Atamg1994

试用这个模组……如果你的游戏在 li2cpp #287(评论插件) ,对不起,问题是我的游戏是基于 Mono 的,我尝试用另一个替换替换,它不知道为什么插件,总是不能工作,

将游戏发送给我我将测试为单给的重构模式

https://drive.google.com/drive/folders/1_rtmvVHKLK2V5XG4x_nvWNdsfOhF5CL9?usp=sharing Please try it to see if you can access it normally, thanks!

IGBT-001 avatar Jun 17 '22 15:06 IGBT-001

试用这个模组……如果你的游戏在 li2cpp #287(评论插件) ,对不起,问题是我的游戏是基于 Mono 的,我尝试用另一个替换替换,它不知道为什么插件,总是不能工作,

将游戏发送给我我将测试为单给的重构模式

https://drive.google.com/drive/folders/1_rtmvVHKLK2V5XG4x_nvWNdsfOhF5CL9?usp=sharing Please try it to see if you can access it normally, thanks!

Almost all

I have text partially displayed

i need your country font in ttf format for tests Screenshot_76 Screenshot_77

I think my font does not fully support your characters

Atamg1994 avatar Jun 17 '22 16:06 Atamg1994

几乎所有的

我的文字部分显示

我需要你的 ttf 格式的国家字体进行测试 截图_76 截图_77

我认为我的字体不完全支持你的字符 Chinese Font.zip

Ok, I still have the link, I have uploaded the fonts of our country, both in OTF and TTF formats

IGBT-001 avatar Jun 18 '22 01:06 IGBT-001

几乎所有的 我的文字部分显示 我需要你的 ttf 格式的国家字体进行测试 截图_76 截图_77 我认为我的字体不完全支持你的字符 Chinese Font.zip

Ok, I still have the link, I have uploaded the fonts of our country, both in OTF and TTF formats

it works but not as expected

since the font is dynamically connected, the missing characters should be generated in the process, but for some reason in this game this process does not work as it should

what happened

created map.txt file characters are written in it and they are added to the font at the start of the game

and the more symbols there, the longer the start of the game also, if some characters are not found during the game, they themselves will fall into the file and the next game everything will be ok

Screenshot_78

Screenshot_79

Screenshot_80

in general, you have the choice to throw all the symbols into the map file at once and wait a few minutes at the beginning ... or play like this and the restart field in the file will already have those symbols that do not work for a short time

installation required melon loader and XUnity.AutoTranslator-MelonMod-5.1.0.zip and https://mega.nz/file/DApDiKIZ#woum0bEkNEvimd7afBHCiM7YLi6S-6nwoKmcXyBsPlY

Atamg1994 avatar Jun 18 '22 06:06 Atamg1994

I hope it helped

By the way, the library is not mine, I found it on the Internet, it was just designed for another game here is the original untouched and not modified

for those who want to see https://mega.nz/file/eE5wwYTa#w4xWbYOH0ki9NSY5egbziN8NxbZlIhSXzYMbKU0Pxx8 original for il2cpp game

Atamg1994 avatar Jun 18 '22 06:06 Atamg1994

我希望它有帮助

顺便说一下,这个库不是我的,我在网上找到的,它只是为另一个游戏设计的, 这里是原始的,没有改动,没有修改

对于那些想要查看 https://mega.nz/file/eE5wwYTa#w4xWbYOH0ki9NSY5egbziN8NxbZlIhSXzYMbKU0Pxx8 il2cpp 游戏原件的人

Anyway, thanks for your reply and help, thank you!

IGBT-001 avatar Jun 18 '22 06:06 IGBT-001

Anyway, thanks for your reply and help, thank you!

Hey ) I made an update on the mod with the font

now it loads everything in real time and there is no need to restart everything works, anyway, I would like you to test it on your game since I don’t have it anymore (I checked it on my il2cpp game) and transferred the edits to the mono version, but you need to check, could you?

make a backup of the previous version

and fill in the current and check how everything works) here is the link https://mega.nz/file/2dBBEZJC#1UpA0RYsB6lWCeDSSxbeK91Cw8EOV-pc2Ix6JXXYSOg

Atamg1994 avatar Jul 23 '22 17:07 Atamg1994

无论如何,感谢您的回复和帮助,谢谢!

嘿) 我用字体更新了mod

现在它实时加载所有内容,无需重新启动一切正常, 无论如何,我希望你在你的游戏上测试它,因为我不再拥有它(我在我的 il2cpp 游戏上检查过) 并转移了编辑到单声道版本,但你需要检查,可以吗?

备份以前的版本

并填写电流并检查一切如何工作) 这里是链接 https://mega.nz/file/2dBBEZJC#1UpA0RYsB6lWCeDSSxbeK91Cw8EOV-pc2Ix6JXXYSOg

Hello Atamg1994! I used your updated font plugin and after a few tries I found several issues. Question 1: For some reason, the CPU and memory usage of the updated font plug-in has increased (simply put: the game running efficiency has become slower) Problem 2: After using the font plug-in, the game will preferentially load the "map.txt" file by default, which causes some functions of the automatic translation plug-in to fail (reload the translated text, ait+R), and the modified strings cannot be displayed in real time. . Question 3: How can I customize the font, the "font.ttf" font in the font plugin looks a little uncomfortable in some places. The above content uses Google Translate.

你好,Atamg1994! 我使用了你更新的字体插件,经过几次尝试以后我发现了几个问题。 问题1:不知为何,使用更新后的字体插件CPU、内存的使用率变大了(简单点说就是:游戏运行效率变慢了) 问题2 :使用字体插件后,游戏默认优先加载“map.txt“”文件,导致自动翻译插件的某些功能失效了(重新加载翻译文本,ait+R),无法使修改后的字符串实时显示。 问题3:如何才能自定义字体,字体插件中自带的“font.ttf”字体在某些地方看着有些难受。 以上内容使用Google翻译。

IGBT-001 avatar Jul 24 '22 17:07 IGBT-001

Question 1: For some reason, the CPU and memory usage of the updated font plug-in has increased (simply put: the game running efficiency has become slower) Problem 2: After using the font plug-in, the game will preferentially load the "map.txt" file by default, which causes some functions of the automatic translation plug-in to fail (reload the translated text, ait+R), and the modified strings cannot be displayed in real time. . Question 3: How can I customize the font, the "font.ttf" font in the font plugin looks a little uncomfortable in some places.

hi thanks I'll try to do something in the next few days

the font is changed simply by replacing the font file itself, you can put any ttf (unitcode)

you can always rollback to an older version)

Atamg1994 avatar Jul 24 '22 18:07 Atamg1994

问题一:由于某种原因,更新字体插件的CPU和内存占用增加了(简单来说:游戏运行效率变慢了) 问题二:使用字体插件后,游戏会优先加载默认为“map.txt”文件,导致自动翻译插件部分功能失效(重新加载翻译文本,ait+R),无法实时显示修改后的字符串。. 问题3:如何自定义字体,字体插件中的“font.ttf”字体有些地方看起来有点不舒服。

嗨,谢谢 ,我会在接下来的几天里尝试做一些事情

只需更换字体文件本身即可更改字体,您可以放置​​任何 ttf (unitcode)

您可以随时回滚到旧版本)

Hello Atamg1994! I want to fix the problem I just had. The font plugin does not conflict with the translation plugin. It's just that after the update of my graphics card driver, I don't know why (Alt+R) is occupied, which makes the function of reloading the translation file invalid. About adding custom fonts, I may not be very accurate. What I originally meant to express was whether to add multiple fonts to display separately, such as A font for books, B font for monitors, and so on. Or that I can only start with the translation file, the same way as specifying the font display size?

你好,Atamg1994! 我想要修正一下我刚刚的问题,字体插件并没有和翻译插件冲突,只是我的显卡驱动更新后,不知道为何把(Alt+R)给占用了,导致重新加载翻译文件功能失效。 关于添加自定义字体的事情我可能描述的不是很准确,我原本想表达的意思是能否添加多种字体分别显示,例如书籍用A字体、显示器用B字体等等以此类推。 还是说我只能在翻译文件上下手,和指定字体显示大小一样的办法?

IGBT-001 avatar Jul 24 '22 18:07 IGBT-001

I can only start with the translation file, the same way as specifying the font display size?

most likely through the translation itself Screenshot_99

because the file does not work through resize

XUnity.AutoTranslator has text resizing commands, they are bound to the object name

enable the option in the config Screenshot_96

and get in the logs the full paths to the objects to which the text is attached and then through the resize.txt file Screenshot_97

adjust the size as in the example and then after alt + r (or restart the game) the new size will change to the text this is how it works in the games that I play in this game, the text disappears (( Screenshot_98

here is the new file check like fixed CPU load at startup, it works as before, takes characters from the map file during the game, if characters appear that are not yet defined, it will add them to the map file and display them normally in the game (without the need to restart) FontOverride.zip

Atamg1994 avatar Jul 24 '22 21:07 Atamg1994

here is the new file check like fixed CPU load at startup, it works as before, takes characters from the map file during the game, if characters appear that are not yet defined, it will add them to the map file and display them normally in the game (without the need to restart) FontOverride.zip

Anyway, thanks for your help! My current process for doing localization patches is

  1. Translate 99% of the strings to solve the problem of localization;
  2. Adjust the font size of some strings to make them suitable for display;
  3. Optimize the translation file, add a variety of fonts to beautify the translated text display; However, thanks for your help!

不管如何,还是感谢你的帮助! 我目前做本地化补丁的流程是 1、翻译99%的字符串,解决有无本地化的问题; 2、调整部分字符串的字体大小,使其合适显示; 3、优化翻译文件,添加多种字体美化翻译后的文本显示; 但是,还是要感谢你的帮助!

IGBT-001 avatar Jul 25 '22 01:07 IGBT-001

here is the new file check like fixed CPU load at startup, it works as before, takes characters from the map file during the game, if characters appear that are not yet defined, it will add them to the map file and display them normally in the game (without the need to restart) FontOverride.zip

Anyway, thanks for your help! My current process for doing localization patches is

1. Translate 99% of the strings to solve the problem of localization;

2. Adjust the font size of some strings to make them suitable for display;

3. Optimize the translation file, add a variety of fonts to beautify the translated text display;
   However, thanks for your help!

不管如何,还是感谢你的帮助! 我目前做本地化补丁的流程是 1、翻译99%的字符串,解决有无本地化的问题; 2、调整部分字符串的字体大小,使其合适显示; 3、优化翻译文件,添加多种字体美化翻译后的文本显示; 但是,还是要感谢你的帮助!

the files above don't work at all, any tips? I put them together with the melonloader, what did I do wrong?

I0lOl0I avatar Feb 17 '23 09:02 I0lOl0I

@Atamg1994 hi dude. I noticed you can solve those font problems. May i ask you for a help? I wanne translate a Steam game called "Convoy". It is a Unity mono game launched in 2015. I followed your tutorial in #287 . installed Melonloader, Autotranslator. they are all working will. But it shows 口 blocks like others issues. When i copied your Mods (for mono called "FontOverride" and "The Pioneers _font_fix") in to Mods folder. Game just crashed. here is the logs

[17:55:27.503] ------------------------------ [17:55:27.504] MelonLoader v0.5.7 Open-Bet [17:55:27.504] OS: Windows 10 [17:55:27.504] Hash Code: 49999848531024954985654485098975250521005157544948501005510199495356 [17:55:27.505] ------------------------------ [17:55:27.505] Game Type: Mono [17:55:27.506] Game Arch: x64 [17:55:27.506] ------------------------------ [17:55:27.506] Core::BasePath = D:\Program Files (x86)\Steam\steamapps\common\Convoy [17:55:27.507] Game::BasePath = D:\Program Files (x86)\Steam\steamapps\common\Convoy [17:55:27.507] Game::DataPath = D:\Program Files (x86)\Steam\steamapps\common\Convoy\Convoy_Data [17:55:27.507] Game::ApplicationPath = D:\Program Files (x86)\Steam\steamapps\common\Convoy\Convoy.exe

[17:55:27.677] ------------------------------ [17:55:27.677] Game Name: Convoy [17:55:27.677] Game Developer: Convoy Games [17:55:27.679] Unity Version: 2017.4.29f1 [17:55:27.679] Game Version: 1.1.55 [17:55:27.680] ------------------------------

[17:55:27.890] Preferences Loaded!

[17:55:27.920] Loading Plugins from 'D:\Program Files (x86)\Steam\steamapps\common\Convoy\Plugins'... [17:55:27.922] 0 Plugins loaded.

[17:55:28.632] Loading Mods from 'D:\Program Files (x86)\Steam\steamapps\common\Convoy\Mods'... [17:55:28.632] ------------------------------ [17:55:28.641] Melon Assembly loaded: '.\Mods\FontOverride.dll' [17:55:28.643] SHA256 Hash: 'f98089af8985d210765c684bc79bc4a8ee63485b44422728e8e7e8d0b93e838b' [17:55:28.645] Melon Assembly loaded: '.\Mods\XUnity.AutoTranslator.Plugin.MelonMod.dll' [17:55:28.646] SHA256 Hash: 'e3a64c8d6b30022a7e4d62db5c272eccf67e3230942290e2f8e258b6254dcb6b' [17:55:28.672] [ERROR] System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'FontOverride'.

at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)

at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in :0

at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, Boolean inherit) [0x00000] in :0

at System.Reflection.Assembly.GetCustomAttributes (Boolean inherit) [0x00000] in :0

at System.Attribute.GetCustomAttributes (System.Reflection.Assembly element, Boolean inherit) [0x00000] in :0

at MelonLoader.MelonUtils.PullAttributesFromAssembly[MelonInfoAttribute] (System.Reflection.Assembly asm, Boolean inherit) [0x00000] in :0

at MelonLoader.MelonUtils.PullAttributeFromAssembly[MelonInfoAttribute] (System.Reflection.Assembly asm, Boolean inherit) [0x00000] in :0

at MelonLoader.MelonAssembly.LoadMelons () [0x00000] in :0

at MelonLoader.MelonHandler.LoadMelonsFromDirectory[MelonMod] (System.String path) [0x00000] in :0

at MelonLoader.Core.Start () [0x00000] in :0

It might be a Mods loading order problem? or some problem kind like Version?

BlackCobra12168 avatar Mar 27 '23 09:03 BlackCobra12168

hi dude. I noticed you can solve those font problems. May i ask you for a help? I wanne translate a Steam game called "Convoy". It is a Unity mono game launched in 2015. I followed your tutorial in #287 . installed Melonloader, Autotranslator. they are all working will. But it shows 口 blocks like others issues. When i copied your Mods (for mono called "FontOverride" and "The Pioneers _font_fix") in to Mods folder. Game just crashed. here is the logs

the game is too old, as I understand it, the version of the framework did not fit

Atamg1994 avatar May 23 '23 08:05 Atamg1994

I can only start with the translation file, the same way as specifying the font display size?

most likely through the translation itself Screenshot_99

because the file does not work through resize

XUnity.AutoTranslator has text resizing commands, they are bound to the object name

enable the option in the config Screenshot_96

and get in the logs the full paths to the objects to which the text is attached and then through the resize.txt file Screenshot_97

adjust the size as in the example and then after alt + r (or restart the game) the new size will change to the text this is how it works in the games that I play in this game, the text disappears (( Screenshot_98

here is the new file check like fixed CPU load at startup, it works as before, takes characters from the map file during the game, if characters appear that are not yet defined, it will add them to the map file and display them normally in the game (without the need to restart) FontOverride.zip

I also tried using this tool However, I found that the TMP file seems to be replaced normally in my game - because the English font using TMP in the game has changed, but the Chinese has changed from the original mouth to blank (as shown in the picture) 12 image could you please tell me how to solve this? (Google translated)

我也尝试使用了这一工具 不过我发现在我的游戏中 TMP文件似乎被正常替换了——因为游戏中使用TMP的英文字体改变了 但中文却由原来的口变成了空白(如图所示) 12
image 请问这样怎么解决

chooooooops avatar Jul 27 '23 17:07 chooooooops

I also tried using this tool However, I found that the TMP file seems to be replaced normally in my game - because the English font using TMP in the game has changed, but the Chinese has changed from the original mouth to blank (as shown in the picture) 12 image could you please tell me how to solve this? (Google translated)

我也尝试使用了这一工具 不过我发现在我的游戏中 TMP文件似乎被正常替换了——因为游戏中使用TMP的英文字体改变了 但中文却由原来的口变成了空白(如图所示) 12 image 请问这样怎么解决

I don't think the font family you are using contains Chinese characters.

I0lOl0I avatar Jul 28 '23 14:07 I0lOl0I

I also tried using this tool However, I found that the TMP file seems to be replaced normally in my game - because the English font using TMP in the game has changed, but the Chinese has changed from the original mouth to blank (as shown in the picture) 12 image could you please tell me how to solve this? (Google translated)  我也尝试使用了这一工具 不过我发现在我的游戏中 TMP文件似乎被正常替换了——因为游戏中使用TMP的英文字体改变了 但中文却由原来的口变成了空白(如图所示) 12 image 请问这样怎么解决

I don't think the font family you are using contains Chinese characters.

image image

I'm pretty sure the font I'm using supports Chinese characters. But I don't know why they don't show up in game. At the same time, I also tried to import my TMP file by directly modifying the game file, but it also only displays English. By the way,the unity version of the game I am using is 2021.1.16f1 and the game is 32-bit. Does this have any impact? Thanks🙏 (Google translated)

我很肯定我使用的字体是支持中文字符的 但是我不知道它们为什么不在游戏中显示 同时 我也尝试了直接修改游戏文件的方式导入我的TMP文件 但同样只显示英文 谢谢🙏

chooooooops avatar Jul 29 '23 12:07 chooooooops