bbepis / XUnity.AutoTranslator

MIT License
1.91k stars 289 forks source link

Font resizing issue #86

Open Aceship opened 4 years ago

Aceship commented 4 years ago

Hi, currently im trying to resize a text in game called alice gear aegis

while in title screen, it works, but after that somehow all of it wont work the path and level seems weird compared to title text image i tried using this path, but it doesnt seems to work

SceneResources/game/SafeArea/PageRoot/Pages_FramePage(Clone)/Pages_Frame_HomeTopPage(Clone)/Pages_Frame_HomeTop_MainPage(Clone)/Menu/TopHeader/bannerList/date/root0/text=ChangeFontSize(30)

is it still possible if the path and level is like that or am i out of option ?

gravydevsupreme commented 4 years ago

I would recommend trying with less specificity. Don't use the entire path especially if it looks like there are variable names in the path.

To verify whether or not it works with the in-game scene overall you can try only specifying the outer-most path segment such as 'SceneResources' as the path in the resizer file.

Doing so will hit a much wider array of text components, but it is also more likely to generate results, after which point you can add more specificity to the path.

In general, short paths are better, as long as it hits what you intend.

It does look like the game is using a "custom" text component UI.TextEx, which means it could override the sizing/display behaviour in a way that plugin would have no way of knowing.

Aceship commented 4 years ago

i tried just SceneResources but it still doesnt work

gravydevsupreme commented 4 years ago

In that case it's probably going to be a lot harder to determine the cause.

You may need to use tools such Runtime Unity Editor to determine what is going wrong. With that you can enable/disable game objects to see where various UI elements are placed. But it is a very programmer-oriented tool, so that might be a tough ask.

Are you running the game through an emulator or how are you running it on a PC?

Aceship commented 4 years ago

i run it normally through dmm, not an emulator

the game actually started as a mobile game, and then the developer decided to make a pc client version

i'll check the runtime unity editor later

gravydevsupreme commented 4 years ago

Did you ever manage to solve the problem you were having?

I wanted to check out the game, but never really found a way to obtain it. Only found references to mobile version.

dima245 commented 4 years ago

Безымянный translate.google I want to change the font size. i tried switching lines IgnoreWhitespaceInDialogue IgnoreWhitespaceInNGUI MinDialogueChars EnableUIResizing ForceUIResizing but I don't see the result. read about a file named resizer.txt. but not found, nor any file with a similar name what should I do? sometimes, words in the game merge and go beyond the boundaries of the game

original text я хочу изменить рамер шрифта. я пробовал переключать строки IgnoreWhitespaceInDialogue IgnoreWhitespaceInNGUI MinDialogueChars EnableUIResizing ForceUIResizing но результата я не вижу. читал про файл с именем resizer.txt . но не нашол, ни какого файл с похожим именем что мне делать? порой, слова в игре , сливаются и выходят за граници игры

dima245 commented 4 years ago

translate.google I cannot use regular expressions. in files _AutoGeneratedTranslations and even in _Preprocessors. wrote the following lines sr:"^汚染度: ([0-9]{2}) ([\S\s]+)$"=Степень загрязнения:$1 $2 sr:"^拘束回数: ([0-9]{2}) ([\S\s]+)$"=Количество ограничений:$1 $2 sr:"^絶頂回数: ([0-9]{2}) ([\S\s]+)$"=Количество спермы:$1 $2 sr:"^異形とH: ([0-9]{2}) ([\S\s]+)$"=Вариант H:$1 $2 sr:"^機械とH: ([0-9]{2}) ([\S\s]+)$"=Машина H:$1 $2 sr:"^人間とH: ([0-9]{2}) ([\S\s]+)$"=Люди и H:$1 $2 all the same, with every increase in the number in the game 汚染度: 13=Степень загрязнения: 13 人間とH: 2=Люди и H: 2 拘束回数: 19=Количество ограничений: 19 絶頂回数: 12=Количество спермы: 12 異形とH: 10=Вариант и H: 10 機械とH: 0=Машина и H: 0 the program regards it as a new word and translates. I can't even correct the text so that it is not long. and did not creep into other text. all the same will translate the other.

