TK_Font

class TK_Font

Handles the TKE_Font opcode.

TK_Font provides support for writing/reading the TKE_Font opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph supports user-defined fonts. Refer to the function ::HC_Define_Font in the HOOPS/3dGS Reference Manual

Inherits from: BBaseOpcodeHandler

Methods

void TK_Font::set_bytes(int size, char const *bytes = 0)

protected

internal use

void TK_Font::set_name(char const *string)

protected

internal use

void TK_Font::set_name(int length)

protected

internal use

void TK_Font::set_lookup(char const *string)

protected

internal use

void TK_Font::set_lookup(int length)

protected

internal use

TK_Font::TK_Font()

constructor

TK_Font::~TK_Font()
TK_Status TK_Font::Read(BStreamFileToolkit &tk)

virtual

Reads data from the toolkit buffer, decodes/decompresses it, and maps it to the opcode handlers data members. User-defined classes which need to write out custom data should utilize one of the available GetData() methods.

Parameters

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
TK_Status TK_Font::Write(BStreamFileToolkit &tk)

virtual

Encodes/compresses data and writes data to the toolkit buffer. User-defined classes which need to write out custom data should utilize one of the available PutData() methods, and first write out the opcode associated with the group of binary data followed by the data itself.

Parameters

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
TK_Status TK_Font::Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const

const virtual

Copies the opcode handler

Parameters

tk: A reference to the BStreamFileToolkit object.

handler: A pointer to the opcode handler object. Passed by reference.

Returns

The result of the function call.
TK_Status TK_Font::ReadAscii(BStreamFileToolkit &tk)

Deprecated.

TK_Status TK_Font::WriteAscii(BStreamFileToolkit &tk)

Deprecated.

void TK_Font::Reset()

virtual

Resets the current opcode handler. This is called by the toolkit when it is done processing an opcode. This method reinitializes any opcode handler variables and frees up temporary data.

void TK_Font::SetType(int t)

Set the type of the font (HOOPS stroked font definition is the only one supported so far)

int TK_Font::GetType() const

const

Returns the type of the font

void TK_Font::SetBytes(int size, char const *bytes = 0)

Sets the font data. Allocates a buffer which can hold ‘size’ bytes, and if specified, copies the data from ‘bytes’ to the buffer

int TK_Font::GetBytesCount() const

const

Returns the size of the data buffer

char const *TK_Font::GetBytes() const

const

Returns the address of the data buffer

char *TK_Font::GetBytes()

Returns the address of the data buffer, which may be modified directly

void TK_Font::SetName(char const *string)

Sets the name of the font. Allocates the buffer and copies the string

void TK_Font::SetName(int length)

Sets the name buffer. Allocates a buffer large enough to hold a string of ‘length’ characters

char const *TK_Font::GetName() const

const

Returns the font name string

char *TK_Font::GetName()

Returns the font name string buffer, which may be modified directly

void TK_Font::SetLookup(char const *string)

Sets the name of the lookup function. Allocates the buffer and copies the string

void TK_Font::SetLookup(int length)

Sets the lookup name buffer. Allocates a buffer large enough to hold a string of ‘length’ characters

char const *TK_Font::GetLookup() const

const

Returns the lookup function name string

char *TK_Font::GetLookup()

Returns the lookup name string buffer, which may be modified directly

void TK_Font::SetEncoding(int e)

Set the type of encoding for this font

int TK_Font::GetEncoding() const

const

Returns the type of encoding for this font

Variables

char *TK_Font::m_name

protected

char

internal use; Name of the font

char *TK_Font::m_lookup

protected

char

internal use; Name of font character lookup function

char *TK_Font::m_bytes

protected

char

internal use; Font description data

int TK_Font::m_name_length

protected

int

internal use; Length of name

int TK_Font::m_lookup_length

protected

int

internal use; Length of lookup name

int TK_Font::m_length

protected

int

internal use; Length font description

unsigned char TK_Font::m_type

protected

unsigned char

internal use; Type of font

unsigned char TK_Font::m_encoding

protected

unsigned char

internal use; Encoding associated with the font