TextAttributeControl

class HPS.TextAttributeControl : public HPS.Control

The HPS.TextAttributeControl class is a smart pointer that is tied to a database object. This object gives you access to all the attributes associated with text, such as font, size, and rotation. Text characteristics such as bold, italic, and underline are also accessed through the HPS.TextAttributeControl.

Default values for the various fields of HPS.TextAttributeControl can be found here.

Public Functions

override void Dispose ()
override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return

The declared type of the object in question, which may differ from the true, underlying type.

HPS.TextAttributeControl SetAlignment (HPS.Text.Alignment in_align)

Sets the alignment for text.

Return

A reference to this object.

HPS.TextAttributeControl SetAlignment (HPS.Text.Alignment in_align, HPS.Text.ReferenceFrame in_ref)

Sets the alignment for text.

Return

A reference to this object.

HPS.TextAttributeControl SetAlignment (HPS.Text.Alignment in_align, HPS.Text.ReferenceFrame in_ref, HPS.Text.Justification in_justify)

Sets the alignment for text.

Return

A reference to this object.

HPS.TextAttributeControl SetBackground (bool in_state)

Sets the background to be used with text.

Param in_state

Whether a background is drawn for text.

Return

A reference to this object.

HPS.TextAttributeControl SetBackground (bool in_state, string in_name)

Sets the background to be used with text.

Param in_state

Whether a background is drawn for text.

Param in_name

The name of a shape definition.

Return

A reference to this object.

HPS.TextAttributeControl SetBackground (string in_name)

Sets the background to be used with text. The state is implicitly on.

Param in_name

The name of a shape definition.

Return

A reference to this object.

HPS.TextAttributeControl SetBackgroundMargins (float in_size)

Sets the amount of additional padding around text strings when backgrounds are used.

Param in_size

The size of the margins.

Return

A reference to this object.

HPS.TextAttributeControl SetBackgroundMargins (float in_size, HPS.Text.MarginUnits in_units)

Sets the amount of additional padding around text strings when backgrounds are used.

Param in_size

The size of the margins.

Param in_units

The units of the size.

Return

A reference to this object.

HPS.TextAttributeControl SetBackgroundMargins (float[] in_sizes, HPS.Text.MarginUnits[] in_units)
HPS.TextAttributeControl SetBackgroundStyle (string in_name)

Allows specifying a named style to be used in the drawing of text backgrounds. If no style is specified, backgrounds inherit the face and edge attributes from the containing segment.

Param in_name

The name of a style, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.TextAttributeControl SetBold (bool in_state)

Sets whether text should be bold. For fonts which do not have a bold variant, this setting will be ignored.

Param in_state

Whether text should be bold.

Return

A reference to this object.

HPS.TextAttributeControl SetExtraSpace (bool in_state)

Sets the amount of additional space to add between characters in a text string.

Param in_state

Whether to add additional space between characters in a text string.

Return

A reference to this object.

HPS.TextAttributeControl SetExtraSpace (bool in_state, float in_size)

Sets the amount of additional space to add between characters in a text string.

Param in_state

Whether to add additional space between characters in a text string.

Param in_size

The size of the additional space to add between characters.

Return

A reference to this object.

HPS.TextAttributeControl SetExtraSpace (bool in_state, float in_size, HPS.Text.SizeUnits in_units)

Sets the amount of additional space to add between characters in a text string.

Param in_state

Whether to add additional space between characters in a text string.

Param in_size

The size of the additional space to add between characters.

Param in_units

The units of the size of the additional space to add between characters.

Return

A reference to this object.

HPS.TextAttributeControl SetExtraSpace (float in_size, HPS.Text.SizeUnits in_units)

Sets the amount of additional space to add between characters in a text string. This function implicitly enables the addition of extra space.

Param in_size

The size of the additional space to add between characters.

Param in_units

The units of the size of the additional space to add between characters.

Return

A reference to this object.

HPS.TextAttributeControl SetFont (string in_name)

