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.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

Font.CalculateTextHeight

Calculates height of text.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Font 8.4 Yes Yes Yes No Yes

MBS( "Font.CalculateTextHeight"; Text; Warp Width { ; Font; Size } )

Parameters

Parameter Description Example value
Text The text to measure. "Hello World"
Warp Width The width of the text block to use for wrapping.
If < 50 will be set to 50 to avoid endless loops.
500
Font Optional
The font name.
Using System font in case of empty parameter.
"Arial"
Size Optional
The font size to use.
Default is system font size.
12

Result

Returns number or error.

Description

Calculates height of text.
The plugin uses system font rendering to calculate height given your wrap 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.

Examples

Calculates text height for a given text:

MBS( "Font.CalculateTextHeight"; "Hello World. Just a test."; 100; "Arial"; 12 )

Example result: 36

See also

Created 3th September 2018, last changed 3th September 2018


Font.CalculateTextFits   -   Font.CalculateTextWidth

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins