arcusmaximus / VNTranslationTools

Tools for translating visual novels
MIT License
282 stars 42 forks source link

Questions about txt.scn repacking in kirikiri engine #102

Closed Refrain69 closed 1 year ago

Refrain69 commented 1 year ago

When I repack .json into .scn files,a "box" occurs at the end of the line. 屏幕截图 2023-01-04 172058 this is the original text. 屏幕截图 2023-01-04 172158 this is what happened after repacking. However,the "box" disappeared in another font. 屏幕截图 2023-01-04 173309 How to deal with that?Any helps are appreciated.

Cosetto commented 1 year ago

Same problem with this. To fix it, open vntextpatch.exe.config with any text editor and config the word-wrap value, key="MonospaceCharactersPerLine" value="50". For Chinese, I think you don't need to wrap the text, so just make the value 1000

Refrain69 commented 1 year ago

Thanks for your help,but still not work…… 屏幕截图 2023-01-04 202318 屏幕截图 2023-01-04 202449 By the way,what's the meaning of"don't need to wrap the text"?Maybe just use json files rather than repack into scn?sorry i'm a fool:-(

Cosetto commented 1 year ago

Weird, that guy said it worked. Try using this, open the scn file and scroll that line to see what character is it

arcusmaximus commented 1 year ago

VNTextPatch uses the proportional word wrapper for Kirikiri, so changing the settings for the monospace word wrapper won't make any difference.

@Refrain69 If you can compile VNTextPatch yourself, please try making the following change in PsbScript.cs on line 65:

psb.Text.Value = ProportionalWordWrapper.Default.Wrap(StringUtil.FancifyQuotes(str.Text, @"\$.+?;"), null, "\\n");

If that fixes the problem, let me know so I can apply the change.

If you can't compile VNTextPatch, please attach a sample translation (one line that causes the problem is enough) and let me know which font has the box.

Refrain69 commented 1 year ago

the txt.scn file: s01-1_a.txt.zip the font file:
simhei.zip Thanks very much!

Refrain69 commented 1 year ago

The line is here id=215 屏幕截图 2023-01-04 223141 真奈美一边抑制着声音的颤抖,一边结束了在脑海中思考已久的自我介绍。

the font name is 黑体

arcusmaximus commented 1 year ago

I didn't want to spend too much time figuring out which of the 10 different configuration files changes the font in this game, so I just went ahead and made the code change. Please test the new build.

On a side note, I noticed KirikiriUnencryptedArchive didn't work (anymore) with this game, so I updated that as well.

Refrain69 commented 1 year ago

Both the VNTranslationTools and KirikiriUnencryptedArchive work perfectly now.Thank you very much!