original text я не могу воспользоваться регулярными выражениями . в файлах _AutoGeneratedTranslations и даже в _Preprocessors. писал следующие строки sr:"^汚染度: ([0-9]{2}) ([\S\s]+)$"=Степень загрязнения:$1 $2 sr:"^拘束回数: ([0-9]{2}) ([\S\s]+)$"=Количество ограничений:$1 $2 sr:"^絶頂回数: ([0-9]{2}) ([\S\s]+)$"=Количество спермы:$1 $2 sr:"^異形とH: ([0-9]{2}) ([\S\s]+)$"=Вариант H:$1 $2 sr:"^機械とH: ([0-9]{2}) ([\S\s]+)$"=Машина H:$1 $2 sr:"^人間とH: ([0-9]{2}) ([\S\s]+)$"=Люди и H:$1 $2

всеравно, с каждый увеличением числа в игре 汚染度: 13=Степень загрязнения: 13 人間とH: 2=Люди и H: 2 拘束回数: 19=Количество ограничений: 19 絶頂回数: 12=Количество спермы: 12 異形とH: 10=Вариант и H: 10 機械とH: 0=Машина и H: 0 программа расценивает как новое слово и переводит. я даже не могу откоректировать текст чтобы, он не был длинным . и не наползал на другой текст. всеравно переведёт заного.

Безымянный

gravydevsupreme commented 4 years ago

Greetings,

