General information
Category:
Reports & Report designer
Title:
Calculating length of printed string.
I have to be able to pad a string with asterisks so that, when it prints to a label, it will completely cover the length of the label.
My question is, given an unknown printer, how do you convert the information from functions like FONTMETRIC() and TXTMETRIC() to calculate the length of a printed string?
Let's say the font is Arial Normal 8 and FONTMETRIC(6), the average width, is 5 pixels. Leaving out TXTMETRIC() to make the example simple, let's say all of the characters in the string are "average".
How many "average" characters do I need to cover a printed inch? Would this depend on the printer's dpi resolution and, if so, how do you determine the selected printer's resolution? I'm confused because a FONTMETRIC(6) return of 5 pixels doesn't go into my laser printer's 300 dpi and come out with a real number of characters per inch.
Any help would be appreciated.
Ed
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only