Font Character Spacing in a Report

ted.martin

Registered User.
Local time
Today, 01:33
Joined
Sep 24, 2004
Messages
743
Is there a way to space out the text characters in a report text box so that I am able to print each letter onto a given template document designed with a box for each letter. This weblink below seems to be the answer but I cannot make it work.

Many thanks in anticipation
 
Choose a non-proportional font and decide how many spaces you need between the letters by testing or measuring.
 
in what way can you not make it work?
I have copied the code into the modules as suggested putting a single text box control in the Detail section of the Report and linked it to a table. The report runs but the printed text is normal. I have zipped and attached the CStest db.. If you would like to take a look that would be fantastic.
 

Attachments

Choose a non-proportional font and decide how many spaces you need between the letters by testing or measuring.
Thank you Pat but I think it is about a space and a half. The code link I posted allows the gap to be measured in centimetres so for the time being, I prefer that route. I hope your colleague CJ_London has some thoughts.
 
You might be able to change the point size. Try different fonts. They are actually different sizes even for the same point number. I wish it were easier to tell which ones are non-proportional. Maybe Google knows, except I haven't used Google for years. I use Duckduckgo. I get far better results.
 
@isladogs may be able to help. If I was going to do this in my head I would
1. Use the on print event.
2. Pass in the control width
3. Get the number of characters
4. Get the font
5. Get the points
Look at the conversions in the code here from @isladogs
6. Determine how many characters will fit
7. Reduce size to fit.
 
Worked for me - just need to follow the instructions - detail section needs to be 10cm high

1611617708754.png
 
Thank you CJ_London. I did not have the Detail section 10cm high.
 
This all seems unnecessary to me. Just set text align property to Distribute.
1611651034617.png
 
Yes, arnelgp. The boxes are pre-printed on the template form that I have to fill in.
 
This is much close?
 

Attachments

if you have a box for each letter, why not put each letter in a control of its own. Then you can use any font.
 
if you have a box for each letter, why not put each letter in a control of its own. Then you can use any font.
Yes I thought of that but putting on over 100 controls by 6 forms would have driven me crazy. Thank you anyway.
 
SOLVED - the code from MSDN finally worked.
Attached is the Test db and Scan of the result.
Thank you everyone; we got there in the end.
 

Attachments

This is much close?
Thank you. I wanted to avoid having to put 100 + controls on each report hence I wanted to try and find a code solution. Limiting to a non-Proportional font like Lucida Console is not a problem. (see the final solution in my posts at the end). Thank you for your help.
 
so you are using a pre-printed form?
sometimes they are not "printed" with same margins", so once in a while
you will need to adjust your report.

but if you create your own report, using the GOS 6 pdf (coverted to png or bmp)
and use the technique i showed you, your textbox are always align with the boxes.

see this: (limit of control in report is 754).
Access specifications - Access (microsoft.com)
 

Users who are viewing this thread

Back
Top Bottom