1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <title>Construct</title> 8 </head> 9 <body> 10 <h1><CODE>nw::font::PackedFont::Construct</CODE> Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14bool Construct( 15 void * pBuffer, 16 <span>u32</span> bufferSize, 17 const void * bfnt, 18 const char * glyphGroups = <a href="../../../nw/font/ArchiveFontBase/LOAD_GLYPH_ALL.html">LOAD_GLYPH_ALL</a> 19); 20</pre> 21 </div> 22 <h2>Arguments</h2> 23 <div class="section"> 24 <table class="arguments"> 25 <thead> 26 <tr> 27 <td width="15" /> 28 <th>Name</th> 29 <td>Description</td> 30 </tr> 31 </thead> 32 <tr> 33 <td>out</td> 34 <th>pBuffer</th> 35 <td>Pointer to the buffer associated with this instance. Must be aligned on a 128-byte boundary.</td> 36 </tr> 37 <tr> 38 <td>in</td> 39 <th>bufferSize</th> 40 <td>Size of the buffer pointed to by <CODE>pBuffer</CODE>.</td> 41 </tr> 42 <tr> 43 <td>in</td> 44 <th>bfnt</th> 45 <td>Pointer to the binary resource (<CODE>bfnt</CODE>) loaded into memory.</td> 46 </tr> 47 <tr> 48 <td>in</td> 49 <th>glyphGroups</th> 50 <td>String specifying the glyph group to load.</td> 51 </tr> </table> 52 </div> 53 <h2>Return Values</h2> 54 <div class="section">Returns <CODE>TRUE</CODE> if the font is successfully constructed; otherwise, returns <CODE>FALSE</CODE>.<br /> Fails if the archive font <CODE>bfnt </CODE>is illegal or if the buffer size is too small. </div> 55 <h2>Description</h2> 56 <div class="section"> 57 <p>Extracts the glyph group from the archive font and constructs a font.</p><p>For <span class="argument">bufferSize</span>, specify the buffer size that can be obtained with the <CODE><a href="../../../nw/font/PackedFont/GetRequireBufferSize.html">nw::font::PackedFont::GetRequireBufferSize</a></CODE>function. For <span class="argument">pBuffer</span>, specify the pointer to a memory region of that buffer size. When the font is successfully constructed, the memory region pointed to by <CODE>pBuffer</CODE> is under the management of this instance. Do not overwrite or release this memory region until the <CODE><a href="../../../nw/font/PackedFont/Destroy.html">nw::font::PackedFont::Destroy</a></CODE> function is called. The cache count specified by the <CODE><a href="../../../nw/font/PackedFont/GetRequireBufferSize.html">nw::font::PackedFont::GetRequireBufferSize</a></CODE> function does not need to be specified here because it can be obtained internally by inverse calculating <CODE>bufferSize</CODE>.</p><p>Specify the pointer to the archive font that has been loaded into memory in <CODE>brfnt</CODE>. The entire archive font must be loaded.</p><p>See the description for the <CODE><a href="../../../nw/font/PackedFont/GetRequireBufferSize.html">nw::font::PackedFont::GetRequireBufferSize</a></CODE> function for the meaning of the value specified by <span class="argument">glyphGroups</a>.</p><p>In contrast to the <CODE><a href="../../../nw/font/ResFont/SetResource.html">nw::font::ResFont::SetResource</a></CODE> function, the memory region specified by <CODE>brfnt</CODE> is not associated with an instance. For this reason, after the <CODE>Construct</CODE> function succeeds, the memory region specified with <CODE>brfnt</CODE> can be released. In addition, the memory region specified by <CODE>brfnt</CODE> is not overwritten.</p><p>When calling the <CODE>Construct</CODE> function, two buffers are needed for <CODE>pBuffer</CODE> and <CODE>brfnt</CODE>. In addition to memory the size of the expanded archive font that is used after the font is constructed (<CODE>pBuffer</CODE>), memory the size of the archive font before expansion (<CODE>brfnt</CODE>) is also temporarily needed.<br /> By using the function pair <CODE><a href="../../../nw/font/PackedFont/InitStreamingConstruct.html">nw::font::PackedFont::InitStreamingConstruct</a></CODE> and<CODE> <a href="../../../nw/font/PackedFont/StreamingConstruct.html">nw::font::PackedFont::StreamingConstruct</a></CODE> instead of using the <CODE>Construct</CODE> function, you can construct the font without using a memory region equivalent to the size of the pre-expanded archive font (i.e., <CODE>brfnt</CODE> ) . 58</p></div> 59 <h2>Revision History</h2> 60 <div class="section"> 61 <dl class="history"> 62 <dt>2009/11/09</dt> 63 <dd>Initial version.<br /> 64 </dd> 65 </dl> 66 </div> 67 <hr><p>CONFIDENTIAL</p></body> 68</html>