BCFNT

BCFNT

CTR Font Format #

.bcfnt files are bitmap fonts made for the 3ds. The system font uses this format too except the header is changed from CFNT to CFNU and all file offsets are changed to absolute in memory offsets.

CFNT Header #

OffsetSizeDescription
0x000x04Magic Header (either CFNT or CFNU or FFNT)
0x040x02Endianness (0xFEFF = little, 0xFFFE = big)
0x060x02Header Size
0x080x04Version (observed to be 0x03000000)
0x0C0x04File size (the total)
0x100x04Number of “blocks” to read

FINF Header #

Version 3 (BCFNT) #

OffsetSizeDescription
0x000x04Magic Header (FINF)
0x040x04Section Size
0x080x01Font Type
0x090x01Line Feed
0x0A0x02Alter Char Index
0x0C0x03Default Width (3 bytes: Left, Glyph Width, Char Width)
0x0F0x01Encoding
0x100x04TGLP Offset
0x140x04CWDH Offset
0x180x04CMAP Offset
0x1C0x01Height
0x1D0x01Width
0x1E0x01Ascent
0x1F0x01Reserved

Version 4 (BFFNT) #

OffsetSizeDescription
0x000x04Magic Header (FINF)
0x040x04Section Size
0x080x01Font Type
0x090x01Height
0x0A0x01Width
0x0B0x01Ascent
0x0C0x02Line Feed
0x0E0x02Alter Char Index
0x100x03Default Width (3 bytes: Left, Glyph Width, Char Width)
0x130x01Encoding
0x140x04TGLP Offset
0x180x04CWDH Offset
0x1C0x04CMAP Offset

TGLP Header #

Version 3 (BCFNT) #

OffsetSizeDescription
0x000x04Magic Header (TGLP)
0x040x04Section Size
0x080x01Cell Width
0x090x01Cell Height
0x0A0x01Baseline Position
0x0B0x01Max Character Width
0x0C0x04Sheet Size
0x100x02Number of Sheets
0x120x02Sheet Image Format 0-13: (RGBA8, RGB8, RGBA5551, RGB565, RGBA4, LA8, HILO8, L8, A8, LA4, L4, A4, ETC1, ETC1A4)
0x140x02Number of columns
0x160x02Number of rows
0x180x02Sheet Width
0x1A0x02Sheet Height
0x1C0x04Sheet Data Offset

Version 4 (BFFNT) #

OffsetSizeDescription
0x000x04Magic Header (TGLP)
0x040x04Section Size
0x080x01Cell Width
0x090x01Cell Height
0x0A0x01Number of Sheets
0x0B0x01Max Character Width
0x0C0x04Sheet Size
0x100x02Baseline Position
0x120x02Sheet Image Format 0-13: (RGBA8, RGB8, RGBA5551, RGB565, RGBA4, LA8, HILO8, L8, A8, LA4, L4, A4, ETC1, ETC1A4)
0x140x02Number of Sheet columns
0x160x02Number of Sheet rows
0x180x02Sheet Width
0x1A0x02Sheet Height
0x1C0x04Sheet Data Offset

CMAP Header #

OffsetSizeDescription
0x000x04Magic Header (CMAP)
0x040x04Section Size
0x080x02Code Begin
0x0A0x02Code End
0x0C0x02Mapping Method (0 = Direct, 1 = Table, 2 = Scan)
0x0E0x02Reserved?
0x100x04Next CMAP Offset

Depending on the mapping method the next bytes are read like so:

Direct: IndexOffset = read uint16

Table: IndexTable = read uint16 array (CodeEnd - CodeBegin + 1)

Scan: Number of Scan Entries = read uint16 for every scan entry: read uint16 & read uint16

CWDH Header #

OffsetSizeDescription
0x000x04Magic Header (CWDH)
0x040x04Section Size
0x080x02Start Index
0x0A0x02End Index
0x0C0x04Next CWDH Offset
0x103 * (EndIndex - StartIndex + 1)Char Widths (3 bytes: Left, Glyph Width, Char Width)

Tools #

🔗 1 - BFFNT Extractor/Creator. Creates PNG files from TGLP atlas data and a JSON manifest.

Category:File formats