Sets the font to use for text. This must either be a builtin font or a font Visualize can locate in the directories specified by World.SetFontDirectories. If the requested font cannot be found, the stroked font will be used.

See

World.SetFontDirectories

Param in_name

UTF8-encoded font name to use for text.

Return

A reference to this TextKey.

HPS.TextAttributeControl SetGreeking (bool in_state)

Sets the greeking settings to use for text.

Param in_state

Whether greeking is enabled for text.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (bool in_state, float in_size)

Sets the greeking settings to use for text.

Param in_state

Whether greeking is enabled for text.

Param in_size

The size below which to draw a simple symbol in place of a character.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (bool in_state, float in_size, HPS.Text.GreekingUnits in_units)

Sets the greeking settings to use for text.

Param in_state

Whether greeking is enabled for text.

Param in_size

The size below which to draw a simple symbol in place of a character.

Param in_units

The units of the size below which to draw a simple glyph in place of a character.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (bool in_state, float in_size, HPS.Text.GreekingUnits in_units, HPS.Text.GreekingMode in_mode)

Sets the greeking settings to use for text.

Param in_state

Whether greeking is enabled for text.

Param in_size

The size below which to draw a simple symbol in place of a character.

Param in_units

The units of the size below which to draw a simple glyph in place of a character.

Param in_mode

The type of symbol to draw for characters which are smaller than the greeking size.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (float in_size)

Sets the greeking settings to use for text. This function implicitly enables text greeking.

Param in_size

The size below which to draw a simple symbol in place of a character.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (float in_size, HPS.Text.GreekingUnits in_units)

Sets the greeking settings to use for text. This function implicitly enables text greeking.

Param in_size

The size below which to draw a simple symbol in place of a character.

Param in_units

The units of the size below which to draw a simple glyph in place of a character.

Return

A reference to this object.

HPS.TextAttributeControl SetGreeking (float in_size, HPS.Text.GreekingUnits in_units, HPS.Text.GreekingMode in_mode)

Sets the greeking settings to use for text. This function implicitly enables text greeking.

Param in_size

The size below which to draw a simple symbol in place of a character.

Param in_units

The units of the size below which to draw a simple glyph in place of a character.

Param in_mode

The type of symbol to draw for characters which are smaller than the greeking size.

Return

A reference to this object.

HPS.TextAttributeControl SetItalic (bool in_state)

Sets whether text should be italic. For fonts which do not have an italic variant, this setting will be ignored.

Param in_state

Whether text should be italic.

Return

A reference to this object.

HPS.TextAttributeControl SetLineSpacing (float in_multiplier)

Sets the line spacing multiplier for text. This is a multiple of the font size that will be used to determine spacing between lines in multi-line text string.

Param in_multiplier

The line spacing multiplier for text.

Return

A reference to this object.

HPS.TextAttributeControl SetOverline (bool in_state)

Sets whether an overline should be drawn over text.

Param in_state

Whether an overline should be drawn over text.

Return

A reference to this object.

HPS.TextAttributeControl SetPath (HPS.Vector in_path)

Sets the path for text. This setting controls the vector along which text strings will be displayed.

Param in_path

The path for text.

Return

A reference to this object.

HPS.TextAttributeControl SetPreference (float in_cutoff, HPS.Text.SizeUnits in_units, HPS.Text.Preference in_smaller, HPS.Text.Preference in_larger)

Sets the preference for text. This setting controls which font type is used for text for “large” and “small” sizes and the cutoff at which this distinction is made.

Param in_cutoff

The font size below which the smaller preference is used and above which the larger preference is used.

Param in_units

The units for the font size below which the smaller preference is used and above which the larger preference is used.

Param in_smaller

The font type preference for strings below the cutoff size.

Param in_larger

The font type preference for strings above the cutoff size.

Return

A reference to this object.

HPS.TextAttributeControl SetPreference (HPS.Text.Preference in_pref)

Sets the font type preference for text. This function implicitly sets the same font type for all text sizes.

Return

A reference to this object.

HPS.TextAttributeControl SetRenderer (HPS.Text.Renderer in_rend)

Sets the renderer for text.

Return

A reference to this object.

HPS.TextAttributeControl SetRotation (float in_angle)

Sets the angle characters should be rotated within text strings. This function implicitly sets a rotation state of Text.Rotation.Rotate.

Param in_angle

The angle in degrees to rotate each character within text strings.

Return

A reference to this object.

HPS.TextAttributeControl SetRotation (HPS.Text.Rotation in_state)

Sets the angle characters should be rotated within text strings.

Param in_state

Whether and how to rotate the characters within text string.

Return

A reference to this object.

HPS.TextAttributeControl SetRotation (HPS.Text.Rotation in_state, float in_angle)

Sets the angle characters should be rotated within text strings.

Param in_state

Whether and how to rotate the characters within text string.

Param in_angle

The angle in degrees to rotate each character within text strings. This is only relevant if in_state is Text.Rotation.Rotate.

Return

A reference to this object.

HPS.TextAttributeControl SetSize (float in_size, HPS.Text.SizeUnits in_units)

Sets the font size to use for text.

Param in_size

The size for text.

Param in_units

The units of the size for text.

Return

A reference to this object.

HPS.TextAttributeControl SetSizeTolerance (bool in_state)

Sets the size tolerance settings to use for text. These settings control how to render text strings which request a size not available for a bitmap font. If a size tolerance is specified and enabled, Visualize will use the nearest smaller size for the bitmap font within the tolerance in place of the requested size. If a size tolerance is not enabled, Visualize will attempt to scale up the nearest bitmap font size to the requested size. This setting has no effect for True Type or Open Type fonts.

Param in_state

Whether a size tolerance is enabled for text.

Return

A reference to this object.

HPS.TextAttributeControl SetSizeTolerance (bool in_state, float in_size)

Sets the size tolerance settings to use for text. These settings control how to render text strings which request a size not available for a bitmap font. If a size tolerance is specified and enabled, Visualize will use the nearest smaller size for the bitmap font within the tolerance in place of the requested size. If a size tolerance is not enabled, Visualize will attempt to scale up the nearest bitmap font size to the requested size. This setting has no effect for True Type or Open Type fonts.

Param in_state

Whether a size tolerance is enabled for text.

Param in_size

The size for the tolerance.

Return

A reference to this object.

HPS.TextAttributeControl SetSizeTolerance (bool in_state, float in_size, HPS.Text.SizeToleranceUnits in_units)

Sets the size tolerance settings to use for text. These settings control how to render text strings which request a size not available for a bitmap font. If a size tolerance is specified and enabled, Visualize will use the nearest smaller size for the bitmap font within the tolerance in place of the requested size. If a size tolerance is not enabled, Visualize will attempt to scale up the nearest bitmap font size to the requested size. This setting has no effect for True Type or Open Type fonts.

Param in_state

Whether a size tolerance is enabled for text.

Param in_size

The size for the tolerance.

Param in_units

The units of the size for the tolerance.

Return

A reference to this object.

HPS.TextAttributeControl SetSizeTolerance (float in_size, HPS.Text.SizeToleranceUnits in_units)

Sets the size tolerance settings to use for text. These settings control how to render text strings which request a size not available for a bitmap font. If a size tolerance is specified and enabled, Visualize will use the nearest smaller size for the bitmap font within the tolerance in place of the requested size. If a size tolerance is not enabled, Visualize will attempt to scale up the nearest bitmap font size to the requested size. This setting has no effect for True Type or Open Type fonts. This function implicitly enables a size tolerance.

Param in_size

The size for the tolerance.

Param in_units

The units of the size for the tolerance.

Return

A reference to this object.

HPS.TextAttributeControl SetSlant (float in_angle)

Sets the slant angle for text. This determines how far the characters in the string are sheared to the left (negative angle) or right (positive angle) relative to the perpendicular.

Param in_angle

The angle in degrees to slant text. This value must be in the range [-75.0f,+75.0f].

Return

A reference to this object.

HPS.TextAttributeControl SetSpacing (float in_multiplier)

Sets the spacing multiplier for text. This setting controls the spacing between adjacent characters within a string. A value of 0.0f would result in all characters being drawn on top of each other, a value of 1.0f would be the standard spacing between characters, a value of 2.0f would insert twice as much space as would normally be between two characters, and so on.

Param in_multiplier

The spacing multiplier for text.

Return

A reference to this object.

HPS.TextAttributeControl SetStrikethrough (bool in_state)

Sets whether a strikethrough should be drawn through text.

Param in_state

Whether a strikethrough should be drawn through text.

Return

A reference to this object.

HPS.TextAttributeControl SetTransform (HPS.Text.Transform in_trans)

Sets the transform behavior for text.

Return

A reference to this object.

HPS.TextAttributeControl SetUnderline (bool in_state)

Sets whether an underline should be drawn under text.

Param in_state

Whether an underline should be drawn under text.

Return

A reference to this object.

bool ShowAlignment (out HPS.Text.Alignment out_align, out HPS.Text.ReferenceFrame out_ref, out HPS.Text.Justification out_justify)

Shows the alignment for text.

Return

true if an alignment was set, false otherwise.

bool ShowBackground (out bool out_state, out string out_name)

Shows the background to be used with text.

Param out_state

Whether a background is drawn for text.

Param out_name

The name of a shape definition.

Return

true if a spacing multiplier was set, false otherwise.

bool ShowBackgroundMargins (out float[] out_size, out HPS.Text.MarginUnits[] out_units)

Shows the amount of additional padding around text strings when backgrounds are used.

Param out_size

The size of the margins.

Param out_units

The units of the sizes.

Return

true if a spacing multiplier was set, false otherwise.

bool ShowBackgroundStyle (out string out_name)

Shows the named style to be used in the drawing of text backgrounds.

Param out_name

The name of a style, defined in a portfolio that is accessible.

Return

true if a spacing multiplier was set, false otherwise.

bool ShowBold (out bool out_state)

Shows whether text should be bold.

Param out_state

Whether text should be bold.

Return

true if a bold setting was set, false otherwise.

bool ShowExtraSpace (out bool out_state, out float out_size, out HPS.Text.SizeUnits out_units)

Shows the amount of additional space to add between characters in a text string.

Param out_state

Whether to add additional space between characters in a text string.

Param out_size

The size of the additional space to add between characters.

Param out_units

The units of the size of the additional space to add between characters.

Return

true if an extra space setting was set, false otherwise.

bool ShowFont (out string out_name)

Shows the font to use for text.

Param out_name

UTF8-encoded font name to use for text.

Return

true if a font was set, false otherwise.

bool ShowGreeking (out bool out_state, out float out_size, out HPS.Text.GreekingUnits out_units, out HPS.Text.GreekingMode out_mode)

Shows the greeking settings to use for text.

Param out_state

Whether greeking is enabled for text.

Param out_size

The size below which to draw a simple symbol in place of a character.

Param out_units

The units of the size below which to draw a simple glyph in place of a character.

Param out_mode

The type of symbol to draw for characters which are smaller than the greeking size.

Return

true if greeking settings were set, false otherwise.

bool ShowItalic (out bool out_state)

Shows whether text should be italic.

Param out_state

Whether text should be italic.

Return

true if an italic setting was set, false otherwise.

bool ShowLineSpacing (out float out_multiplier)

Shows the line spacing multiplier for text.

Param out_multiplier

The line spacing multiplier for text.

Return

true if a line space multiplier was set, false otherwise.

bool ShowOverline (out bool out_state)

Shows whether an overline should be drawn over text.

Param out_state

Whether an overline should be drawn over text.

Return

true if an overline setting was set, false otherwise.

bool ShowPath (out HPS.Vector out_path)

Shows the path for text.

Param out_path

The path for text.

Return

