Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Calculates width of text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Font | 6.5 | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
Text | The text to measure. | "Hello World" | |
Font | The font name. Using System font in case of empty parameter. |
"Arial" | Optional |
Size | The font size to use. Default is system font size. |
12 | Optional |
Returns number or error.
Calculate width of Hello World:
MBS( "Font.CalculateTextWidth"; "Hello World" )
# e.g. 70.9 on Mac and 77 on Windows.
Calculate with Arial
MBS( "Font.CalculateTextWidth"; "Hello World"; "Arial"; 12 )
# e.g. 61 on Windows, 61,7 on Mac
This function checks for a license.
Created 21st October 2016, last changed 16th November 2018