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

Size of Printed Text Field


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

Recommended Posts

Posted

I think I know the answer to this but ....

Does anyone know of a way to determine how long a printed text field would be when using a variable pitch font?

I have a situation where we are printing a company name on a pre-printed certificate, along with a bit of other slightly variable text.

The problem is that the names vary enormously in length. Most fit quite well but some would run to two lines and there just isn't room. What I'd like to do is reduce the font size if, and only if, the name is too big.

(Using a smaller font size in a shrinking field is not an option because it looks weird for the majority of companies who have small names. Nor is the option adopted by one user - just let the name get truncated!)

Posted

You might employ a CF like this one to determine how much space the text takes up, and adjust the size if necessary:

http://www.clevelandconsulting.com/support/viewtopic.php?t=510

Posted

OMG, someone took this seriously...

Well, at least let's be efficient about it. How about:

2 * Length ( Filter ( text ; "i" ) ) +

3 * Length ( Filter ( text ; "I./:;" ) ) +

4 * Length ( Filter ( text ; "0123456789jt" ) ) +

etc....

Posted

One way I did this years ago was to create a layout with huge headers and footers so that one line of text in the body part was one page.

Preview the layout, count the number of pages, use this to work out how many lines of test there are, then use this info to change to the appropriate layout.

Posted (edited)

Vaughan, that is really kludgey. I like it! Thanks. :party:

Sorry, Ender but thanks anyway. Where do you find the sizes of the various letters?

Edited by Guest
  • 4 weeks later...
Posted

Thought I'd throw in my eventual solution. Your idea was a bit far out, Vaughan.

I ended up with names like 'Murrurundi Heights North R.S.L.' having just "L." on the second line - not quite the look we wanted.

What I've done is, on the screen that shows customer details where you go to enter new or look and/or edit, set up replicas of the two fields where size matters and use V8's TextSize() to provide the user with Up and Down arrows to increase or decrease the pitch. Customer's happy so so am I.

This topic is 6837 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
×
×
  • Create New...

Important Information

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