VNTranslator
Become a PatronJoin Our Discord
  • Overview
  • GETTING STARTED
    • Getting Started
    • System Requirements
    • Download & Installation
    • Interface Basics
  • Features
    • Launcher
    • Modules
    • Translation
      • Translation Settings
      • Translation Glossary
      • Extra Options
        • Pre-translation
        • Post-translation
        • Variables
      • Transcheck
      • Advanced Settings
      • Translation Editor
      • Export Translation
      • Import Translation
    • MT Engines
      • MT Settings
      • DeepL API
      • OpenAI Translate (Legacy)
    • Extra Window
    • Hyper Overlay
    • Extensions
      • JParser
      • Jisho
      • Fast OCR
    • Hotkeys
  • User Guide
    • Clipboard
    • OCR
      • Features
        • OCR Screen
        • OCR Master
        • Pre-processing
        • OCR Engines
          • Tesseract OCR
          • Windows OCR
          • Google Cloud Vision
          • Azure Cloud Vision
          • Google Lens
          • Custom - Command Line
          • Custom - HTTP POST
        • Post-processing
      • OCR Engine Installer
      • Understanding OCR and Improving Accuracy
      • OCR Engines Comparison
    • OCR GX 🎮
    • AutoTrans
      • Translation Modes
      • Font Replacement
      • Feature Settings
        • Translation
        • Mods
      • Extract & Translate
      • Steam Connect
      • RTL
      • FAQ
        • How Can I Improve Game Speed in AutoTrans?
        • How to Change Font Type in RenPy?
        • How to Change Font Size in Unity?
    • RenPy Games
    • Tyrano Builder
    • TextractorCLI
  • ADVANCED
    • LLMs
      • System Prompt
      • OpenAI API
      • GeminiAI API
    • Custom MT
      • Schema
      • Form Builder
      • Request & Response
      • Components
      • webLLM
      • MT Kit
      • V1 & V2 (Archive)
    • OCR Server Kit
      • EasyOCR
      • SuryaOCR
    • API Gateway
      • Translate
      • Translation Memory 🚧
    • RegExp
      • Matching
      • Replacement
  • Help
    • FAQ
    • Troubleshooting
      • Launcher
        • VNTranslator appears as a black box
      • Network Connection
      • Machine Translation (MT)
        • Web Scraping Timeout
        • API Error Codes
        • Clear Cookies & Site Data
      • OCR
      • AutoTrans
      • TextractorCLI
    • Glossary
    • Archives
      • Comparison of OCR Version 1.0 and 2.0
      • Workflow Explanation for OCR
      • OCR 1.0 (Archive)
        • Tesseract OCR
        • Screen Capture
        • Post-Capture Actions
    • Credits
Powered by GitBook
On this page
  • Step 1: Enable Console
  • Step 2: Enable Text Path Logging
  • Step 3: Launch the game and find the Text Path in the Console
  • Step 4: Creating a Resizer File
  • Example of the font resizer syntax in the Quickie Game:
  1. User Guide
  2. AutoTrans
  3. FAQ

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

[Info   :XUnity.AutoTranslator] Setting text on '???' to '???' # <-- Game Text
[Info   :XUnity.AutoTranslator] Path : ??? # <-- Text Path
[Info   :XUnity.AutoTranslator] Level: ???

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:

TextPath=Command

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.


Example of the font resizer syntax in the Quickie Game:

Console
[Info   :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to 'Lorem Ipsum...'
[Info   :XUnity.AutoTranslator] Path : /UIManager/ui_conversation/limiter/panel_dialogue/normal/txtmeshDialogueNormal
[Info   :XUnity.AutoTranslator] Level: -1
[Info   :XUnity.AutoTranslator] Setting text on 'UnityEngine.UI.Text' to 'It is a long...'
[Info   :XUnity.AutoTranslator] Path : /UIManager/ui_conversation/limiter/choices/panel_choices/ui_conversation_option(Clone)/text
[Info   :XUnity.AutoTranslator] Level: -1
[Info   :XUnity.AutoTranslator] Setting text on 'UnityEngine.UI.Text' to 'Contrary to popular...'
[Info   :XUnity.AutoTranslator] Path : /UIManager/ui_conversation/limiter/choices/panel_choices/ui_conversation_option(Clone)/text
[Info   :XUnity.AutoTranslator] Level: -1
resizer.txt
/UIManager/ui_conversation/limiter/panel_dialogue/normal/txtmeshDialogueNormal=ChangeFontSizeByPercentage(0.75)
/UIManager/ui_conversation/limiter/choices/panel_choices/ui_conversation_option(Clone)/text=ChangeFontSizeByPercentage(0.75)

ChangeFontSizeByPercentage(0.75)

  • 0.5 = 50%

  • 1 = 100%

  • 1.5 = 150%

mainmenu_resizer.txt
/mainmenu/limiter/content/bg/info/butons/btnNewGame/Text=ChangeFontSize(16)
/mainmenu/limiter/content/bg/info/butons/btnLoadGame/Text=ChangeFontSize(16)
/mainmenu/limiter/content/bg/info/butons/btnOptions/Text=ChangeFontSize(16)
/mainmenu/limiter/content/bg/info/butons/btnCredits/Text=ChangeFontSize(16)
/mainmenu/limiter/content/bg/info/butons/btnQuit/Text=ChangeFontSize(16)

# Or for all groups "/mainmenu/limiter/content/bg/info/butons"

/mainmenu/limiter/content/bg/info/butons=ChangeFontSize(16)
PreviousHow to Change Font Type in RenPy?NextRenPy Games

Last updated 11 months ago

For more information, visit:

https://github.com/bbepis/XUnity.AutoTranslator#ui-font-resizing