CheatMaker 论坛

注册

 

发新话题 回复该主题

[Citra]生成shared_font.bin [复制链接]

1#
shared_font.bin - 共享字库,某些汉化游戏使用的是系统字库,日区环境下需要指向外接中文字符集;当然可以直接选择中文区域则不需要shared_font.bin,但是某些游戏DLC在中文区域不可用。
Blader在https://forum.cheatmaker.org/showtopic-2657.aspx分享过shared fonts,也说过shared_font.bin在此时便不必要;
后续官方也开始使用开源字库,这时候绝对大多游戏都不会有文字缺失问题。

汉化游戏用到系统字库的不少,但可供普通玩家选择的shared_font.bin文件却很少;在我玩第七龙神VFD的时候,发现模拟器没有ACG的0号字库可用,看着缺字(不在中文字符集的汉字)难受的玩,就想着自己琢磨着弄0号字库的shared_font.bin,
最终在贴吧的一篇文章看到了“生成Citra共享字库shared_font.bin”相关信息,地址:https://tieba.baidu.com/p/6385644832

首先要有.bcfnt文件,获得方式参考https://github.com/dnasdw/SharedFontToolhttps://forum.cheatmaker.org/showtopic-3204.aspx
然后是shared_font.bin文件头和规范,https://github.com/citra-emu/cit ... service/apt/apt.cpp
  1.     struct {
  2.         u32_le status;
  3.         u32_le region;
  4.         u32_le decompressed_size;
  5.         INSERT_PADDING_WORDS(0x1D);
  6.     } shared_font_header{};
  7.     static_assert(sizeof(shared_font_header) == 0x80, "shared_font_header has incorrect size");

  8.     shared_font_header.status = 2; // successfully loaded
  9.     shared_font_header.region = font_region_code;
  10.     shared_font_header.decompressed_size =
  11.         DecompressLZ11(font_file.Data(), shared_font_mem->GetPointer(0x80));
  12.     std::memcpy(shared_font_mem->GetPointer(), &shared_font_header, sizeof(shared_font_header));
  13.     *shared_font_mem->GetPointer(0x83) = 'U'; // Change the magic from "CFNT" to "CFNU"
复制代码

用HxD打开.bcfnt文件,在文件头部添加80个字节的“shared_font_header”
  1. 02 00 00 00 01 00 00 00 8C D2 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
复制代码
第83个字节54改成55,GetPointer(0x83) = 'U'
最后另存为“shared_font.bin”,这样一个共享字库就完成了。

自制字库演示图:
最后编辑yggdra 最后编辑于 2020-09-23 21:18:16
分享 转发
TOP
2#

太專業了, 這個必須有
TOP
3#

真速度!!!!!
TOP
发新话题 回复该主题