About UI resizing: You should simply keep default configuration (don't change EnableUIResize or ForceUIResize).

About resizer files: You need to create a file in the text translation directory that ends with *.resizer.txt (UTF-8). You can place resizing commands in that. But for that to work you will need to inspect the game object paths in the game using various configuraiton options provided by this plugin or by using a plugin like Unity Runtime Editor. However, it looks like the biggest issue you are facing here is with text kerning (character spacing), which this plugin has no functionality to handle.

About regexes: Place all manual translations you make in your own translation text files, not any of the pre-defined files. And I cannot really see why you have to variables (groups) in the splitter regexes. It doesn't look like that is needed.

_Preprocessors.txt and _Substitutions.txt files are special purpose files. See documentation for those in the README. You cannot use regexes in them.

dima245 commented 4 years ago

translate.google got it. I had to write r :, instead of sr:. seems to have stopped translating in a new way with each new digit. but where the intersymbol interval came from, I can't understand, because in the original and in the English translation, it is not there.

original text понял. Я должен был написать r:, вместо sr :. кажется, перестало с каждой новой цифрой переводить по-новому. а вот, от куда взялся, межсивмвольный интевал, не могу понять, ведь в оригинале и английском переводе, его нету.

gravydevsupreme commented 4 years ago

Glad to hear you got it working.

If your last sentence is a question you'll have to provide an example/rephrase it, because I don't understand.

dima245 commented 4 years ago

translate.google it's not a question. I don't ask. I say. I do not understand. from where the intersymbol interval came from.

original text это не вопрос. я не спрашиваю. я говорю. я не понимаю. от куда взялся межсимвольный интеравал.

translate.google I'm thinking maybe this font does not work correctly with the Russian language. maybe I should use the commands: OverrideFont OverrideFontTextMeshPro as I understood from the use of commands: 1.download any font

  1. put in the folder with translation
  2. specify the path and name of the font file. now the question. did I understand the instructions correctly?

original text я вот думаю, может это шрифт, некоректно с русским языком работает. может быть мне следует использовать команды: OverrideFont OverrideFontTextMeshPro как я понял по использованию команд: 1.скачать любой шрифт

  1. положить в папку с переводом 3.указать путь и имя файла шрифта. теперь вопрос. я правильно понял инструкцию?
gravydevsupreme commented 4 years ago

I do not understand what 'intersymbol' is.

What regex do you have and what translation does it result in?

About fonts: This is not right. The font specified as OverrideFont must be a system-installed font and will be used for standard UI text elements.

The font specified as OverrideFontTextMeshPro must be generated using special TextMesh Pro tooling that comes with the Unity Editor and placed in an asset bundle that. It is the path of that asset bundle this configuration parameter specifies. This font is used for special, higher quality text elements.

On the release page the TMP_Font_AssetBundles.zip file contains examples of such asset bundles generated for different versions of the unity game engine (these assume there exists a file in the Managed directory of the game called Unity.TextMeshPro.dll).

DonSlonik commented 3 years ago

от куда взялся межсимвольный интеравал.

Судя по твоим скринам, это шрифт, который использует Xunity.AutoTranslator по умолчанию. А вот тот шрифт, который ты укажешь в файле \AutoTranslator\Config.ini в переменной OverrideFont ВНИМАНИЕ нужно переключить внутри запущенной игры комбинацией ALT+F

например мои настройки шрифта в фале \AutoTranslator\Config.ini : OverrideFont=Consolas OverrideFontSize=14

Pofearn commented 2 years ago

что-то так и не могу понять, куда файл resize.txt разместить чтобы заработало, и как мне узнать название, т.е. название_resize.txt Пути я знаю: Canvas/WidgetLayer/UI_Menu(Clone)/MenuObject/ShopBtn/ChangeFontSizeByPercentage(0.5) Canvas/WidgetLayer/UI_Menu(Clone)/MenuObject/CombinationBtn/ChangeFontSizeByPercentage(0.5) Canvas/WidgetLayer/UI_Menu(Clone)/MenuObject/RankingBtn/ChangeFontSizeByPercentage(0.5) Canvas/WidgetLayer/UI_Menu(Clone)/MenuObject/MimisbrunnrBtn/ChangeFontSizeByPercentage(0.5) Canvas/StaticLayer/UI_HeaderMenuStatic(Clone)/Buttons_Top/ButtonContainer/ChangeFontSizeByPercentage(0.8)

Но как сделать чтобы уменьшился размер не пойму

image

Loli-Kyn commented 2 years ago

что-то так и не могу понять, куда файл resize.txt link чтобы заработало, и как мне узнать название, т.е. название_resize.txt Пути я знаю: Холст / WidgetLayer / UI_Menu (Клон) / MenuObject / ShopBtn / ChangeFontSizeByPercentage (0,5) Холст / WidgetLayer / UI_Menu (Клон) / MenuObject / CombinationBtn / ChangeFontSizeByPercentage (0,5) Холст / WidgetLayer / UI_Menu (Клон) / MenuObject/RankingBtn/ChangeFontSizeByPercentage(0.5) Canvas/WidgetLayer/UI_Menu(Clone)/MenuObject/MimisbrunnrBtn/ChangeFontSizeByPercentage(0.5) Canvas/StaticLayer/UI_HeaderMenuStatic(Clone)/Buttons_Top/ButtonContainer/ChangeFontSize(0.8)Percentage

Но как сделать чтобы уменьшился размер не поймать

изображение

Привет. Ты еще не нашел как избавиться от данной проблемы?

Pofearn commented 2 years ago

Привет. Ты еще не нашел как избавиться от данной проблемы?

Нашел, но я уже удалил Если на память (из документации): CTRL + ALT + NP6: Print out entire GameObject hierarchy to file hierarchy.txt CTRL + ALT + NP6: Распечатайте всю иерархию GameObject в файловой hierarchy.txt Файл hierarchy.txt появится в папке с переводчиком, в этом файле прописываются имена игровых объектов, к примеру зашел в игре в меню и нажал CTRL + ALT + NP6 (NumPad 6), то в hierarchy.txt появится название игрового объекта. Далее методом тыка :) Написал бы подробнее но у меня даже черновиков не осталось чтобы вспомнить подробнее.

Loli-Kyn commented 2 years ago

Good afternoon. How to remove spaces in words (see screenshot 1)? I tried different fonts downloaded from github (see screenshot 2) and also changed the words size. I deleted the folder with the translation and checked everything again. Nothing happened. The game has Unity.TextMeshPro.dll

Neubeu commented 2 weeks ago

Good afternoon. How to remove spaces in words (see screenshot 1)? I tried different fonts downloaded from github (see screenshot 2) and also changed the words size. I deleted the folder with the translation and checked everything again. Nothing happened. The game has Unity.TextMeshPro.dll

Я поставил так и межсимвольные интервалы вернулись в норму OverrideFontTextMeshPro=arialuni_sdf_u2018 FallbackFontTextMeshPro=arialuni_sdf_u2019