RENPY 中文替換字體的解決辦法,解決生僻字框框

 

官方的說明文件講的很含糊,仔細看下官方文檔來說的是替換編輯器的字體文件,而你如果要替換遊戲工程的字符,你就要進入到\\[project name]\game 目錄下 編輯gui.rpy ,替換註釋原先fonts代碼

## 用於遊戲內文本的字體。
#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"

 

然後將字體文件放入到E:\RENPY\project SG\game

 

哎,希望對別人有幫助吧,網上的教程實在太少了,整天要翻牆去找。

字體下載鏈接不公開了,請大家自己去找

---------------------

Changing Fonts

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.

Changing the Launcher Style

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章