Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Calculates width of text.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Font 6.5 Yes Yes Yes No Yes
MBS( "Font.CalculateTextWidth"; Text { ; Font; Size } )   More


Parameter Description Example value
Text The text to measure. "Hello World"
Font Optional
The font name.
Using System font in case of empty parameter.
Size Optional
The font size to use.
Default is system font size.


Returns number or error.


Calculates width of text.
The plugin uses system font rendering to calculate width. This may be different from what FileMaker renders with it's own engine.
You can use the measured size to detect if text fits a field.

Mac result in logical points, but on Windows in pixels.


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

See also

Example Databases

Blog Entries

Created 21st October 2016, last changed 16th November 2018

Font.CalculateTextHeight   -   Font.Deactivate

Feedback: Report problem or ask question.

MBS Xojo Plugins