nw::font::TextWriterBase::SetBuffer Member Function

Syntax

static void * SetBuffer(
     CharType*   buffer,
     std::size_t size
);

Arguments

Name Description
in buffer Pointer to the buffer allocated for TextWriter.
in size Buffer size

Return Values

If a buffer was previously allocated TextWriter, the pointer to that buffer is returned. Returns NULL if the allocated buffer does not exist.

Description

Allocates a buffer for extracting formatted text.

This buffer is used to extract a formatted character string using a member function of TextWriter for handling formatted character strings. If the character string after extraction exceeds the size of this buffer, the excessive part of the string is truncated for the process.
The five functions listed below are nw::font::TextWriter member functions that handle formatted character strings.

nw::font::TextWriter::CalcFormatStringWidth
nw::font::TextWriter::CalcFormatStringHeight
nw::font::TextWriter::CalcFormatStringRect
nw::font::TextWriter::Printf
nw::font::TextWriter::VPrintf .

For the format that specifies only the buffer size, the buffer is specified such that it is allocated on the stack. Note: The stack may overflow if an attempt is made to allocate too large a buffer on the stack.

A buffer holding 256 characters is allocated on the stack by default.

Revision History

2009/11/09
Initial version.

CONFIDENTIAL