设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 74|回复: 0

[制作教程] Distributing RPG Maker XP games with custom fonts

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4472

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22951
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28317

    灌水之王

    发表于 7 天前 | 显示全部楼层 |阅读模式

    Distributing RPG Maker XP games with custom fonts



    Installing fonts is such a bother and requires admin privileges, so let us not do that





            When developing our games it is very possible we want to use another font. This information is already present elsewhere, but as a quick reminder it can look like this.


    Font.default_name = "Roboto"
    Font.default_name = ["Roboto", "Arial"] # Fall back to Arial if Roboto does not exist


            What happens if Roboto does not exists?


    • No fallback - No text is drawn
    • Fallback - Text drawn in Arial instead.



            Neither case is acceptable if we really want Roboto to be the font used.


            Luckily we can use the AddFontResource function from GDI32.dll to load font resources. Unfortunately, in RMXP we cannot use fonts loaded through that call until the game is started anew. Should we load fonts in one game, and then run another game, that other game can use the fonts resources. I have encapsulated this functionality into a tool.


            Note: AddFontResource requires the font to exist on the file system. I.e. it cannot load fonts from encrypted archives.


    Tool


            Download: http://www.mediafire.com/file/6l9s59bef58eadx/Font+Launcher.zip


            Demo: http://www.mediafire.com/file/j6dkhqkpa4yyllr/Demo.zip


            Once you unpack the zip file you will see the following elements:







            Copy those files into your own game directory.







            Copy the fonts you want into the Fonts folder, and use Launcher.exe. That's it.


            Note: I have included the RGSS104E.dll just for good measure, just in case you use another DLL version. Feel free to change the Launcher.ini file if you prefer to another version.



            Have renamed your Game.exe files? Edit the Launcher.ini file:

                    Code:        
    [Game] Library=RGSS104E.dll Scripts=Data\Scripts.rxdata Title=Launcher  [Launcher] Game=Game


            Say the name is "Hello Steven.exe" then change the Launcher.ini file to be:

                    Code:        
    [Game] Library=RGSS104E.dll Scripts=Data\Scripts.rxdata Title=Launcher  [Launcher] Game=Hello Steven






    Read priority


            As you sure have noticed. We have an encrypted archive called Launcher.rgssad. To explain why this is important because encrypted archives have higher read priority than file system files. I don't mind showing the code: http://pastebin.com/8aw6CFcY


            The name of the executable have functional meaning. Let us look at the sample game directory again:







            Note we have two executables here.


    • Game.exe
    • Launcher.exe



            In our example both Game.ini and Launcher.ini has Scripts=Data\Scripts.rxdata, yet they do not load the same Scripts.rxdata


            The RGSS Player executable looks first for a Configuration settings file with the same name as itself and ending with .ini, next it looks for an RGSS Encrypted Archive file with the same name as itself and ending with .rgssad.


            In other words you can say


    • Launcher.exe is associated with Launcher.ini and Launcher.rgssad
    • Game.exe is associated with Game.ini



            Next it tries to load the resource located at Data\Scripts.rxdata. If it has an encrypted archive associated it searched that before the file system. So we end up with this loading sequence.







            You can also encrypt the game just fine. Then you'll Game.exe try to load resources from Game.rgssad before the file system.


    License

    SpoilerCopyright (c) 2016 Zeriab


                            This software is provided 'as-is', without any express or implied
                            warranty. In no event will the authors be held liable for any damages
                            arising from the use of this software.
                             
                            Permission is granted to anyone to use this software for any purpose,
                            including commercial applications, and to alter it and redistribute it
                            freely, subject to the following restrictions:


                            1. The origin of this software must not be misrepresented; you must not
                               claim that you wrote the original software. If you use this software
                               in a product, an acknowledgement in the product documentation would be
                               appreciated but is not required.
                            2. Altered source versions must be plainly marked as such, and must not be
                               misrepresented as being the original software.
                            3. This notice may not be removed or altered from any source distribution.






    Final notes


            Wachunga has made a script which tries to actually install the fonts: https://github.com/wachunga/rmxp-auto-font-install


            That script requires administrative privileges, actually install the fonts and cause changes to registration database.


            Using my tool does not install anything and it requires no administrative privileges. On the downside it does runs two executables.


            Let me extend some thanks to Laura Shigihara. She is using a custom font for her upcoming game, Rakuen, and her request for help eventually turned into the tool and this topic.


            Thank you for reading my tutorial.


            Any comments are appreciated.


            Additional data about whether it works for your or not is appreciated.


            *hugs*


             - Zeriab


    本贴来自国际rpgmaker官方论坛作者:Zeriab处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/distributing-rpg-maker-xp-games-with-custom-fonts.70656/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 18:04 , Processed in 0.087647 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表