TextAttributeKit

class HPS.TextAttributeKit : public HPS.Kit

The HPS.TextAttributeKit class is a user space object, useful for carrying a group attribute settings. Calling HPS.TextAttributeKit.GetDefault() will return a kit with values found in this table.

Public Functions

override void Dispose ()
override bool Empty ()

Indicates whether this object has any values set on it.

Return

true if no values are set on this object, false otherwise.

bool Equals (HPS.TextAttributeKit in_kit)

Check if the source TextAttributeKit is equivalent to this object.

Param in_kit

The source TextAttributeKit to compare to this object.

Return

true if the objects are equivalent, false otherwise.

override bool Equals (Object obj)
override int GetHashCode ()
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.

void Set (HPS.TextAttributeKit in_kit)

Copies all settings from the source TextAttributeKit into this object.

Param in_kit

The source TextAttributeKit to copy.

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

Sets the alignment for text.

Return

A reference to this object.

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

Sets the alignment for text.

Return

A reference to this object.

HPS.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit SetBackgroundMargins (float[] in_sizes, HPS.Text.MarginUnits[] in_units)

Sets the amount of additional padding around text strings when backgrounds are used. Additional margin values can also be referenced within definitions of background shapes and leader lines.

Param in_sizes

The size of the margins.

Param in_units

The units of the size.

Return

A reference to this object.

HPS.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit SetRenderer (HPS.Text.Renderer in_rend)

Sets the renderer for text.

Return

A reference to this object.

HPS.TextAttributeKit SetRotation (float in_angle)

Sets the angle characters should be rotated within text strings. To rotate the text as a block (instead of each individual character) use SetPath with SetRotation(HPS.Text.Rotation.FollowPath), or use a modelling matrix rotation. 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.TextAttributeKit SetRotation (HPS.Text.Rotation in_state)

Sets the angle characters should be rotated within text strings. To rotate the text as a block (instead of each individual character) use SetPath with SetRotation(HPS.Text.Rotation.FollowPath), or use a modelling matrix rotation.

Param in_state

Whether and how to rotate the characters within text string.

Return

A reference to this object.

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

Sets the angle characters should be rotated within text strings. To rotate the text as a block (instead of each individual character) use SetPath with SetRotation(HPS.Text.Rotation.FollowPath), or use a modelling matrix rotation.

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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit 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.TextAttributeKit SetTransform (HPS.Text.Transform in_trans)

Sets the transform behavior for text.

Return

A reference to this object.

HPS.TextAttributeKit 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.

void Show (out HPS.TextAttributeKit out_kit)

Copies all settings from this TextAttributeKit into the given TextAttributeKit.

Param out_kit

The TextAttributeKit to populate with the contents of 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.

TextAttributeKit ()

Initializes an empty kit.

TextAttributeKit (HPS.TextAttributeKit in_kit)

The copy constructor creates a new TextAttributeKit object that contains the same settings as the source object.

Param in_kit

The source object to copy.

HPS.TextAttributeKit UnsetAlignment ()

Removes the alignment setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetBackground ()

Removes the background setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetBackgroundMargins ()

Removes the background margin setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetBackgroundStyle ()

Removes the background style setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetBold ()

Removes the bold setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetEverything ()

Removes all settings from this object.

Return

A reference to this object.

HPS.TextAttributeKit UnsetExtraSpace ()

Removes the extra space setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetFont ()

Removes the font setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetGreeking ()

Removes the greeking setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetItalic ()

Removes the italic setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetLineSpacing ()

Removes the line spacing setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetOverline ()

Removes the overline setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetPath ()

Removes the path setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetPreference ()

Removes the preference setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetRenderer ()

Removes the renderer setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetRotation ()

Removes the rotation setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetSize ()

Removes the size setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetSizeTolerance ()

Removes the size tolerance setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetSlant ()

Removes the slant setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetSpacing ()

Removes the spacing setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetStrikethrough ()

Removes the strikethrough setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetTransform ()

Removes the transform setting.

Return

A reference to this object.

HPS.TextAttributeKit UnsetUnderline ()

Removes the underline setting.

Return

A reference to this object.

Public Static Functions

HPS.TextAttributeKit GetDefault ()

Creates a TextAttributeKit which contains the default settings. The returned object will not necessarily have values set for every option, but it will have settings for those options where it is reasonable to have a default.

Return

A TextAttributeKit with the default settings.

bool operator!= (HPS.TextAttributeKit a, HPS.TextAttributeKit b)
bool operator== (HPS.TextAttributeKit a, HPS.TextAttributeKit b)