How to Change Font Size in Unity?
A guide to modifying font sizes in Unity games using the BepInEx framework and XUAT plugin.
Step 1: Enable Console
Open the file
"GAME_DIR\BepInEx\config\BepInEx.cfg"In the [Logging.Console] section, change "Enabled = false" to "Enabled = true"
[Logging.Console]
## Enables showing a console for log output.
# Setting type: Boolean
# Default value: false
Enabled = trueStep 2: Enable Text Path Logging
Open the file
"GAME_DIR\BepInEx\config\AutoTranslatorConfig.ini"In the [Behaviour] section, change "EnableTextPathLogging=False" to "EnableTextPathLogging=True"
[Behaviour]
EnableTextPathLogging=TrueStep 3: Launch the game and find the Text Path in the Console
If configured correctly, a console window will appear, showing the Game Text and Text Path
Step 4: Creating a Resizer File
Create a file named "resizer.txt" into the folder "GAME_DIR\BepInEx\Translation\en\Text\". For example: "GAME_DIR\BepInEx\Translation\en\Text\resizer.txt"
Syntax:
where available commands are:
Commands that change the font size to a static size
ChangeFontSizeByPercentage(double percentage): Where the percentage is the percentage of the original font size to reduce it to.ChangeFontSize(int size): Where the size if the new size of the fontIgnoreFontSize(): This can be used to reset font resize behavior that was set on a very 'non-specific' path.
For more information, visit: https://github.com/bbepis/XUnity.AutoTranslator#ui-font-resizing
Example of the font resizer syntax in the Quickie Game:
