TextAttributeControlο
-
class 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
-
inline virtual HPS::Type ObjectType() constο
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).
- Returns:
The declared type of the object in question, which may differ from the true, underlying type.
-
TextAttributeControl &operator=(TextAttributeControl &&in_that)ο
The move assignment operator transfers the underlying impl of the rvalue reference to this TextAttributeControl thereby avoiding a copy.
- Parameters:
in_that β An rvalue reference to a TextAttributeControl to take the impl from.
- Returns:
A reference to this TextAttributeControl.
-
TextAttributeControl &operator=(TextAttributeControl const &in_that)ο
Share the underlying smart-pointer of the TextAttributeControl source.
- Parameters:
in_that β The TextAttributeControl source of the assignment.
- Returns:
A reference to this TextAttributeControl.
-
TextAttributeControl &SetAlignment(Text::Alignment in_align, Text::ReferenceFrame in_ref = Text::ReferenceFrame::WorldAligned, Text::Justification in_justify = Text::Justification::Left)ο
Sets the alignment for text.
- Parameters:
in_alignment β The alignment for text.
in_reference_frame β The reference frame for text.
in_justification β The justification for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackground(bool in_state)ο
Sets the background to be used with text.
- Parameters:
in_state β Whether a background is drawn for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackground(bool in_state, char const *in_name)ο
Sets the background to be used with text.
- Parameters:
in_state β Whether a background is drawn for text.
in_name β The name of a shape definition.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackground(char const *in_name)ο
Sets the background to be used with text. The state is implicitly on.
- Parameters:
in_name β The name of a shape definition.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackgroundMargins(float in_size, Text::MarginUnits in_units = Text::MarginUnits::Percent)ο
Sets the amount of additional padding around text strings when backgrounds are used.
- Parameters:
in_size β The size of the margins.
in_units β The units of the size.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackgroundMargins(FloatArray const &in_size, TextMarginUnitsArray const &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.
- Parameters:
in_size β The size of the margins.
in_units β The units of the size.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackgroundMargins(size_t in_count, float const in_sizes[], HPS::Text::MarginUnits const 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.
- Parameters:
in_count β The number of elements in each array.
in_sizes β The size of the margins.
in_units β The units of the size.
- Returns:
A reference to this object.
-
TextAttributeControl &SetBackgroundStyle(char const *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.
- Parameters:
in_name β The name of a style, defined in a portfolio that is accessible.
- Returns:
A reference to this object.
-
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.
- Parameters:
in_state β Whether text should be bold.
- Returns:
A reference to this object.
-
TextAttributeControl &SetExtraSpace(bool in_state, float in_size = 0.0f, Text::SizeUnits in_units = Text::SizeUnits::ObjectSpace)ο
Sets the amount of additional space to add between characters in a text string.
- Parameters:
in_state β Whether to add additional space between characters in a text string.
in_size β The size of the additional space to add between characters.
in_units β The units of the size of the additional space to add between characters.
- Returns:
A reference to this object.
-
TextAttributeControl &SetExtraSpace(float in_size, 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.
- Parameters:
in_size β The size of the additional space to add between characters.
in_units β The units of the size of the additional space to add between characters.
- Returns:
A reference to this object.
-
TextAttributeControl &SetFont(char const *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 also
WORLD->SetFontDirectories
- Parameters:
in_name β UTF8-encoded font name to use for text.
- Returns:
A reference to this TextKey.
-
TextAttributeControl &SetGreeking(bool in_state, float in_size = 0.0f, Text::GreekingUnits in_units = Text::GreekingUnits::ObjectSpace, Text::GreekingMode in_mode = Text::GreekingMode::Lines)ο
Sets the greeking settings to use for text.
- Parameters:
in_state β Whether greeking is enabled for text.
in_size β The size below which to draw a simple symbol in place of a character.
in_units β The units of the size below which to draw a simple glyph in place of a character.
in_mode β The type of symbol to draw for characters which are smaller than the greeking size.
- Returns:
A reference to this object.
-
TextAttributeControl &SetGreeking(float in_size, Text::GreekingUnits in_units = Text::GreekingUnits::ObjectSpace, Text::GreekingMode in_mode = Text::GreekingMode::Lines)ο
Sets the greeking settings to use for text. This function implicitly enables text greeking.
- Parameters:
in_size β The size below which to draw a simple symbol in place of a character.
in_units β The units of the size below which to draw a simple glyph in place of a character.
in_mode β The type of symbol to draw for characters which are smaller than the greeking size.
- Returns:
A reference to this object.
-
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.
- Parameters:
in_state β Whether text should be italic.
- Returns:
A reference to this object.
-
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.
- Parameters:
in_multiplier β The line spacing multiplier for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetOverline(bool in_state)ο
Sets whether an overline should be drawn over text.
- Parameters:
in_state β Whether an overline should be drawn over text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetPath(Vector const &in_path)ο
Sets the path for text. This setting controls the vector along which text strings will be displayed.
- Parameters:
in_path β The path for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetPreference(float in_cutoff, Text::SizeUnits in_units, Text::Preference in_smaller, 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.
- Parameters:
in_cutoff β The font size below which the smaller preference is used and above which the larger preference is used.
in_units β The units for the font size below which the smaller preference is used and above which the larger preference is used.
in_smaller β The font type preference for strings below the cutoff size.
in_larger β The font type preference for strings above the cutoff size.
- Returns:
A reference to this object.
-
TextAttributeControl &SetPreference(Text::Preference in_pref)ο
Sets the font type preference for text. This function implicitly sets the same font type for all text sizes.
- Parameters:
in_preference β The font type preference for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetRenderer(Text::Renderer in_rend)ο
Sets the renderer for text.
- Parameters:
in_renderer β The renderer for text.
- Returns:
A reference to this object.
-
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.
- Parameters:
in_angle β The angle in degrees to rotate each character within text strings.
- Returns:
A reference to this object.
-
TextAttributeControl &SetRotation(Text::Rotation in_state, float in_angle = 0.0f)ο
Sets the angle characters should be rotated within text strings.
- Parameters:
in_state β Whether and how to rotate the characters within text string.
in_angle β The angle in degrees to rotate each character within text strings. This is only relevant if in_state is Text::Rotation::Rotate.
- Returns:
A reference to this object.
-
TextAttributeControl &SetSize(float in_size, Text::SizeUnits in_units)ο
Sets the font size to use for text.
- Parameters:
in_size β The size for text.
in_units β The units of the size for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetSizeTolerance(bool in_state, float in_size = 50.0f, Text::SizeToleranceUnits in_units = Text::SizeToleranceUnits::Percent)ο
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.
- Parameters:
in_state β Whether a size tolerance is enabled for text.
in_size β The size for the tolerance.
in_units β The units of the size for the tolerance.
- Returns:
A reference to this object.
-
TextAttributeControl &SetSizeTolerance(float in_size, 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.
- Parameters:
in_size β The size for the tolerance.
in_units β The units of the size for the tolerance.
- Returns:
A reference to this object.
-
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.
- Parameters:
in_angle β The angle in degrees to slant text. This value must be in the range [-75.0f,+75.0f].
- Returns:
A reference to this object.
-
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.
- Parameters:
in_multiplier β The spacing multiplier for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetStrikethrough(bool in_state)ο
Sets whether a strikethrough should be drawn through text.
- Parameters:
in_state β Whether a strikethrough should be drawn through text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetTransform(Text::Transform in_trans)ο
Sets the transform behavior for text.
- Parameters:
in_transform β The transform behavior for text.
- Returns:
A reference to this object.
-
TextAttributeControl &SetUnderline(bool in_state)ο
Sets whether an underline should be drawn under text.
- Parameters:
in_state β Whether an underline should be drawn under text.
- Returns:
A reference to this object.
-
bool ShowAlignment(Text::Alignment &out_align, Text::ReferenceFrame &out_ref, Text::Justification &out_justify) constο
Shows the alignment for text.
- Parameters:
out_alignment β The alignment for text.
out_reference_frame β The reference frame for text.
out_justification β The justification for text.
- Returns:
true if an alignment was set, false otherwise.
-
bool ShowBackground(bool &out_state, UTF8 &out_name) constο
Shows the background to be used with text.
- Parameters:
out_state β Whether a background is drawn for text.
out_name β The name of a shape definition.
- Returns:
true if a spacing multiplier was set, false otherwise.
-
bool ShowBackgroundMargins(FloatArray &out_size, TextMarginUnitsArray &out_units) constο
Shows the amount of additional padding around text strings when backgrounds are used.
- Parameters:
out_size β The size of the margins.
out_units β The units of the sizes.
- Returns:
true if a spacing multiplier was set, false otherwise.
-
bool ShowBackgroundStyle(UTF8 &out_name) constο
Shows the named style to be used in the drawing of text backgrounds.
- Parameters:
out_name β The name of a style, defined in a portfolio that is accessible.
- Returns:
true if a spacing multiplier was set, false otherwise.
-
bool ShowBold(bool &out_state) constο
Shows whether text should be bold.
- Parameters:
out_state β Whether text should be bold.
- Returns:
true if a bold setting was set, false otherwise.
-
bool ShowExtraSpace(bool &out_state, float &out_size, Text::SizeUnits &out_units) constο
Shows the amount of additional space to add between characters in a text string.
- Parameters:
out_state β Whether to add additional space between characters in a text string.
out_size β The size of the additional space to add between characters.
out_units β The units of the size of the additional space to add between characters.
- Returns:
true if an extra space setting was set, false otherwise.
-
bool ShowFont(UTF8 &out_name) constο
Shows the font to use for text.
- Parameters:
out_name β UTF8-encoded font name to use for text.
- Returns:
true if a font was set, false otherwise.
-
bool ShowGreeking(bool &out_state, float &out_size, Text::GreekingUnits &out_units, Text::GreekingMode &out_mode) constο
Shows the greeking settings to use for text.
- Parameters:
out_state β Whether greeking is enabled for text.
out_size β The size below which to draw a simple symbol in place of a character.
out_units β The units of the size below which to draw a simple glyph in place of a character.
out_mode β The type of symbol to draw for characters which are smaller than the greeking size.
- Returns:
true if greeking settings were set, false otherwise.
-
bool ShowItalic(bool &out_state) constο
Shows whether text should be italic.
- Parameters:
out_state β Whether text should be italic.
- Returns:
true if an italic setting was set, false otherwise.
-
bool ShowLineSpacing(float &out_multiplier) constο
Shows the line spacing multiplier for text.
- Parameters:
out_multiplier β The line spacing multiplier for text.
- Returns:
true if a line space multiplier was set, false otherwise.
-
bool ShowOverline(bool &out_state) constο
Shows whether an overline should be drawn over text.
- Parameters:
out_state β Whether an overline should be drawn over text.
- Returns:
true if an overline setting was set, false otherwise.
-
bool ShowPath(Vector &out_path) constο
Shows the path for text.
- Parameters:
out_path β The path for text.
- Returns:
true if a path was set, false otherwise.
-
bool ShowPreference(float &out_cutoff, Text::SizeUnits &out_units, Text::Preference &out_smaller, Text::Preference &out_larger) constο
Shows the preference for text.
- Parameters:
out_cutoff β The font size below which the smaller preference is used and above which the larger preference is used.
out_units β The units for the font size below which the smaller preference is used and above which the larger preference is used.
out_smaller β The font type preference for strings below the cutoff size.
out_larger β The font type preference for strings above the cutoff size.
- Returns:
true if a preference was set, false otherwise.
-
bool ShowRenderer(Text::Renderer &out_rend) constο
Shows the renderer for text.
- Parameters:
in_renderer β The renderer for text.
- Returns:
true if a renderer was set, false otherwise.
-
bool ShowRotation(Text::Rotation &out_rot, float &out_angle) constο
Shows the angle characters should be rotated within text strings.
- Parameters:
out_rot β Whether to rotate the characters within text strings, and if so, what the angle should be measured with repect to.
out_angle β The angle in degrees to rotate each character within text strings.
- Returns:
true if a rotation setting was set, false otherwise.
-
bool ShowSize(float &out_size, Text::SizeUnits &out_units) constο
Shows the font size to use for text.
- Parameters:
out_size β The size for text.
out_units β The units of the size for text.
- Returns:
true if a size was set, false otherwise.
-
bool ShowSizeTolerance(bool &out_state, float &out_size, Text::SizeToleranceUnits &out_units) constο
Shows the size tolerance settings to use for text.
- Parameters:
out_state β Whether a size tolerance is enabled for text.
out_size β The size for the tolerance.
out_units β The units of the size for the tolerance.
- Returns:
true if a size tolerance was set, false otherwise.
-
bool ShowSlant(float &out_angle) constο
Shows the slant angle for text.
- Parameters:
out_angle β The angle in degrees to slant text.
- Returns:
true if a slang angle was set, false otherwise.
-
bool ShowSpacing(float &out_multiplier) constο
Shows the spacing multiplier for text.
- Parameters:
out_multiplier β The spacing multiplier for text.
- Returns:
true if a spacing multiplier was set, false otherwise.
-
bool ShowStrikethrough(bool &out_state) constο
Shows whether a strikethrough should be drawn through text.
- Parameters:
out_state β Whether a strikethrough should be drawn through text.
- Returns:
true if a strikethrough setting was set, false otherwise.
-
bool ShowTransform(Text::Transform &out_trans) constο
Shows the transform state for text.
- Parameters:
out_transform β The transform state for text.
- Returns:
true if a transform state was set, false otherwise.
-
bool ShowUnderline(bool &out_state) constο
Shows whether an underline should be drawn under text.
- Parameters:
out_state β Whether an underline should be drawn under text.
- Returns:
true if an underline setting was set, false otherwise.
-
explicit TextAttributeControl(SegmentKey &in_seg)ο
Initializes a control tied to the segment in_seg.
-
TextAttributeControl(TextAttributeControl &&in_that)ο
The move constructor creates a TextAttributeControl by transferring the underlying impl of the rvalue reference to this TextAttributeControl thereby avoiding a copy and allocation.
- Parameters:
in_that β An rvalue reference to a TextAttributeControl to take the impl from.
-
TextAttributeControl(TextAttributeControl const &in_that)ο
Initializes a control tied to the same object as in_that.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
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().
- Returns:
A reference to this object.
-
~TextAttributeControl()ο
Releases a reference to the database object this control is tied to.
-
inline virtual HPS::Type ObjectType() constο