How to Change Font Size in Unity?

A guide to modifying font sizes in Unity games using the BepInEx framework and XUAT plugin.

This method might not work for some games

Step 1: Enable Console

  • Open the file "GAME_DIR\BepInEx\config\BepInEx.cfg"

  • In the [Logging.Console] section, change "Enabled = false" to "Enabled = true"

GAME_DIR\BepInEx\config\BepInEx.cfg
[Logging.Console]

## Enables showing a console for log output.
# Setting type: Boolean
# Default value: false
Enabled = true

Step 2: Enable Text Path Logging

  • Open the file "GAME_DIR\BepInEx\config\AutoTranslatorConfig.ini"

  • In the [Behaviour] section, change "EnableTextPathLogging=False" to "EnableTextPathLogging=True"

GAME_DIR\BepInEx\config\AutoTranslatorConfig.ini
[Behaviour]
EnableTextPathLogging=True

Step 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"

You can create more than one of these files. Each file must be a .txt file with the name ending in "resizer". Example: mainmenu_resizer.txt, dialogue.resizer.txt, _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 font

    • IgnoreFontSize(): 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:

ChangeFontSizeByPercentage(0.75)

  • 0.5 = 50%

  • 1 = 100%

  • 1.5 = 150%