ScanMountGoat / xc3_lib

Xenoblade Chronicles file format and rendering libraries
MIT License
11 stars 3 forks source link

LAFT (.wifnt) read/write #37

Closed roccodev closed 1 week ago

roccodev commented 2 weeks ago

This PR adds support for reading and writing LAFT files (.wifnt extension).

I've added a few tests to xc3_test and support for extracting Mibl textures to xc3_tex (so I believe this should close #36).

Additionally, you can use xeno-layer on the laft-from-xc3lib branch to test this version. Here's an example command (the codepoints/xc3.txt file is included):

xeno-ttf --codes codepoints/xc3.txt -o standard.wifnt path/to/source.ttf

I had to make some changes to xc3_write as well, for example I've added #[xc3(offset_size(_, _)] to save the total size of the Mibl struct. I also had to use a custom reader because Mibl uses SeekFrom::End.

If you need a reference for the file format without the abstractions, you can check the original wifnt.rs from the master branch.

ScanMountGoat commented 1 week ago

This may need to get reworked later. I'll go ahead and merge what you have for now to allow people to extract the font textures and start documenting the format.