class HT_Text
The HT_Text class works with the draw_3D_text
action to draw 3D and 2D text similar to other geometry, instead of directly
calling the Font Engine. HT_Text provides a different constructor
to handle a single or double precision position, and either normal chars,
with optional length, or wide chars ¾
unsigned short.
The result of the default actions is the same as if you
directly called the draw functions on the Font_Engine. In the
default implementation the draw_3d_text action transforms the
point and calls the draw_2d_text action. The (float) 2d_text
converts to int and calls the int version of 2d_text.
The int version then calls out to the Font_Engine associated
with the font on the Rendition.
This new scheme allows a renderer to replace the text
actions and treat text as just another piece of geometry. For example,
a renderer that stores geometry and replays it back later (that is, sorted
by position, or multiple times for banded plotting) no longer needs to
have special code to deal with text or force tessellation of text into
"simple" geometry for storage.
See Also
For more information, see draw_2d_text,
draw_3d_text
and
HT_Font_Engine.
Access Methods
count
The number of characters.
point
The insertion point.
point_d
The double precision insertion
point.
precision
User can query the precision
status ¾
double or single.
string
Returns a pointer to the
character string.
wide_string
Returns a pointer to 2
byte character strings.
Constructor / Destructor
HT_Text
Constructs an HT_Text
object.
HT_Text::count
Purpose
The number of characters.
Synopsis
int count() const
HT_Text::HT_Text
Purpose
Constructs an HT_Text
object.
Synopsis
HT_Text ()
HT_Text::point
Purpose
The insertion point.
Synopsis
HT_Text (HT_Point const * point,
char const * string,
int len = -1,
HT_Boolean copy = HK_False);
HT_Text (HT_Point const * point,
unsigned short const * string,
int len,
HT_Boolean copy = HK_False);
HT_Text (HT_Point_D const * point,
char const * string,
int len = -1,
HT_Boolean copy = HK_False);
HT_Text (HT_Point_D const * point,
unsigned short const * string,
int len,
HT_Boolean copy = HK_False);
HT_Point const * point() const
Details
The first form is for single, normal characters. The
second form is for single, wide characters. The third form is for double,
normals characters and the fourth for double, wide.
HT_Text::point_d
Purpose
The double precision insertion
point.
Synopsis
HT_Point_D const * point_d() const
HT_Text::precision
Purpose
The user can query for
the precision status ¾
either double or single.
Synopsis
HT_Precision precision () const
HT_Text::string
Purpose
Returns a pointer to the
character string.
Synopsis
char const * string () const
Details
If the string is normal, it has 1 byte characters.
HT_Text::wide_string
Purpose
Returns a pointer to 2
byte character strings.
Synopsis
unsigned short const * wide_string () const
Details
This method is for 2 byte character strings such as
unicode.