bbepis / XUnity.AutoTranslator

MIT License
1.87k stars 285 forks source link

OverrideFont always fail #116

Open SemteulGaram opened 4 years ago

SemteulGaram commented 4 years ago
  1. Error content Failed to update dynamic font (Arial) texture; all the needed characters do not fit onto a single texture (max size 4096). Try using less text or a smaller font size.

Error Screenshot

  1. Environment
    • Windows 10 2004 64bit
    • Game: Alice Gear Aegis 1.32.2 (DMM games) with BepIn 5.3.0.0
    • Config:
      
      [Service]
      Endpoint=GoogleTranslate

[General] Language=ko FromLanguage=ja

[Behaviour] ... OverrideFont=Arial ... (All others are default settings)



3. What i tried
- Tried fonts with smaller subsets: 
- ![Smaller font](https://cloud2.semteul.com/s/bT4DWD9xgH77oCb/preview)
- I get the same error and it doesn't work

4. Note
- Korean, which is the target of translation, is a language with a very large subset, so it seems that there is a problem with creating a single texture
- Arial, which is the system default font, and even a font that has been reduced in size as much as possible cannot be applied. I want to ask for help
gravydevsupreme commented 4 years ago

Interesting issue. Not seen it before, but it is probably because the size of the font in the generated texture is too large.

I tried adding an option to directly control the generated font size and that allows it to be generated. Although then it has different issues:

If you're interested in experimenting a bit you can try this version. It adds a new config option OverrideFontSize, an integer. You can try out different values of it to see if it works. I generally found that too small values causes the text to be very small and too large values cause the text to simply disappear. (I generally tried in the range 10-50).

XUnity.AutoTranslator-BepIn-5x-4.12.1.zip

hsinyu-chen commented 1 year ago

same issue , but only happend in battle scene

[Warning: Unity Log] Font size and style overrides are only supported for dynamic fonts. [Error : Unity Log] Failed to update dynamic font (Microsoft JhengHei UI) texture; all the needed characters do not fit onto a single texture (max size 4096). Try using less text or a smaller font size.

I Translate simplified chinese to traditional chinese , use custom Translator works fine but when I enter battle scene of the game , the error message spam the log and game is freeze

also try OverrideFontSize from 2 ~ 10 , still same