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>Font - Introduction</TITLE>
8</HEAD>
9<BODY>
10
11<H1>Font - Introduction</H1>
12
13<H2>Introduction</H2>
14<P>
15Two types of Wii bitmap fonts are stored in the NAND flash memory built into the Wii console. In addition, the same Wii bitmap fonts stored in NAND flash memory are included with the Revolution SDK in the form of files.
16</P>
17<P>
18The FNT functions provide basic features for using the Wii bitmap font included in the Revolution SDK and the Wii bitmap fonts stored in NAND flash memory.
19</P>
20<P>
21The Wii bitmap font stored in NAND flash memory can only be used with NAND applications.
22</P>
23
24<H2>Using Wii Bitmap Fonts</H2>
25<P>
26The Wii bitmap font file (font resource) is in a compressed state. To use the Wii bitmap font, the compressed font data must first be expanded in main memory.
27</P>
28
29<H3>Expansion</H3>
30<P>
31There are two methods of using a Wii bitmap font: one where all font resources are loaded into memory from DVD or NAND, and another where font resources are loaded successively into memory from DVD or NAND.
32</P>
33<P>
34Whichever method you use, get the size of the font data buffer first using <A href="FNTGetDataSize.html"><CODE>FNTGetDataSize</CODE></A> and then allocate the font data buffer.<BR> If all font resources are loaded into memory, expand font data by calling <A href="FNTConstruct.html"><CODE>FNTConstruct</CODE></A>.  If font resources are loaded into memory successively, first call <A href="FNTInitStreamingConstruct.html"><CODE>FNTInitStreamingConstruct</CODE></A>. Next, continue loading font resources and calling <A href="FNTStreamingConstruct.html"><CODE>FNTStreamingConstruct</CODE></A> until expansion of font data is finished.
35</P>
36
37<H3>Image Data</H3>
38<P>Image data is divided into multiple texture images (sheets) having the same size when expanded. A texture image sheet can be used as is as the texture image data stored in the structure <CODE><A href="../gx/Structures/GXTexObj.html">GXTexObj</A></CODE>. The <a href="FNTGetTexture.html"><code>FNTGetTexture()</code></a> function returns the pointer to the sheet that includes the specified character and the character position inside the sheet.</P>
39
40<H3>Character Width</H3>
41<P>The Wii bitmap font is a variable pitch (proportional) font. The width in texels of a specified character can be obtained by calling <A href="FNTGetTexture.html"><CODE>FNTGetTexture</CODE></A> and <CODE><A href="FNTGetWidth.html">FNTGetWidth</A></CODE>.</P>
42
43<H3>Encoding Method</H3>
44<P>The character encoding method to be passed to <A href="FNTGetTexture.html"><CODE>FNTGetTexture</CODE></A> and <CODE><A href="FNTGetWidth.html">FNTGetWidth</A></CODE> can be specified using <CODE><A href="FNTSetEncoding.html">FNTSetEncoding</A></CODE>. The current encoding method can be obtained using <CODE><A href="FNTGetEncoding.html">FNTGetEncoding</A></CODE>. UTF16 is set immediately after initialization by <A href="FNTConstruct.html"><CODE>FNTConstruct</CODE></A> or <A href="FNTStreamingConstruct.html"><CODE>FNTStreamingConstruct</CODE></A>.</P>
45
46<H3>Size Information</H3>
47<P>Font height, ascent, descent, line spacing, etc. can be obtained using <CODE><A href="FNTGetMetrics.html">FNTGetMetrics</A></CODE>.
48</P>
49
50<H2>Reference</H2>
51<TABLE border="1" cellpadding="3" cellspacing="0">
52  <TBODY>
53    <TR>
54      <TD bgcolor="#C0C0C0"><STRONG>File</STRONG></TD>
55      <TD bgcolor="#C0C0C0"><STRONG>Description</STRONG></TD>
56    </TR>
57    <TR>
58      <TD><CODE>fntdemo/src/fntdemo1.c</CODE></TD>
59      <TD>The sample demo displays characters using two types of fonts.</TD>
60    </TR>
61  </TBODY>
62</TABLE>
63
64<H2>Revision History</H2>
65<P>2006/10/01 Initial version.</P>
66
67<HR>
68<P>CONFIDENTIAL</P>
69</BODY>
70</HTML>