ROM Font

ANSI 0020 8140 8340 8540 8740 8940 8b40 8d40 8f40 9140 9340 9540 9740

Introduction

The Wii console comes with European and Kanji ROM fonts that are compatible with the Nintendo GameCube.

The Western language ROM font is based on the ANSI (Windows Latin 1) character set. The European ROM font can be used with US, European, and other non-Japanese Wii consoles. To see the included character images, click here.

The Japanese ROM font is based on the Shift-JIS (Japan Industry Standard) character set. The actual character images installed include those for ASCII characters (0x20 - 0x7f), half-width kana characters (0xa0 - 0xdf), and double-byte characters from 0x8140 through 0x9872, incorporating the JIS Level 1 Kanji (0x889f - 0x9872). Kanji ROM fonts can be used on Japanese Wii consoles. Click here or click the character hex codes at the top of this page to see the character images that are included.

Note: The Kanji ROM font does not include JIS level 2 Kanji.

Using ROM Fonts

The ROM font types that can be used on a Wii console can be checked with the OSGetFontEncode function.

ROM fonts are compressed and kept in the Wii ROM / RTC. ROM fonts must be expanded in the main memory before use. The fonts can be stored as I2 (4 intensity levels) or I4 (16 intensity levels) format in main memory.

I2 Format

To expand fonts to main memory in I2 format, call the OSLoadFont function. Although the GXTexObj structure does not accept the I2 format as texture image data, the OSGetFontTexel function can be called to expand specified character font images to any location in a given I4-formatted texture image.

I4 Format

To expand fonts to main memory in I4 format, call the OSInitFont function. Image data is divided into multiple texture images (sheets) having the same size when expanded. The ANSI font consists of a single texture image sheet. The Kanji font consists of nine texture image sheets. A texture image sheet can be used as-is as the texture image data stored in the structure GXTexObj. The OSGetFontTexture function returns the pointer to the sheet that includes the specified character and the character position inside the sheet.

Note: The buffer addresses passed to the OSLoadFont and OSInitFont functions must be 32-byte aligned.

Character Width

The Wii ROM fonts are variable pitch (proportional) fonts. The width of each font (in number of texels) can be obtained using the OSGetFontTexel, OSGetFontTexture, or OSGetFontWidth function.

Note: ASCII text characters in Japanese ROM font are fixed pitch. Please use full-width text characters for proportional pitch font.

OSFontHeader structure

Both OSLoadFont and  OSInitFont expand the OSFontHeader structure at the head of the specified font data buffer. Some members of this structure are used only in the OS library, but the following members can be referenced from an application program.

Members Description Value
ascent The character ascent (texels above the base line). 24
descent The character descent (texels below the base line). 0
leading The spacing between lines (leading). 28
width The number of texels in the widest text character. 24
sheet Width Width of the texture image sheet. 512
sheetHeight Height of the texture image sheet. 512
cellWidth The cell (a single text character) width within a sheet. 24
cellHeight The cell (a single character) height within a sheet. 24

Reference

File Description
libraries/demo/src/DEMOPuts.c Contains implementations of utility functions such as DEMOInitROMFont, DEMOSetROMFontSize, and DEMORFPrintf, which actually display ROM fonts using GX functions.
osdemo/src/fontdemo1.c Illustrates the use of OSInitFont and OSGetFontTexture.
osdemo/src/fontdemo2.c Illustrates the use of the OSLoadFont and OSGetFontTexel functions.

Revision History

2006/03/01 Initial version.


CONFIDENTIAL