[boulder.pm] Font width/length for CGI scripts using CSS

Scott Longmore longmore at fsl.noaa.gov
Fri Dec 29 22:56:11 CST 2000

Hey gang,

  Havent posted for a while...guess I'm just a lowly lurker <grin>

Really starting to dive into Perl CGI and now CSS. Im actually
looking for a perl module that will give the height and width of
characters for a particular font..say New Times Roman 12pnt,
along with other attributes of the font similar to XFontStructure
in the X11 circles...do see on CPAN there there is such a module
that recovers those attributes X11::XFontStruct, but also see a
couple of other font modules..such as Postscript::FontMetrics
and Font::AFM. Anyone had any experience with these?
Also saw some font metrics modules for some fonts..I think those
supported by web browsers, Helv, Times and Courier, that come
with libwww...but Im not absolutley sure those modules come
with libwww in the latest version...anybody know about this?
and what these modules exactly did?

I essentially need to be able to read in a text file...and throw the
text into a series of fixed sized tables. By calculating the length
in pixels of the text knowing the width of each charcters for a
particular font, I can determine when to insert carriage returns
or html line breaks and to carry over into the next table column.

Any recommendations or suggestions would be greatly


More information about the Boulder-pm mailing list