1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 7<TITLE>ROM Font - Introduction</TITLE> 8</HEAD> 9<BODY> 10<H1>ROM Font - Introduction</H1> 11<P><a href="ansi0020.html">ANSI</a> <a href="font0020.html">0020</a> <a href="font8140.html"> 8140</a> <a href="font8340.html"> 8340</a> <a href="font8540.html"> 8540</a> <a href="font8740.html"> 8740</a> <a href="font8940.html"> 8940</a> <a href="font8b40.html"> 8b40</a> <a href="font8d40.html"> 8d40</a> <a href="font8f40.html"> 8f40</a> <a href="font8f40.html"> 9140</a> <a href="font9340.html"> 9340</a> <a href="font9540.html"> 9540</a> <a href="font9740.html"> 9740</a></P> 12<H2>Introduction</H2> 13<P>The Revolution system comes with European and Kanji ROM fonts that are compatible with GameCube.</P> 14<P>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 <a href="ansi0020.html">here</a> to see the character images that are included.</P> 15<P>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 <a href="font0020.html">here</a> or click the character hex codes at the top of this page to see the character images that are included.</P> 16 17<P><STRONG>Note: </STRONG><font color="red">This font is currently used on a provisional basis. It may not be allowed on the product version. </font>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. </p> 18 19<P><strong>Note:</strong>The Japanese ROM font does not include JIS level 2 Kanji.</P> 20<H2>Using ROM Fonts</H2> 21<P>The ROM font type that can be used with the Revolution system can be checked with the <code><a href="OSGetFontEncode.html">OSGetFontEncode</a></code> function.</P> 22<P>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.</P> 23<H3>I2 Format</H3> 24<P>To expand the Nintendo Revolution ROM font in I2 format, call the <a href="OSLoadFont.html"><code>OSLoadFont</code></a> function. Although an expanded font image in I2 format cannot be used as texture image data that is passed to the <CODE><A href="../../gx/Structures/GXTexObj.html">GXTexObj</A></CODE> structure, the <A href="OSGetFontTexel.html"><CODE>OSGetFontTexel</CODE></A> function can be called to expand the character font image to the specified location of a passed I4 format texture image.</P> 25<H3>I4 Format</H3> 26<P>To expand the font into I4 format in main memory, call the <a href="OSInitFont.html"><code>OSInitFont</code></a> 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 <CODE><A href="../../gx/Structures/GXTexObj.html">GXTexObj</A></CODE>. Calling the <a href="OSGetFontTexture.html"><code>OSGetFontTexture</code></a> function obtains a pointer to the sheet and the location of the font in that sheet for a specified character. </P> 27<P><strong>Note:</strong>The buffers specified for the <a href="OSLoadFont.html"><code>OSLoadFont</code></a> and <a href="OSInitFont.html"><code>OSInitFont</code></a> functions must be 32-byte aligned.</P> 28<H3>Character Width</H3> 29<P>The Revolution ROM font is variable pitch (proportional) font. The <a href="OSGetFontTexel.html"><code>OSGetFontTexel</code></a>, <a href="OSGetFontTexture.html"><code>OSGetFontTexture</code></a>, or <code><a href="OSGetFontWidth.html">OSGetFontWidth</a></code> functions return the width of the specified character in texels.</P> 30<P><strong>Note:</strong>ASCII text characters in Japanese ROM font are fixed pitch. Please use full-width text characters for proportional pitch font.</P> 31<H3><code>OSFontHeader</code> Structure</H3> 32<P>The <code>OSFontHeader</code> structure is expanded at the front of the buffer that is specified as the first argument of the <a href="OSLoadFont.html"><code>OSLoadFont</code></a> and <a href="OSInitFont.html"><code>OSInitFont</code></a> function. Some members are used only by the operating system, but an application program can reference the following structure members.</P> 33<TABLE border="1" cellpadding="3" cellspacing="0"> 34 <TBODY> 35 <TR> 36<TD bgcolor="#C0C0C0"><STRONG>Member</STRONG></TD> 37<TD bgcolor="#C0C0C0"><STRONG>Description</STRONG></TD> 38<TD bgcolor="#C0C0C0"><STRONG>Value</STRONG></TD> 39 </TR> 40 <TR> 41<TD><CODE>ascent</CODE></TD> 42<TD>The character ascent (texels above the base line).</TD> 43 <TD><CODE>24</CODE></TD> 44 </TR> 45 <TR> 46<TD><CODE>descent</CODE></TD> 47<TD>The character descent (texels below the base line).</TD> 48 <TD><CODE>0</CODE></TD> 49 </TR> 50 <TR> 51<TD><CODE>leading</CODE></TD> 52<TD>The leading or spacing between lines.</TD> 53 <TD><CODE>28</CODE></TD> 54 </TR> 55 <TR> 56<TD><CODE>width</CODE></TD> 57<TD>The number of texels in the widest text character.</TD> 58 <TD><CODE>24</CODE></TD> 59 </TR> 60 <TR> 61<TD><CODE>sheetWidth</CODE></TD> 62<TD>The width of the texture image sheet.</TD> 63 <TD><CODE>512</CODE></TD> 64 </TR> 65 <TR> 66<TD><CODE>sheetHeight</CODE></TD> 67<TD>The height of the texture image sheet.</TD> 68 <TD><CODE>512</CODE></TD> 69 </TR> 70 <TR> 71<TD><CODE>cellWidth</CODE></TD> 72<TD>The cell (a single text character) width within a sheet.</TD> 73 <TD><CODE>24</CODE></TD> 74 </TR> 75 <TR> 76<TD><CODE>cellHeight</CODE></TD> 77<TD>The cell (a single character) height within a sheet.</TD> 78 <TD><CODE>24</CODE></TD> 79 </TR> 80 </TBODY> 81</TABLE> 82<H2>See Also</H2> 83<TABLE border="1" cellpadding="3" cellspacing="0"> 84 <TBODY> 85 <TR> 86<TD bgcolor="#C0C0C0"><STRONG>File</STRONG></TD> 87<TD bgcolor="#C0C0C0"><STRONG>Description</STRONG></TD> 88 </TR> 89 <TR> 90<TD><CODE>libraries/demo/src/DEMOPuts.c</CODE></TD> 91<TD>Includes implementations of the utility functions (for example, <code>DEMOInitROMFont</code>, <code>DEMOSetROMFontSize</code>, <code>DEMORFPrintf</code>) for displaying the ROM font using GX functions.</TD> 92 </TR> 93 <TR> 94<TD><CODE>osdemo/src/fontdemo1.c</CODE></TD> 95<TD>Illustrates how to use the <a href="OSInitFont.html"><code>OSInitFont</code></a> and <a href="OSGetFontTexture.html"><code>OSGetFontTexture</code></a> functions.</TD> 96 </TR> 97 <TR> 98<TD><CODE>osdemo/src/fontdemo2.c</CODE></TD> 99<TD>Illustrates how to use the <a href="OSLoadFont.html"><code>OSLoadFont</code></a> and <a href="OSGetFontTexel.html"><code>OSGetFontTexel</code></a> functions.</TD> 100 </TR> 101 </TBODY> 102</TABLE> 103<H2>Revision History</H2> 104<P>03/01/2006 Initial version.</P> 105</BODY> 106<br> 107</HTML>