Jump to content

Fit content to Field Script?


This topic is 5578 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm hoping there is some sort of script or formula that can make this work for me.

History:

I run a lot of database that have all sorts of ingredients stored in the fields. The field that stores this data is also in a print format to create a sign for customers. The issue that I have is the field is setup to a certain point size and number of lines. I have ingredients from one line text all the way to ten lines (plus).

Needed:

What I need is a script to format the type to fit the field exactly. Is it possible to write a script for type formatting attributes? This way I don’t have to go in and manually change all the records so they print out correctly.

Examples:

"Ingredients: Shrimp. Contains: Shellfish (shrimp). 042706"

VS:

"Ingredients: Crab, Bread Crumbs (Enriched unbleached wheat flour, Ferrous Sulfate, Niacin, Thiamine, Riboflavin, Folic Acid, Water, Salt Yeast), Celery, Green Onions, Red Bell Peppers, Mayonnaise (Canola Oil, Eggs, Water, Honey, White Vinegar, Salt, Dry Mustard, Lemon Juice), Shallots, Eggs, Panko, Dijon Mustard, Lime Juice, Garlic, Parmesan Cheese, Chipotle (Chipotle peppers, Water, Tomato puree, Corn Oil, Wheat Flour, Salt, Vinegar, Onion Powder, Garlic Powder and Spices), Worcestershire Sauce ( Vinegar, Molasses, Corn Syrup, Anchovies, Water, Onions, Salt, Garlic, Tamarind Extract, Cloves, Chile Pepper Extract, Hydrolyzed Soy and Corn Protein), Tabasco Sauce (Vinegar, Red Peppers, and Salt), Butter. Contains: Shellfish (crab), wheat, milk, eggs, soy, fish (anchovies). 051506"

thanks,

karl addison

Link to comment
Share on other sites

Read up on Sliding/Printing.

I'd redesign the layouts so the text doesn't have to fit exactly. Or move the data to a publishing package and do it in there.

Link to comment
Share on other sites

The slide printing does help a little. Thanks for that tip.

However, I don't have the option to redesign the field to make it any larger. This field is on a small 4x3 sign for customers and can not be enlarged. So I'm out of space real-estate. When we create signs we create 1000s of these and it’s a huge pain to change the point size for almost every record to make it fit the field.

I thought for some reason that 8.0 had more control over type attributes?

thanks,

karl addison

Edited by Guest
Link to comment
Share on other sites

The maximum hight of a field is set by you. The field will slide up to exclude the white space, but they will not expand beyond the size that you have specified.

If you are just wanting to view the data, Use the Vertical Scroll Bars in the "Format Field" edit box.

If you are talking about printing, then you may want to create a special print layout.

HTH

Lee

Edited by Guest
Link to comment
Share on other sites

So it sounds like there is no real way to do this with a script that automatically formats the type size to the field.

Because my sign is only 3x4 and this is for print production I don't have the option of creating anything larger or another layout. I'm maxed out with all the data that I have to legally have.

Here is a picture of what I'm working with:

Ingredients.jpg

As of right now I have 6 lines of type at 10pts. If it goes over 6 lines of type I have to shrink the point size up to 8pts or 9pts (which happens way too often). On the flip side I have to enlarge some ingredients to 11pts or 12pts so they are easier to read.

It's a huge pain to adjust all of this manually before we print the signs and makes me mega sad so I was hoping there was a way to make this automatic.

thanks,

karl addison

Link to comment
Share on other sites

The back side of the sign is for the Team Member with the PLU information so they can ring up the product for the customer. The customer only sees the front side of the sign which is on the left of the screen shot above.

:P

Karl Addison

Link to comment
Share on other sites

Doesn't leave a lot of options open to you then.

You might try something like this and see what you think. First count the characters that would represent the cutoffs of the sizes of print.

You then could use a set field script to change them.

Set Field [ YourLayout::YourTextField; Case (Length ( YourLayout::YourTextField ) [color:red]≤ 20; TextSize ( YourLayout::YourTextField ; [color:blue]12 ); Length ( YourLayout::YourTextField ) [color:red]≥ 20; TextSize ( YourLayout::YourTextField ; [color:blue]10 ); Length ( YourLayout::YourTextField ) [color:red]≥ 40; TextSize ( YourLayout::YourTextField ; [color:blue]8 )) ]

You will need to play with this probably, because it is coming off of the top of my head, and I have not tested it myself.

HTH

Lee

Edited by Guest
Link to comment
Share on other sites

  • 5 weeks later...

Ok here is a really dumb question about this....

This function would go in to the calculated value of a field correct?

I'm using 8.5 pro and for whatever reason I can not get any type styles to work.

Where would this function go to make it work for my field?

Link to comment
Share on other sites

This topic is 5578 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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