TK_Text_Font

class TK_Text_Font

Handles the TKE_Text_Font opcode.

TK_Text_Font provides support for writing/reading the TKE_Text_Font opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph supports various text attributes. Text_Font contains information about the font, including name, size, size units, spacing, spacing units, tolerance, tolerance units, slant, transforms, rotation and width scaling.

Inherits from: BBaseOpcodeHandler

Index

Methods

Variables

Methods

void TK_Text_Font::set_names(int length)

protected

for internal use only

void TK_Text_Font::set_names(char const *names)

protected

for internal use only

TK_Text_Font::TK_Text_Font()

constructor

TK_Text_Font::~TK_Text_Font()
TK_Status TK_Text_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_Text_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_Text_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_Text_Font::ReadAscii(BStreamFileToolkit &tk)

Deprecated.

TK_Status TK_Text_Font::WriteAscii(BStreamFileToolkit &tk)

Deprecated.

void TK_Text_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_Text_Font::SetMask(int m)

Sets the mask indicating which font options are specified. Options are defined in TKO_Font_Options.

int TK_Text_Font::GetMask() const

const

Returns the mask indicating which font options are specified. Options are defined in TKO_Font_Options.

void TK_Text_Font::SetValue(int v)

Sets the mask indicating which font options are on/active. Options are defined in TKO_Font_Options.

int TK_Text_Font::GetValue() const

const

Returns the mask indicating which font options are on/active. Options are defined in TKO_Font_Options.

void TK_Text_Font::SetNames(char const *names)

Sets the font names. Allocates the buffer and copies the names string

void TK_Text_Font::SetNames(int length)

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

char const *TK_Text_Font::GetNames() const

const

Returns the font names string

char *TK_Text_Font::GetNames()

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

void TK_Text_Font::SetShape(char const *shape)

Sets the font background shape. Allocates the buffer and copies the shape string

void TK_Text_Font::SetShape(int length)

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

char const *TK_Text_Font::GetShape() const

const

Returns the font background shape string

char *TK_Text_Font::GetShape()

Returns the font background shape string buffer, which may be modified directly

void TK_Text_Font::SetStyle(char const *shape)

Sets the font background/leader style. Allocates the buffer and copies the shape string

void TK_Text_Font::SetStyle(int length)

Sets the font background/leader style buffer. Allocates a buffer large enough to hold a string of ‘length’ characters

char const *TK_Text_Font::GetStyle() const

const

Returns the font background/leader style string

char *TK_Text_Font::GetStyle()

Returns the font background/leader style string buffer, which may be modified directly

void TK_Text_Font::SetSize(float s)

Sets the text size

float TK_Text_Font::GetSize() const

const

Returns the text size

void TK_Text_Font::SetSizeUnits(int u)

Sets the units used to interpret the size. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetSizeUnits() const

const

Returns the units used to interpret the size. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetTolerance(float t)

Sets the text size tolerance

float TK_Text_Font::GetTolerance() const

const

Returns the text size tolerance

void TK_Text_Font::SetToleranceUnits(int u)

Sets the units used to interpret the size tolerance. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetToleranceUnits() const

const

Returns the units used to interpret the size tolerance. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetRotation(float r)

Sets the rotation angle of characters

float TK_Text_Font::GetRotation() const

const

Returns the rotation angle of characters

void TK_Text_Font::SetSlant(float s)

Sets the slant factor applied to characters

float TK_Text_Font::GetSlant() const

const

Returns the slant factor applied to characters

void TK_Text_Font::SetWidthScale(float s)

Sets the horizontal scaling applied to characters

float TK_Text_Font::GetWidthScale() const

const

Returns the horizontal scaling applied to characters

void TK_Text_Font::SetExtraSpace(float s)

Sets the amount of extra space inserted between characters

float TK_Text_Font::GetExtraSpace() const

const

Returns the amount of extra space inserted between characters

void TK_Text_Font::SetExtraSpaceUnits(int u)

Sets the units used to interpret the extra space. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetExtraSpaceUnits() const

const

Returns the units used to interpret the extra space. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetLineSpacing(float s)

Sets the spacing between lines of multi-line strings

float TK_Text_Font::GetLineSpacing() const

const

Returns the spacing between lines of multi-line strings

void TK_Text_Font::SetTransforms(int t)

Sets how the string is affected by any modeling transforms. Transforms are defined in TKO_Font_Transforms.

int TK_Text_Font::GetTransforms() const

const

Returns how the string is affected by any modeling transforms. Transforms are defined in TKO_Font_Transforms.

void TK_Text_Font::SetGreekingLimit(float s)

Sets the limit below which text drawing will be “greeked” (not drawn or drawn as simple geometry)

float TK_Text_Font::GetGreekingLimit() const

