Difference between revisions of "SHIP:Sail:textWidth"

From Serious Documentation
Jump to: navigation, search
 
Line 40: Line 40:
 
|}
 
|}
  
[[Categories:String Functions]]
+
[[Category:String Functions]]

Latest revision as of 16:55, 24 October 2016

Function Returns Introduced Description
textWidth Integer v5.1.0 Returns the horizontal pixel width of a string.

See Also:

Prototype

Integer textWidth(String s);

Parameters/Return Value

Parameter Data Type Description
s String String to measure
Return Integer number of horizontal pixels in the string

Detailed Description

The textWidth function returns the number of horizontal pixels in a string. Font size and type can vary the result.

Examples

Example Result Notes
textWidth("hello");
38 20 pt font
textWidth("hello");
58 32 pt font
textWidth("");
0