当前位置 博文首页 > LY的博客:RENPY 中文替换字体的解决办法,解决生僻字框框
## 用于游戏内文本的字体。
#define gui.text_font = "SourceHanSans-Light-Lite.ttf"
define gui.text_font ="SourceHanSerifCN-Regular.otf"
## 用于角色名称的字体。
#define gui.name_text_font = "SourceHanSans-Light-Lite.ttf"
define gui.name_text_font ="SourceHanSerifCN-Regular.otf"
?
?
哎,希望对别人有帮助吧,网上的教程实在太少了,整天要翻墙去找。
字体下载链接不公开了,请大家自己去找
---------------------
Ren'Py ships with a default font (DejaVuSans) that covers most western languages, but other fonts are often needed. A font can be configured by editing launcher/game/tl/language/style.rpy, and adding:
init python:
translate_font("language", "myfont.ttf")
Where "language" is the language in question (for example, "japanese"), and "myfont.ttf" is the font that should be used (for example, "MTLc3m.ttf"). The font file should be placed in the launcher/game/tl/language directory, so it can be found by the launcher.
The styles used by the launcher can be configured by setting variables in a?translate?python
?block. The following variables are available. The names are a bit confusing, as they reflect the English-language translation.
These variables are only available in the launcher.
define?gui.LIGHT_FONT
?= "Roboto-Light.ttf"
The path to the font used for normal text in the launcher.
define?gui.REGULAR_FONT
?= "Roboto-Regular.ttf"
The path to the font used for heavy-weight text in the launcher.
define?gui.REGULAR_BOLD
?= False
If True, heavy-weight text is bolded.
define?gui.FONT_SCALE
?= 1.0
A scaling factor that is applied to all text in the launcher.
cs