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 actually installed include those for ASCII characters (0x20 - 0x7f), half-space kana characters (0xa0 - 0xdf), JIS Level I Kanji (0x889f: 亜 - 0x9872: 腕), and double-byte characters from 0x8140 through 0x9872. 亜 - 0x9872: Two-byte characters from 0x8140 to 0x9872, including 腕. 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>The Kanji ROM font does not include JIS level 2 Kanji.</P> 18<H2>Using ROM Fonts</H2> 19<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> 20<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> 21<H3>I2 Format</H3> 22<P>To expand the Nintendo GameCube ROM font in I2 format, call the <a href="OSLoadFont.html"><code>OSLoadFont()</code></a> function. Although the <a href="../../gx/Structures/GXTexObj.html"><code>GXTexObj</code></a> structure does not accept I2 texture image data, the <a href="OSGetFontTexel.html"><code>OSGetFontTexel()</code></a> function expands the specified character font image into the specified I4 texture image data at the specified position.</P> 23<H3>I4 Format</H3> 24<P>To expand the Nintendo GameCube ROM font in I4 format, 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. Each sheet can be used as texture image data for the <a href="../../gx/Structures/GXTexObj.html"><code>GXTexObj</code></a> structure. 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>. The <a href="OSGetFontTexture.html"><code>OSGetFontTexture()</code></a> function returns the pointer to the sheet that includes the specified character and the character position inside the sheet.</P> 25<P><strong>Note:</strong>The buffer addresses passed to 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> 26<H3>Character Width</H3> 27<P>The Revolution ROM font is variable pitch (proportional) font. The width of each font can be obtained by 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> function, in number of texels.</P> 28<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> 29<H3><code>OSFontHeader</code> structure</H3> 30<P>Both <a href="OSLoadFont.html"><code>OSLoadFont()</code></a> and <a href="OSInitFont.html"><code>OSInitFont()</code></a> expand the <code>OSFontHeader</code> structure at the head of the specified font data buffer. Some members are used only by the operating system, but an application program can reference the following structure members.</P> 31<TABLE border="1" cellpadding="3" cellspacing="0"> 32 <TBODY> 33 <TR> 34<TD bgcolor="#C0C0C0"><STRONG>Member</STRONG></TD> 35<TD bgcolor="#C0C0C0"><STRONG>Description</STRONG></TD> 36<TD bgcolor="#C0C0C0"><STRONG>Value</STRONG></TD> 37 </TR> 38 <TR> 39<TD><CODE>ascent</CODE></TD> 40<TD>The character ascent (texels above the base line).</TD> 41 <TD><CODE>24</CODE></TD> 42 </TR> 43 <TR> 44<TD><CODE>descent</CODE></TD> 45<TD>The character descent (texels below the base line).</TD> 46 <TD><CODE>0</CODE></TD> 47 </TR> 48 <TR> 49<TD><CODE>leading</CODE></TD> 50<TD>The leading or spacing between lines.</TD> 51 <TD><CODE>28</CODE></TD> 52 </TR> 53 <TR> 54<TD><CODE><CODE>width</CODE></CODE></TD> 55<TD>The number of texels in the widest text character.</TD> 56 <TD><CODE>24</CODE></TD> 57 </TR> 58 <TR> 59<TD><CODE>sheetWidth</CODE></TD> 60<TD>The width of the texture image sheet.</TD> 61 <TD><CODE>512</CODE></TD> 62 </TR> 63 <TR> 64<TD><CODE>sheetHeight</CODE></TD> 65<TD>The height of the texture image sheet.</TD> 66 <TD><CODE>512</CODE></TD> 67 </TR> 68 <TR> 69<TD><CODE>cellWidth</CODE></TD> 70<TD>The cell (a single text character) width within a sheet.</TD> 71 <TD><CODE>24</CODE></TD> 72 </TR> 73 <TR> 74<TD><CODE>cellHeight</CODE></TD> 75<TD>The cell (a single character) height within a sheet.</TD> 76 <TD><CODE>24</CODE></TD> 77 </TR> 78 </TBODY> 79</TABLE> 80<H2>Reference</H2> 81<TABLE border="1" cellpadding="3" cellspacing="0"> 82 <TBODY> 83 <TR> 84<TD bgcolor="#C0C0C0"><STRONG>File</STRONG></TD> 85<TD bgcolor="#C0C0C0"><STRONG>Description</STRONG></TD> 86 </TR> 87 <TR> 88<TD><CODE>libraries/demo/src/DEMOPuts.c</CODE></TD> 89<TD>Implementation for <code>DEMOInitROMFont()</code>, <code>DEMOSetROMFontSize()</code>, <code>DEMORFPrintf()</code> and other ROM font utility fuctions.</TD> 90 </TR> 91 <TR> 92<TD><CODE>osdemo/src/fontdemo1.c</CODE></TD> 93<TD>Illustrates the use of <a href="OSInitFont.html"><code>OSInitFont()</code></a> and <a href="OSGetFontTexture.html"><code>OSGetFontTexture()</code></a>.</TD> 94 </TR> 95 <TR> 96<TD><CODE>osdemo/src/fontdemo2.c</CODE></TD> 97<TD>Illustrates the use of <a href="OSLoadFont.html"><code>OSLoadFont()</code></a> and <a href="OSGetFontTexel.html"><code>OSGetFontTexel()</code></a>.</TD> 98 </TR> 99 </TBODY> 100</TABLE> 101<H2>Revision History</H2> 102<P>2006/03/01 Initial version.</P> 103</BODY> 104<br> 105</HTML>