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

Jonathan Conway rise at frii.com
Tue Jan 2 01:42:55 CST 2001


On Sat, 30 Dec 2000, Scott Longmore wrote:

> Not really worried about lynx w3m or emacs...as our customers will
> be accessing these documents via netscape or ie through T1 connections.

If you can rely on Netscape there's an HTML solution using a proprietary
tag. The <multicol> extension is designed to allow you to flow text (and
presumable other HTML elements) over multiple column layouts. Basically
you define a multicol element with a specified number of columns (and
gutter, width, style etc.) and Netscape automatically balances the text
over that number of columns. Unfortunately this requires Netscape 4+ (I
haven't tried it with Mozilla or Netscape 6), but if you can use this
option there's reasonably detailed discussion starting on page 466 of
"HTML & XHTML: The Definitive Guide" (Musciano & Kennedy, O'Reilly and
Assoc., 0-596-00026-X). The one saving grace of going this way is that
non-Netscape browsers will ignore the tag and fall back to single column
so you won't render the material unreadable.

> This is the way its currently being done now...were using framemaker
> manually to generate pdf files and postscript files. the postscript
> files are then converted to png files which are then put on the web
> page...ugly huh...the pdf file is a linked into the html files so
> customers can download and print it out.

Given that the Acrobat reader plugin for most platforms can display in the
browser frame I'm not sure what displaying in an image format gains you
except the compression PNG offers.

> Essentially...Im trying to automate the generation of a newsletter
> that can go on the web in html and create a downloadable pdf file by
> having the newsletter writer, scientist..not computer inclined <grin>,
> write a text file...that I can slurp in and dump into a nicely
> standardized and formated html file...need to be able to use
> columns..as he is use to seeing journal format...also will need to be
> able to embed images here and there. Were trying to get rid of
> framemaker and all the different image/file conversions....esentilly
> smooth out the process.

Unfortunately this is one of the areas that HTML really falls down on in
terms of control over rendering. If you're looking at it from a "Semantic
Web" point of view it's not something you'd want to do. :)

Outside of the <multicol> solution you're going to keep running into the
variable font size/face issue you originally inquired about. The only way
I can think of to get reasonably consistent results is setting face & size
to some fixed-width font with a style sheet and then doing your column
division based on character count. As soon as somebody overrides your
settings the design will get messed up, but that'll be true for any of the
non-multicol solutions. This should be pretty easy to implement in Perl.

> Maybe it would be better to dump the text and images to a semi large
> image file im thinking 800 h x 600 w ....problem with this is then
> generating the pdf file.....

If you're using PDF's compression capabilities and you absolutely have to
have DTP style control of layout you're probably better sticking with PDF.

Jonathan Conway




More information about the Boulder-pm mailing list