
Tanuki Atlyss FontAssetsManager
Plugin for Atlyss that customizes in-game fonts. Use custom fonts, replace existing ones, add fallbacks, and prevent missing characters from being displayed.Details
Tanuki.Atlyss.FontAssetsManager
Plugin for Atlyss that customizes in-game fonts. Use custom fonts, replace existing ones, add fallbacks, and prevent missing characters from being displayed.
Features
- Replace unknown characters with codes.
- Add fallback fonts.
- Added default fallback set of Noto Sans fonts for Cyrillic, Arabic, Japanese, Traditional Chinese and Korean characters.
- Replace fonts.
- Configure replacement and fallback rules using regular expressions.
Configuration
Plugin configuration
BepInEx/config/9c00d52e-10b8-413f-9ee4-bfde81762442.cfg
Plugin command configuration
BepInEx/config/Tanuki.Atlyss.FontAssetsManager/{Language}.commands.json
Plugin translation file
BepInEx/config/Tanuki.Atlyss.FontAssetsManager/{Language}.translations.json
Font fallback rules
Path
BepInEx/config/Tanuki.Atlyss.FontAssetsManager/Fallbacks/*.json
Rules from different files can be combined and override or supplement each other. They are read by the plugin in alphabetical order.
Example fallbacks file 100.json.
[
{
"Rule":
{
"Object": ".*",
"Font": ".*"
},
"Fixed": false,
"Assets":
[
{
"Bundle": "tanuki.atlyss.fontassetsmanager.assets.noto_sans",
"Object": "SDF"
},
{
"Bundle": "tanuki.atlyss.fontassetsmanager.assets.noto_sans_arabic",
"Object": "SDF"
}
]
},
{
"Rule":
{
"Object": ".*",
"Font": ".*"
},
"Fixed": false,
"Assets":
[
{
"Bundle": "tanuki.atlyss.fontassetsmanager.assets.noto_sans_japanese",
"Object": "SDF"
}
]
}
]
Its rules are read from top to bottom and will take precedence over the rules in the 99.json file, but may be overridden or supplemented by the rules in the 101.json file.
The Rule property contains regular expressions for Text (Unity) or TMP_Text (TextMeshPro) object, Font is the name of its current font.
The Fixed property specifies how the plugin will handle other rules for the same regular expression. If set to true, the list of fallback assets will be static, meaning it can't be supplemented with other rules, but it can be overriden.
The Assets property contains a list of fallback assets for the specified regular expression. Each asset refers to a specific asset bundle and the name of the object within it.
Fallbacks are only supported by TMP_Text objects.
Replacement rules
Path
BepInEx/config/Tanuki.Atlyss.FontAssetsManager/Replacements/*.json
Font replacement rules work similarly to fallback rules.
Replacement rules can only contain one rule at a time with a unique regular expression for objects of type Text and TMP_Text.
This means that duplicate regular expressions will override previously read rules.
Example replacements file 100.json.
[
{
"Asset":
{
"Bundle": "tanuki.atlyss.fontassetsmanager.assets.noto_sans",
"Object": "Font"
},
"Rule":
{
"Object": ".*",
"Font": ".*"
}
},
{
"Asset":
{
"Bundle": "tanuki.atlyss.fontassetsmanager.assets.noto_sans",
"Object": "SDF"
},
"Rule":
{
"Object": ".*",
"Font": ".*"
}
}
]
This example shows two rules with identical regular expressions, as one of them is intended for Text and the other for TMP_Text.
Asset bundles
Path
BepInEx/plugins/*/Tanuki.Atlyss.FontAssetsManager.AssetBundles/*/*.assetbundle
Assets must be of type Font (for Text objects) or TMP Font Asset (for TextMeshPro objects) and have unique names in the asset bundle.
Instructions for creating an asset bundle:
- Install Unity (the same version as the game is recommended).
- Create an empty project (3D Built-In Render Pipeline).
- Import the example package.
- Create a dirrectory for asset bundle files in your project and add a label to it.
- Place the file with your font in the directory.
- Use the
Unicode List Extractortool (Tools > Fonts) to create a file with the characters supported by the font. - Select a font and create a
TMP Font Assetfor it.- Set
Character SettoCharacters from Fileand select the previously created.txtfile with characters. - Adjust the other settings to suit your font.
- Set
- Once the asset has been created, delete file with characters.
- Export all asset bundles using the
Buildtool (Tools > AssetBundles). - After the build, an
Output/AssetBundlesdirectory will be created with all asset bundles. Select the file corresponding to the label name you specified earlier, add the.assetbundleextension to it, then move it to the plugin's asset bundle directory. - Now you can use the label of your asset bundle and the names of its items in the rules.
Getting started
Thunderstore
This mod on Thunderstore.
It's recommended to use it together with the EasySettings mod for easier configuration directly in the game.
Manual installation
- Install BepInEx. It's recommended to use the preconfigured package.
- Install the Tanuki.Atlyss framework.
- Install the Tanuki.Atlyss.FontAssetsManager files.