Small Python tools for preparing CJK text support for Enclave.
| Tool | Purpose |
|---|---|
build_font_full.py |
Builds a larger Clairvaux.xfc font texture. |
dlg_to_stringtable.py |
Moves dialogue text into StringTable_Eng.txt. |
Note
Generated files are written to workspace/output. Original files in
workspace/src are not modified.
- Requirements
- Folder setup
- 1. Build the font
- 2. Convert dialogue text
- Installing the output
- Troubleshooting
- Python 3.9 or newer
- Pillow
Install Pillow once:
python -m pip install PillowRun all commands from the folder containing the scripts.
Copy the original game files into workspace/src:
Show the expected folder structure
workspace/
|- charset.txt
|- Font.ttf
`- src/
|- Dialogues/*.xrg
|- fonts/Clairvaux.xfc
`- registry/StringTable_Eng.txt
charset.txt contains the characters to add to the font. The font script reads
workspace/Font.ttf; keep this filename unless you edit the script.
Important
Back up the original game files before installing generated files.
Run:
python .\build_font_full.pyThe script:
- Reads the original
Clairvaux.xfc. - Adds characters from
workspace/charset.txtusingworkspace/Font.ttf. - Generates a 2048x2048 font texture and mipmaps.
- Writes the result to
workspace/output/Fonts/Clairvaux.xfc.
It also creates a preview image:
workspace/output/_preview/Clairvaux_2048.png
Check the preview before using the generated font in the game.
Run:
python .\dlg_to_stringtable.pyThe script scans all UTF-16LE dialogue files matching:
workspace/src/Dialogues/*.xrg
For each non-empty *TEXT "..." line, it creates a string key using the
section-sign-plus-L prefix. Example:
\u00A7LDLG_DLG_VATAR_000
The dialogue line is changed to use that key, and the original text is added to:
workspace/output/registry/StringTable_Eng.txt
Converted dialogue files are written to:
workspace/output/Dialogues/
Tip
Lines that already contain a key with the same prefix are skipped, so the converter can be run again safely.
After checking the generated files, copy them into the matching SBZ1 folders:
| Generated file | Game location |
|---|---|
output/Fonts/Clairvaux.xfc |
SBZ1/Fonts/Clairvaux.xfc |
output/Dialogues/*.xrg |
SBZ1/Dialogues/ |
output/registry/StringTable_Eng.txt |
SBZ1/registry/StringTable_Eng.txt |
Warning
Do not delete the original files. Restore the backup if the game does not start or text is displayed incorrectly.
Common problems
| Problem | Solution |
|---|---|
Missing Clairvaux.xfc |
Place it in workspace/src/fonts/. |
Missing charset.txt |
Place it directly in workspace/. |
Missing Font.ttf |
Place it directly in workspace/. |
| No dialogue files found | Place .xrg files in workspace/src/Dialogues/. |
| StringTable encoding error | Save the file as UTF-16LE with a BOM. |