true if a path was set, false otherwise.

bool ShowPreference (out float out_cutoff, out HPS.Text.SizeUnits out_units, out HPS.Text.Preference out_smaller, out HPS.Text.Preference out_larger)

Shows the preference for text.

Param out_cutoff

The font size below which the smaller preference is used and above which the larger preference is used.

Param out_units

The units for the font size below which the smaller preference is used and above which the larger preference is used.

Param out_smaller

The font type preference for strings below the cutoff size.

Param out_larger

The font type preference for strings above the cutoff size.

Return

true if a preference was set, false otherwise.

bool ShowRenderer (out HPS.Text.Renderer out_rend)

Shows the renderer for text.

Return

true if a renderer was set, false otherwise.

bool ShowRotation (out HPS.Text.Rotation out_rot, out float out_angle)

Shows the angle characters should be rotated within text strings.

Param out_rot

Whether to rotate the characters within text strings, and if so, what the angle should be measured with repect to.

Param out_angle

The angle in degrees to rotate each character within text strings.

Return

true if a rotation setting was set, false otherwise.

bool ShowSize (out float out_size, out HPS.Text.SizeUnits out_units)

Shows the font size to use for text.

Param out_size

The size for text.

Param out_units

The units of the size for text.

Return

true if a size was set, false otherwise.

bool ShowSizeTolerance (out bool out_state, out float out_size, out HPS.Text.SizeToleranceUnits out_units)

Shows the size tolerance settings to use for text.

Param out_state

Whether a size tolerance is enabled for text.

Param out_size

The size for the tolerance.

Param out_units

The units of the size for the tolerance.

Return

true if a size tolerance was set, false otherwise.

bool ShowSlant (out float out_angle)

Shows the slant angle for text.

Param out_angle

The angle in degrees to slant text.

Return

true if a slang angle was set, false otherwise.

bool ShowSpacing (out float out_multiplier)

Shows the spacing multiplier for text.

Param out_multiplier

The spacing multiplier for text.

Return

true if a spacing multiplier was set, false otherwise.

bool ShowStrikethrough (out bool out_state)

Shows whether a strikethrough should be drawn through text.

Param out_state

Whether a strikethrough should be drawn through text.

Return

true if a strikethrough setting was set, false otherwise.

bool ShowTransform (out HPS.Text.Transform out_trans)

Shows the transform state for text.

Return

true if a transform state was set, false otherwise.

bool ShowUnderline (out bool out_state)

Shows whether an underline should be drawn under text.

Param out_state

Whether an underline should be drawn under text.

Return

true if an underline setting was set, false otherwise.

TextAttributeControl (HPS.SegmentKey in_seg)

Initializes a control tied to the segment in_seg.

TextAttributeControl (HPS.TextAttributeControl in_that)

Initializes a control tied to the same object as in_that.

HPS.TextAttributeControl UnsetAlignment ()

Removes the alignment setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetBackground ()

Removes the background setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetBackgroundMargins ()

Removes the background margin setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetBackgroundStyle ()

Removes the background style setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetBold ()

Removes the bold setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetEverything ()

Removes all settings from this object. If the control is attached to a WindowKey this function restores the default settings of this control as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetExtraSpace ()

Removes the extra space setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetFont ()

Removes the font setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetGreeking ()

Removes the greeking setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetItalic ()

Removes the italic setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetLineSpacing ()

Removes the line spacing setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetOverline ()

Removes the overline setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetPath ()

Removes the path setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetPreference ()

Removes the preference setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetRenderer ()

Removes the renderer setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetRotation ()

Removes the rotation setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetSize ()

Removes the size setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetSizeTolerance ()

Removes the size tolerance setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetSlant ()

Removes the slant setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetSpacing ()

Removes the spacing setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetStrikethrough ()

Removes the strikethrough setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetTransform ()

Removes the transform setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.

HPS.TextAttributeControl UnsetUnderline ()

Removes the underline setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by TextAttributeKit.GetDefault().

Return

A reference to this object.