Say Bye-Bye to the "Missing Characters" (Tofu ☒) in your Ren'Py games.
RedPanda RenPatch (RPRP) is a surgical font optimization tool. It scans your scripts, finds characters your primary fonts can't handle, and generates a lightweight "patch" font along with ready-to-use .rpy scripts.
Deliver perfect CJK (Chinese, Japanese, Korean) support without bundling massive, multi-megabyte font files in your package.
RedPanda RenPatch(RPRP) 是一个为 Ren'Py 引擎设计的字体修复工具,以解决独立游戏开发中的☒缺字问题。RenPatch可以自动扫描游戏脚本文件、对比字库索引来准提取缺失字符,生成体积极小的补丁字库及配套集成的.rpy脚本,供开发者进行字体校准和优化。分发的游戏包无需内置臃肿的完整版字体,即可实现更好的跨语言文字显示。
Current Version: v0.2 Core Logic / Mannual Mode
v1.0 GUI App In Development
- App & UI Structure Updated
- Patch Wizard Mode: Drop in with your scripts and I will take over from there.
- (In Future Version) Developer Workbench Mode: Access more advanced features, including Font Subsetting Tool, Donor Font Caliberation, Localization Caliberation, and more.
- Scan: RenPatch reads your game directory to find all characters used in your game and localization
.rpyscripts. - Compare: It checks your "Primary Lite Font" to see what's missing.
- Patch: It extracts only the missing glyphs from a "Donor Font" and make a
patch.ttf. It also generates a patch report for developers who wants to config mannually. - Integrate: It generates a drop-in
font_patch.rpyscript with explicitFontGroupmapping for your Ren'Py prioritizes the patch for problematic characters.
Currently requires Python installed. (GUI App coming soon!)
- Place your game project in a directory.
- Prepare your primary lite font (e.g.,
SourceHanSansLite.ttf) font. you have your "Lite" font (e.g.,SourceHanSansLite.ttf). - Run the pipeline in
core.py:# 1. Scans scripts # 2. Compares fonts # 3. Generates patch.ttf and reports # 4. Generates renpatch_init.rpy
- Drop
patch.ttfandrenpatch_init.rpyinto yourgame/folder. Or configrenpatch_init.rpymannually in youroptions.rpy. - Update your
gui.rpyand localization scripts to userenpatch_stylefont group.
- Accelerated scanning pipeline. More robust regex scanner for triple-quoted multi-line strings and other escaped quotes; more efficient filtering to strip Ren'Py tags (
{size=30}), interpolation variables ([player_name]), and file paths to prevent ghost chars. - Better Logging. Generates JSON reports on missing characters and a detailed Ren'Py integration script with Hex/Unicode comments. Ready for future features in Developer Workbench Mode.
- Basic script scanning and font subsetting using
fontTools. - Manual patching logic.
- License: MIT License
- Libraries Used:
Copyright (c) 2025 Mochiredpanda / Jiyu He