Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Style text with variable font weights (not just plain, bold...)


Recommended Posts

Posted

Is it possible to use TextStyleAdd, or any stock function, really, to change the text weight in more than 2 steps (plain, bold)? I have a font that has "light" weight, then "regular" weight, "semibold" and so on. In CSS those are usually represented by a number that goes from 100 onwards allowing for precise control over weights. However I could find nothing of the sort in FileMaker. In fact, supplying "Plain" to TextStyleAdd fails to assign "regular" (bolder) weight to a text box which has "light" weight assigned in the layout. Is there a simple way to work around that?

Posted

The available styles are what you see in the list.

However, you may be able to choose a specific font variation using the TextFont() function. For example, with:

List ( 
TextFont ( "abcdef" ; "Optima" ) ;
TextFont ( "abcdef" ; "Optima Bold" ) ;
TextFont ( "abcdef" ; "Optima ExtraBlack" ) 
)

I get:

image.png.ca0a9aae8412647774367ef27d9ad088.png

Posted (edited)

Ah, that's indeed correct. I was trying to migrate "Gill Sans" stock font from macOS to Windows to continue working on a solution, but something went wrong and only a single weight got successfully installed. Windows indeed labels fonts separately in the fonts list whereas macOS would group them by the base font name and there'll be a separate drop-down with weights and styles. Hence the initial confusion.

But it's still not clear what TextStyleAdd does then (both on Windows and on a macOS). Does it try to pull "Bold" (as an example) weight from an actual separate font file (e.g. Gill Sans Bold), or does it simply fake bold by applying it to the currently selected font variant?

Edited by Buckie
Posted
35 minutes ago, Buckie said:

what TextStyleAdd does

I think it tries to find the bold variation of the font first, and if it fails it applies "faux" bold. At least that's what my limited experiments (on macOS) lead me to believe. It might be different on Windows. You could do your own test by comparing the result with text formatted properly with the bold variation of the font. 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.