Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiTextWidth

hiTextWidth(
S_fontType
t_text
)
=> x_width / nil

Description

Determines the width, in pixels, of a string of characters that has a specified font. Returns nil if the font type is not valid.

Arguments

S_fontType

Type of the font you want to use.
Valid values: "text", 'text, "label", or 'label.

text: The font used in CIW and Encapsulation output windows, viewfiles, and the input area of text fields.

label: The font used in banner labels, menus, and forms.

t_string

Text string whose width you want to check.

Values Returned

x_width

The width, in pixels, of the string.

nil

t_fontType is not valid.

Examples

Returns the width, 119 of the text string.

hiTextWidth( 'text "This is a string." )
=> 119

Returns the width, 84 of the text string.

hiTextWidth( "label" "This is a string." )
=> 84

Returns nil as the font type is not valid.

hiTextWidth( "notafont" "This is a string." )
=> *WARNING* hiiGetTextWidth: Invalid font type "notafont", must be "text" or "label".

nil

Related Topics

Text Attribute Functions


Return to top
 ⠀
X