..are good measures of a font's average width.

Part of my composite picture application is an ID badge option, and as  
part of that I had to calculate how to make a certain string fit in a  
given width.

I did this by printing "The quick brown fox jumps over the sleepy dog"  
numerous times at different font heights and styles. Then I measured  
the width of the line on the paper and determined a "points wide per  
point of font height" measure. With tqbfjotsd as a sample I came up  
with a figure for Helvetica Regular (the font used) of .49 points wide  
per point of font height. This give me approximately 6.5 points wide  
per character for 14 point Helvetica.

With my tests it worked, but this week they used a particularly long  
string for an event name and lo and behold it printed right across the  
picture and off the badge.

So I redid the measurements using randomly generated characters and  
got 8.02 points per character, on average.

Quite a difference.

Now I gotta redo the calcs for Bold and Italic, and test it at  
different font sizes (the points wider per point height changes with  
point size as well. testing 14-15 points showed a steady decrease of  
width per height.

(I can spec fractional point sizes with this perl library (PDF::API2,  
if anyone's interested, it's a perl library that lets you spit out  
pdfs), so I tested 14, 14.25, 14.5, 14.75 and 15 points)

But I finally got the bugs all worked out and it works well for us.  
The person who is in charge of this stuff now thinks I can do magic,  
because it used to take her weeks to put badges or a composite  
together, now it's a 'click this button' job.

Thanks to all who helped, and if anyone ever wants the perl code to  
make it all happen, just ask.

(John, tell your wife that her spreadsheet helped a lot with some  
crucial bits I hadn't even considered, even though I ended up recoding  
the logic in perl)

-- 
Bruce Johnson

"Wherever you go, there you are" B. Banzai,  PhD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"StrataList-OT" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/StrataList-OT?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to