nw::font::ArchiveFont::Construct Member Function

Syntax

bool Construct(
     void * pBuffer,
     u32 bufferSize,
     const void * bfnt,
     const char * glyphGroups = LOAD_GLYPH_ALL
);

Arguments

Name Description
out pBuffer Pointer to the buffer associated with this instance. Must be aligned on a 128-byte boundary.
in bufferSize Size of the buffer pointed to by pBuffer.
in bfnt Pointer to the binary resource (bfnt) loaded into memory.
in glyphGroups String specifying the glyph group to load.

Return Values

Returns TRUE if the font is successfully constructed; otherwise, returns FALSE.
Fails if the archive font bfnt is illegal or if the buffer size is too small.

Description

Extracts the glyph group from the archive font and constructs a font.

For bufferSize, specify the buffer size that can be obtained with the nw::font::ArchiveFont::GetRequireBufferSizefunction. For pBuffer, specify the pointer to a memory region of that buffer size. When the font is successfully constructed, the memory region pointed to by pBuffer is under the management of this instance. Do not overwrite or release this memory region until the nw::font::ArchiveFont::Destroy function is called.

Specify the pointer to the archive font that has been loaded into memory in brfnt. The entire archive font must be loaded.

See the description for the nw::font::ArchiveFont::GetRequireBufferSize function for the meaning of the value specified by glyphGroups.

In contrast to the nw::font::ResFont::SetResource function, the memory region specified by brfnt is not associated with an instance. For this reason, after the Construct function succeeds, the memory region specified with brfnt can be released. In addition, the memory region specified by brfnt is not overwritten.

When calling the Construct function, two buffers are needed for pBuffer and brfnt. In addition to memory (pBuffer) that is used after the font is constructed, with size equal to the expanded archive font, memory (brfnt) the size of the archive font before expansion is also temporarily needed.
By using the function pair nw::font::ArchiveFont::InitStreamingConstruct andnw::font::ArchiveFont::StreamingConstruct instead of using the Construct function, you can construct the font without using a memory region equivalent to the size of the pre-expanded archive font (i.e., brfnt ) .

See Also

nw::font::Font::Font
nw::font::ArchiveFont::InitStreamingConstruct
nw::font::ArchiveFont::StreamingConstruct
nw::font::ArchiveFont::Construct
nw::font::ArchiveFont::GetRequireBufferSize
nw::font::ArchiveFont::Destroy
nw::font::ArchiveFont::InitStreamingConstruct
nw::font::ArchiveFont::StreamingConstruct
nw::font::ResFont::SetResource

Revision History

2009/11/09
Initial version.

CONFIDENTIAL