nw::font::TextWriterBase Class

Syntax

template <typename CharType>
class TextWriterBase : public nw::font::CharWriter

Template Arguments

Name Description
CharType The character type.

Description

The class for drawing characters using the nw::font::Font class

Inherits the nw::font::CharWriter class, so can use all features of nw::font::CharWriter, starting with the drawing of characters.

TextWriter is the typedef used for the TextWriterBase class when handling CP1252, ShiftJIS and UTF8.

WideTextWriter is the typedef used for the TextWriterBase class when handling UTF16.

Enumerated Types

PositionFlag Text drawing flags used with the SetDrawFlag function to position the text string.
ContextFlag
GradationMode The enum representing types of gradation.(Derived from CharWriter)

Member Constants

S DEFAULT_DRAWFLAG const u32 Represents the default rendering flag set for the constructor.
S DEFAULT_COLOR_MAPPING_MIN const u32 (Derived from CharWriter)
S DEFAULT_COLOR_MAPPING_MAX const u32 (Derived from CharWriter)

Member Functions

Constructors/Destructors
TextWriterBase Constructor.
~TextWriterBase Destructor.
Character Spacing, Leading, and Tab Width
SetLineSpace Sets the line spacing.
GetLineSpace Gets the leading.
SetLineHeight Sets the height of a line.
GetLineHeight Gets the height of a line.
SetCharSpace Sets the space between characters.
GetCharSpace Gets the space between characters.
SetTabWidth Sets the tab width.
GetTabWidth Gets the tab width.
Automatic Wrapping of Strings
SetWidthLimit Specifies the width to wrap automatically.
GetWidthLimit Gets the set wrap width.
ResetWidthLimit Disables the automatic wrapping feature.
Set/Get the Text Drawing Flag
SetDrawFlag Sets the text drawing flag.
GetDrawFlag Gets the text drawing flag.
Set/Get the Tag Processor
SetTagProcessor Sets the tag processor.
GetTagProcessor Gets the tag processor.
ResetTagProcessor Restores the tag processor to default.
Calculating the Drawn Size of the Text
CalcFormatStringWidth Calculates the width of the text.
CalcStringWidth Calculates the width of the text.
CalcFormatStringHeight Calculates the height of the text.
CalcStringHeight Calculates the height of the text.
CalcFormatStringRect Calculates the drawing rectangle for the text string.
CalcVStringRect Calculates the drawing rectangle for the text string.
CalcStringRect Calculates the drawing rectangle for the text string.
Text String Drawing
Printf Draws a string.
VPrintf Draws a string.
Print Draws a string.
Fonts
SetFont Sets the font.(Derived from CharWriter)
GetFont Gets the font.(Derived from CharWriter)
Character Drawing Preparation
SetupGX Prepares to draw characters.(Derived from CharWriter)
S FinalizeGX Performs drawing configuration post-processing.(Derived from CharWriter)
Linear conversion of glyph color.
SetColorMapping Sets the linear conversion for glyph colors used while drawing characters.(Derived from CharWriter)
GetColorMappingMin Gets the value after conversion for 0 for each component used in linear conversion of the glyph color.(Derived from CharWriter)
GetColorMappingMax Gets the value after conversion for 255 for each component used in linear conversion of the glyph color.(Derived from CharWriter)
ResetColorMapping Sets the system to not perform linear conversion of glyph colors while drawing characters.(Derived from CharWriter)
Character Color/Gradation
SetAlpha Sets the alpha value to be added when drawing characters.(Derived from CharWriter)
GetAlpha Gets the alpha value to be added when drawing characters.(Derived from CharWriter)
SetGradationMode Sets the gradation mode.(Derived from CharWriter)
GetGradationMode Gets the gradation mode.(Derived from CharWriter)
SetTextColor Sets the character and gradation color.(Derived from CharWriter)
GetTextColor Gets the text character color.(Derived from CharWriter)
GetGradationStartColor Gets the gradation start color.(Derived from CharWriter)
GetGradationEndColor Gets the gradation end color.(Derived from CharWriter)
Enlarging/Reducing Characters
SetScale Specifies the magnification ratio to use for a character.(Derived from CharWriter)
GetScaleH Gets the horizontal magnification ratio of the character.(Derived from CharWriter)
GetScaleV Gets the vertical magnification ratio of the character.(Derived from CharWriter)
SetFontSize Specifies the character size.(Derived from CharWriter)
GetFontWidth Returns the cell width after enlargement.(Derived from CharWriter)
GetFontHeight Gets the cell height after enlargement.(Derived from CharWriter)
GetFontAscent Gets the font ascent after enlargement.(Derived from CharWriter)
GetFontDescent Gets the font descent after enlargement.(Derived from CharWriter)
Drawing Fixed-Width Characters
EnableFixedWidth Setting to draw fixed-width characters.(Derived from CharWriter)
IsWidthFixed Determines whether characters are drawn as fixed-width.(Derived from CharWriter)
SetFixedWidth Specifies the character width to use when drawing fixed-width characters.(Derived from CharWriter)
GetFixedWidth Specifies the character width to use when drawing fixed-width characters.(Derived from CharWriter)
Text Drawing
Print Draws the characters.
DrawGlyph Draws glyphs.(Derived from CharWriter)
Cursor
SetCursor Sets the cursor position to the new coordinate that has been specified.(Derived from CharWriter)
MoveCursor Moves the cursor from its current position by the distance specified.(Derived from CharWriter)
SetCursorX This function sets the x-coordinate of the cursor.(Derived from CharWriter)
SetCursorY This function sets the y-coordinate of the cursor.(Derived from CharWriter)
SetCursorZ This function sets the z-coordinate of the cursor.(Derived from CharWriter)
MoveCursorX Moves the cursor from its current position by the distance specified.(Derived from CharWriter)
MoveCursorY Moves the cursor from its current position by the distance specified.(Derived from CharWriter)
MoveCursorZ Moves the cursor from its current position by the distance specified.(Derived from CharWriter)
GetCursorX This function gets the x-coordinate of the cursor.(Derived from CharWriter)
GetCursorY This function gets the y-coordinate of the cursor.(Derived from CharWriter)
GetCursorZ This function gets the z-coordinate of the cursor.(Derived from CharWriter)
Set/Get Shader-related
GetTextWriterResource Gets the TextWriterResource instance.(Derived from CharWriter)
SetTextWriterResource Sets the TextWriterResourceinstance.(Derived from CharWriter)
Buffer for character string display
GetDispStringBuffer Gets the buffer for displaying a string.(Derived from CharWriter)
SetDispStringBuffer Sets the buffer for displaying a string. When NULL is set, the string display buffer is no longer in use(Derived from CharWriter)
StartPrint Starts drawing of the character string. Used when a buffer has been configured for string display.(Derived from CharWriter)
EndPrint Ends drawing of the character string. Used when a buffer has been configured for string display.(Derived from CharWriter)
UseCommandBuffer Adds the string display-use command buffer to the current command list.(Derived from CharWriter)
S GetDispStringBufferSize Calculates the size of the buffer for string display.(Derived from CharWriter)
S InitDispStringBuffer Initializes a buffer for string display.(Derived from CharWriter)
Format Expansion Buffer
S SetBuffer Allocates a buffer for extracting formatted text.
S GetBuffer Gets a pointer to the buffer used to expand the formatted character string.
S GetBufferSize Gets the size of the buffer for extracting formatted text.
Other
S VSNPrintf
S StrLen

Class Hierarchy

nw::font::CharWriter
  nw::font::TextWriterBase

Revision History

2009/10/20
Initial version.

CONFIDENTIAL