-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bfn file of Twilight Princess #2
Comments
Can you send an example? |
How can I use these scripts? |
Our goal is to port the Chinese font and text of Twilight Princess Nvidia Shield Version to the GameCube/Wii U version (currently we chose the Japanese version since a fan-translated version is also based on it). |
I pushed a small fix to bfn.py due to an array size error, but otherwise all of the examples work fine. I also added some information which might be interesting to you: the field I called |
Copy the Nvidia Shield font and text to the Japanese/English game will result in disorder codes. If anyone can hack the game and make it read UTF-16, it will resolve everything. As far as I know, only the Korean Wii version and the Nvidia Shield version supports UTF-16, but those two versions have their own defects. So hacking the Japanese font file is the only choice left for link8023, unless another hacker is willing for help. |
Here's a version of the font from NVIDIA Shield version, modified to use Shift_JIS-2004: nvidia shield shift jis.zip. That means that a number of characters, that don't exist in Shift_JIS-2004, are not included. Here's the code I used to make it: fin = open("Nvidia Shield.bfn", 'rb')
bfn = BFont()
bfn.read(fin)
fin.close()
newSpans = []
for charCode, glyph in zip(bfn.map1.spans[::2], bfn.map1.spans[1::2]):
ch = chr(charCode)
try:
enc = ch.encode('shift_jis_2004')
except UnicodeEncodeError:
continue
newCode, = struct.unpack('>H', enc)
newSpans.append((newCode, glyph))
newSpans.sort(key=lambda a: a[0])
newSpans = [n for p in newSpans for n in p]
bfn.map1.spans = array.array('H')
bfn.map1.spans.fromlist(newSpans)
bfn.inf1.fontType = 2
bfn.write(open('nvidia shield shift-jis.bfn', 'wb')) I think it would be much better to figure out why UTF-16 fonts don't work in the Japanese and English versions, so that you can use all of the available characters. From my reading of the Super Mario Sunshine code, it should work there. The function pointer for |
Can you give me your email for further coorperation? |
My contact information is on my website. I can't help you with patching Twilight Princess. |
Can you ask the commands used by bfn's py script
The text was updated successfully, but these errors were encountered: