Font Bundles - TheMysticSword/Localyssation GitHub Wiki

A Font bundle is a Unity asset bundle that contains additional fonts that aren't present in the game to be used in custom translations.

Creating a font bundle

Part 1: The Unity Part

  1. Download and install Unity of the same version that ATLYSS uses. At the time of writing this guide, version 2021.3.16f1 is being used.
  2. Open Unity and create a new project, using the 3D template
  3. At the top of the editor, go to Window > Package Manager
  4. Install Asset Bundle Browser package:
  5. Drag-and-drop your font files into the Assets folder in Unity
  6. Select all your font files in Unity, then find "AssetBundle" in the bottom-right part of the editor. Click it and set a unique asset bundle name. This will be the name of your font bundle.
  7. On each font file, right-click and select Create > TextMeshPro > Font Asset
  8. Set the AssetBundle name to your font bundle name for each of the TextMeshPro font assets that you've just created in the previous step
  9. At the top of the editor, go to Window > AssetBundle Browser
  10. Go to the Build tab, then click the Build button
  11. Navigate to <your Unity project folder>/AssetBundles/StandaloneWindows. If you can see a file with the same name as your asset bundle name you've set in step 6, you've done everything correctly! This file is your AssetBundle.

Part 2: Setting up the file structure

(Note: you can check out the extraFontBundle folder inside Localyssation's mod folder to see what an existing font bundle looks like)

  1. Inside your custom language's folder, create a new file called localyssationFontBundle.json
  2. Open the file and paste the following content:
{
  "bundleName": "",
  "fontInfos": [
    {
      "name": "",
      "sizeMultiplier": 1.0
    },
    {
      "name": "",
      "sizeMultiplier": 1.0
    }
  ]
}
  1. Set bundleName to your bundle's file name
  2. In fontInfos, change name to the name of the font file in your Unity project (without the file extension). Add as many font infos as you need (e.g. if your Unity project has 3 fonts, you will need 3 font infos).
  3. Copy the AssetBundle you've made in the previous part and paste it into your language's folder

Part 3: Using the newly added fonts in your language

  1. In your localyssationLanguage.json, change bundleName of the fontReplacement fields to your bundle name, and fontName fields to the fonts that you want to use.
  2. Open the game. If fonts disappear or go out of bounds, go back to your localyssationFontBundle.json file, reduce the sizeMultiplier of the faulty fonts, then restart the game