const

Returns the greeking limit

void TK_Text_Font::SetGreekingLimitUnits(int u)

Sets the units used to interpret the greeking limit. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetGreekingLimitUnits() const

const

Returns the units used to interpret the greeking limit. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetGreekingMode(int m)

Sets the method used for handling greeked text.

int TK_Text_Font::GetGreekingMode() const

const

Returns the method used for handling greeked text.

void TK_Text_Font::SetRenderer(int r)

Sets which types of fonts may be used. Renderers are defined in TKO_Font_Renderers.

int TK_Text_Font::GetRenderer() const

const

Returns which types of fonts may be used. Renderers are defined in TKO_Font_Renderers.

void TK_Text_Font::SetRenderers(int r1, int r2)

Sets which types of fonts may be used. Renderers are defined in TKO_Font_Renderers.

int const *TK_Text_Font::GetRenderers() const

const

Returns which types of fonts may be used. Renderers are defined in TKO_Font_Renderers.

void TK_Text_Font::SetRendererCutoff(float s)

Sets the limit below which text drawing will use the “lower” renderer

float TK_Text_Font::GetRendererCutoff() const

const

Returns the renderer cutoff limit

void TK_Text_Font::SetRendererCutoffUnits(int u)

Sets the units used to interpret the renderer cutoff. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetRendererCutoffUnits() const

const

Returns the units used to interpret the renderer cutoff. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetPreference(int r)

Sets which drawing modes may be used. Preferences are defined in TKO_Font_Preferences.

int TK_Text_Font::GetPreference() const

const

Returns which types of fonts may be used. Preferences are defined in TKO_Font_Preferences.

void TK_Text_Font::SetPreferences(int r1, int r2)

Sets which drawing modes may be used. Preferences are defined in TKO_Font_Preferences.

int const *TK_Text_Font::GetPreferences() const

const

Returns which types of fonts may be used. Preferences are defined in TKO_Font_Preferences.

void TK_Text_Font::SetPreferenceCutoff(float s)

Sets the limit below which text drawing will use the “lower” preference

float TK_Text_Font::GetPreferenceCutoff() const

const

Returns the preference cutoff limit

void TK_Text_Font::SetPreferenceCutoffUnits(int u)

Sets the units used to interpret the preference cutoff. Units are defined in #TKO_Font_Size_Units.

int TK_Text_Font::GetPreferenceCutoffUnits() const

const

Returns the units used to interpret the preference cutoff. Units are defined in #TKO_Font_Size_Units.

void TK_Text_Font::SetLayout(int l)

Sets the layout. Layouts are defined in TKO_Font_Layout.

int TK_Text_Font::GetLayout() const

const

Returns the layout. Layouts are defined in TKO_Font_Layout.

Variables

int TK_Text_Font::m_mask

protected

int

specifies which rendering options are active (and hence, which are valid). For internal use only.

int TK_Text_Font::m_value

protected

int

specifies what values to set for boolean options. For internal use only.

int TK_Text_Font::m_names_length

protected

int

for internal use only

char *TK_Text_Font::m_names

protected

char

for internal use only

float TK_Text_Font::m_size

protected

float

for internal use only

float TK_Text_Font::m_tolerance

protected

float

for internal use only

float TK_Text_Font::m_rotation

protected

float

for internal use only

float TK_Text_Font::m_slant

protected

float

for internal use only

float TK_Text_Font::m_width_scale

protected

float

for internal use only

float TK_Text_Font::m_extra_space

protected

float

for internal use only

float TK_Text_Font::m_line_spacing

protected

float

for internal use only

float TK_Text_Font::m_greeking_limit

protected

float

for internal use only

float TK_Text_Font::m_renderer_cutoff

protected

float

for internal use only

float TK_Text_Font::m_preference_cutoff

protected

float

for internal use only

int TK_Text_Font::m_renderers[2]

protected

int

for internal use only

int TK_Text_Font::m_preferences[2]

protected

int

for internal use only

int TK_Text_Font::m_shape_length

protected

int

for internal use only

int TK_Text_Font::m_style_length

protected

int

for internal use only

char *TK_Text_Font::m_shape

protected

char

for internal use only

char *TK_Text_Font::m_style

protected

char

for internal use only

int TK_Text_Font::m_margin_count

protected

int

for internal use only

float TK_Text_Font::m_margins[4]

protected

float

for internal use only

unsigned char TK_Text_Font::m_margin_units[4]

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_size_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_tolerance_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_space_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_greeking_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_greeking_mode

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_transforms

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_renderer_cutoff_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_preference_cutoff_units

protected

unsigned char

for internal use only

unsigned char TK_Text_Font::m_layout

protected

unsigned char

for internal use only