Common nn::ui2d

nn::font and nn::ui2d share similar file structures. Some are used in nn::font Bffnt as well as nn::ui2d Bflyt and Bflan. This style of file may be a holdover from the 32-bit era, as newer ui2d formats like Bnvg have an nn::util style.

Header

The base struct of an nn::ui2d style file.

Offset Size Type Description
0x0 0x4 u32 Magic (dependent on file type)
0x4 0x2 u16 Endianess (0xfffe in big-endian)
0x6 0x2 u16 Header size
0x8 0x2 u16 Micro version
0xa 0x1 u8 Minor version
0xb 0x1 u8 Major version
0xc 0x4 u32 File size
0x10 0x2 u16 Section count
0x12 0x2 u16 Reserved

Section

The base struct of a sub section in an nn::ui2d style file.

Offset Size Type Description
0x0 0x4 u32 Magic (dependent on file type)
0x4 0x4 u32 Section size

User Data

Typically only found in Bflyt and Bflan.

Section

Offset Size Type Description
0x0 0x8 Ui2dSection Ui2d Section
0x8 0x2 u16 User data count
0xa 0x2 u16 Reserved

User Data Entry

Array immediately follows User Data Section header.

Offset Size Type Description
0x0 0x4 u32 Name offset (relative to this entry)
0x4 0x4 u32 Data array offset (relative to this entry)
0x8 0x2 u16 Data count
0xa 0x1 u8 Data type
0xb 0x1 u8 Reserved

User Data Type

Name (unofficial) Value Description
String 0x0
S32 0x1
Float 0x2
SystemData 0x3 Unknown