当前位置 博文首页 > LY的博客:RENPY 中文替换字体的解决办法,解决生僻字框框

    LY的博客:RENPY 中文替换字体的解决办法,解决生僻字框框

    作者:[db:作者] 时间:2021-08-02 12:44

    ?

    官方的说明文件讲的很含糊,仔细看下官方文档来说的是替换编辑器的字体文件,而你如果要替换游戏工程的字符,你就要进入到\\[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.

    cs
    下一篇:没有了