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.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   8.6    Statistic  

Font.CalculateTextFits

Queries how many characters would fit in a space.

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

Parameters

Parameter Description Example value
Text The text to measure. "Hello World"
MaxWidth The maximum width. 100
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

Queries how many characters would fit in a space.
The plugin will check how long the text would be in points.
Than we reduce text to see how much text fits in the space and return the length of the reminding space.

Examples

Checks how much fits:

MBS( "Font.CalculateTextFits"; "Hello World"; 50; "Arial"; 12)

See also

Blog Entries

Created 12nd September 2018, last changed 12nd September 2018


Font.Activate   -   Font.CalculateTextHeight

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins