Jump to content
Server Maintenance This Week. ×

Font size to auto-fit field


JenniSTM

Recommended Posts

Hullo everyone!
I'm using FM Pro 18 Advanced.

I'm wondering if there's a way to format a field so that, should the content be longer than the field allows, the font is reduced until it is all visible.
Basically, we have a couple of suppliers with extra- long product codes & at the moment they get cut off.
(Increasing the field size takes away from the next field - which could also occasionally use this format...)

Here's hoping! 🤞
 

Link to comment
Share on other sites

There is no way to format the field to do this automatically on its own. You could use conditional formatting or an auto-entered calculation to reduce the font size based on the number of characters in the field. However, unless the field is formatted to display in monospaced font, such adjustment can only be an approximation.

A more elaborate (much more elaborate) method would use a looping script to reduce the font gradually until the field stops expanding when entered into. You can check this by comparing the results of GetLayoutObjectAttribute ( "fieldObject" ; "bottom" ) in between the two states (I am sure I posted a demo of this somewhere, but I cannot find it now).

Note that reducing the actual font size of the text (as opposed to conditional formatting) will affect the way the text is displayed in every other instance of the field, on any layout - so I would be very hesitant to go that way. Not to mention that this would make a very poor graphic design (unless you are producing name badges or something like that).

What is this layout used for? If it's for printing, you could simply make the field big enough to accommodate the largest possible value and close the gap to the next field by shrinking and sliding:
https://help.claris.com/en/pro-help/content/removing-blank-spaces.html

If it's not for printing, then why not simply move the next field to make room?

 

 

Edited by comment
Link to comment
Share on other sites

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.