Harry Posted January 28, 2014 Posted January 28, 2014 Hello Board! Can i get some guidance, point me in the right direction? I have some labels printing out filled with text fields and a Calc field. It works OK. What I'd like to do is resize the Text fields dependant on their content. So, for instance, we have a Product::Colour field. Sometimes the content is 'Black'. Sometimes it's 'Black with Grey and a few spots of Maroon' (for instance). I'd like that field to fill the entire width of a label, whether the content is small or large. Is there a way to do that via scripting? Can i also, if that's possible, allow the text to wrap onto another line, perhaps? Or adjust the position of other Text fields if it does wrap to a second line; pushing other lines further down? I've not done any of this sort of intermediate Layout functioning before. If someone can point me in the right direction of where I should be looking, I'll go find out. Many thanks! H
comment Posted January 28, 2014 Posted January 28, 2014 You can, if you want, merge all or some of your fields into a single text object. I would experiment with that before going to the extreme of manipulating the font size. http://www.filemaker.com/13help/en/html/create_layout.9.27.html#1160797 1
Harry Posted January 28, 2014 Author Posted January 28, 2014 Hello Comment, thank you for your input. I have scanned it and it doesn't seem to be what i need - but I am sure there is the functionality in there somewhere, thank you!
comment Posted January 28, 2014 Posted January 28, 2014 it doesn't seem to be what i need Then most likely I have misunderstood what you need.
Lee Smith Posted January 28, 2014 Posted January 28, 2014 Are you using the labels included with the Reports Layout, or are you inventing your own? How about an example of the Before and After that you are wanting? The topic of increasing / decreasing the text size in a field has come up numerous times in the past, have you tried searching for some of the keywords in your question?
Harry Posted January 29, 2014 Author Posted January 29, 2014 I have made my own Layout for the labels. I don't have an after but it may look something like this: Before: Product A Black and Green and Brown with Pink Spots 12345 Product B Black 12346 After: Product A Black and Green and Brown with Pink Spots 12345 Product B Black 12346 Yes, i've tried searching for this information but have not come up with anything that fitted my requirements.
Lee Smith Posted January 29, 2014 Posted January 29, 2014 Do a Google search for site: fmforums.com resize text field
Harry Posted January 30, 2014 Author Posted January 30, 2014 That's a lot better, thanks! But takes me off this site - shame. It seems that it's not possible to do what i'm trying to do, though. One post on the Filemaker site from 2011 relates to automatically resizing fields to length. It says 'This cannot be done in Filemaker'. Thanks for your help with the search, though!
eos Posted January 30, 2014 Posted January 30, 2014 It says 'This cannot be done in Filemaker' You cannot alter the font setting for a field layout object, but you can change the display size of its contents via Conditional Formatting. In your case, try applying CF to the Colour field along the lines of Formula: Length ( self ) > 15 ; [ select smaller font size ] Formula: Length ( self ) > 25 ; [ select even smaller size ] ; etc.
comment Posted January 30, 2014 Posted January 30, 2014 One post on the Filemaker site from 2011 relates to automatically resizing fields to length. It says 'This cannot be done in Filemaker'. It depends on what you mean by "automatically resizing fields to length", esp. the "automatically" part. I don't think you are asking about resizing a field, though; it seems to me you are trying to resize the text inside a field - which is a different matter altogether. The main problem here is that with a proportional font, the exact width of a text depends not only on the font size, but also on the text itself. The text "www" is wider than "iii", although both are the same length in terms of character count. So you can either make a rough estimate and hope for the best (as proposed by eos, for example), or devise a laborious process of adjusting the font-size on a trial-and-error basis. This is not only difficult, it also carries a few side-effects that may combine to make the cure worse than the disease. Note also that adjusting the font size works in both dimensions. The field must be tall enough to accommodate the largest allowed font size - and consequently, if that size is not reached, the vertical gap is increased (this is one reason to use merge fields instead).
Recommended Posts
This topic is 3949 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now