Brian Dunning's FileMaker Custom Functions

GetFontSize ( text )

Returns the size of the text font

  Average rating: 4.5 (28 votes) Log in to vote

Daniele Raybaudi   Daniele Raybaudi - Show more from this author
ACI
http://www.aci.it

Share on Facebook Share on Twitter

  Sample input:
Today
  Sample output:
12

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Format: GetFontSize(text)

Parameter: text - any text expression or text field

Data type returned: number

Description: Returns the size of the text font

 

Comments

Michael Kupietz   Michael Kupietz, Michael Kupietz FileMaker Consulting
Sep 3, 2011
If you try to use it to get the text size of the active field, and the active field's text has not been resized from the field's default size, returns null string (""), not the text size.
 
Simon   Simon, Hull, UK
Nov 7, 2013
I find this works better, especially if there are numerals in the text. Obviously a nul value is returned if the text side has not been modified from the field default size. You can write in a formula to replace the nul value with your default value.

GetAsNumber ( Middle ( GetAsCSS( text ) ; Position ( GetAsCSS( text ) ; "font-size: " ; 1 ; 1 ) +11 ; 4 ) )
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: