ROM Font - Introduction

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

Introduction

The Revolution system comes with European and Kanji ROM fonts that are compatible with 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 Revolution systems. Click here to see the character images that are included.

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

Note: This font is currently used on a provisional basis. It may not be allowed on the product version. For the product version of Revolution, we plan to prepare a new font set that uses the internal flash memory. A new font library for accessing this font will be prepared in future SDKs.

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

Using ROM Fonts

The ROM font type that can be used with the Revolution system can be checked with the OSGetFontEncode function.

The ROM font is compressed and kept in the Revolution ROM/RTC. The ROM font must be expanded in the main memory before use. The expanded font image can be I2 (4 intensity levels) or I4 (16 intensity levels) format.

I2 Format

To expand the Nintendo Revolution ROM font in I2 format, call the OSLoadFont function. Although an expanded font image in I2 format cannot be used as texture image data that is passed to the GXTexObj structure, the OSGetFontTexel function can be called to expand the character font image to the specified location of a passed I4 format texture image.

I4 Format

To expand the font into I4 format in main memory, call the OSInitFont function. The font image data is expanded into multiple texture image data (called sheets) of the same size. ANSI font consists of one texture image sheet, and kanji font consists of nine texture image sheets. The texture image sheet can be used without modification as the texture image data for the GXTexObj. Calling the OSGetFontTexture function obtains a pointer to the sheet and the location of the font in that sheet for a specified character.

Note:The buffers specified for the OSLoadFont and OSInitFont functions must be 32-byte aligned.

Character Width

The Revolution ROM font is variable pitch (proportional) font. The OSGetFontTexel, OSGetFontTexture, or OSGetFontWidth functions return the width of the specified character in texels.

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

OSFontHeader Structure

The OSFontHeader structure is expanded at the front of the buffer that is specified as the first argument of the OSLoadFont and OSInitFont function. Some members are used only by the operating system, but an application program can reference the following structure members.

Member Description Value
ascent The character ascent (texels above the base line). 24
descent The character descent (texels below the base line). 0
leading The leading or spacing between lines. 28
width The number of texels in the widest text character. 24
sheetWidth The width of the texture image sheet. 512
sheetHeight The 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

See Also

File Description
libraries/demo/src/DEMOPuts.c Includes implementations of the utility functions (for example, DEMOInitROMFont, DEMOSetROMFontSize, DEMORFPrintf) for displaying the ROM font using GX functions.
osdemo/src/fontdemo1.c Illustrates how to use the OSInitFont and OSGetFontTexture functions.
osdemo/src/fontdemo2.c Illustrates how to use the OSLoadFont and OSGetFontTexel functions.

Revision History

03/01/2006 Initial version.