[comp.text.tex] "optimally" scaling text to fit given bounding box

buck@siswat.UUCP (A. Lester Buck) (11/27/90)

I have a specific text formatting problem and would appreciate some advice.

I would like to make lots of labels for many sizes of 3-ring binders, hanging
files, etc.  These labels would consist of a thin (maybe dotted) rule
as a bounding box with text inside.  I would like to be able to enter
the snippet of text and have the program automatically scale the font
and/or break the lines to fill the available space.  Since I have
maybe 100 labels, I would rather enter a simple text file that consisted
of the strings and out pops the formated labels, ready to be printed
on some heavier card stock and cut out for use.  I know I could
do this all by hand with various drawing programs, but I am looking
for something with a bit of intelligence.

Does anyone know of any program that does this type of font scaling
and line breaking automatically?

Thanks alot!

-- 
A. Lester Buck    buck@siswat.lonestar.org  ...!uhnix1!lobster!siswat!buck

lee@sq.sq.com (Liam R. E. Quin) (11/30/90)

buck@siswat.UUCP (A. Lester Buck) writes:
>I would like to make lots of labels for many sizes of 3-ring binders, hanging
>files, etc.  [...] a thin (maybe dotted) rule
>as a bounding box with text inside.  I would like to be able to enter
>the snippet of text and have the program automatically scale the font
>and/or break the lines to fill the available space.

Well, tbl (a troff preprocessor) will do something similar -- it'll move text
around to fit a box, and make sure that the box is the right size, but it
won't alter the text size.

Actually it can look quite imprtessive to have a whole shelf of binders
with identically-formatted titles.  At my last job I had a shelf with titles
like "4.1 BSD Vol 2A", "Electronic Mail", "Manual Pages", "Networking" and
"Child Pornography".


Another approach is to write a PostScript procedure to fit text, perhaps using
the blue-book line-breaking algorithm, but I'd much rather do this in troff!

Lee

-- 
Liam R. E. Quin,  lee@sq.com, SoftQuad Inc., Toronto, +1 (416) 963-8337

les@chinet.chi.il.us (Leslie Mikesell) (12/05/90)

In article <578@siswat.UUCP> buck@siswat.UUCP (A. Lester Buck) writes:

>I would like to make lots of labels for many sizes of 3-ring binders, hanging
>files, etc.  These labels would consist of a thin (maybe dotted) rule
>as a bounding box with text inside.  I would like to be able to enter
>the snippet of text and have the program automatically scale the font
>and/or break the lines to fill the available space.  Since I have
>maybe 100 labels, I would rather enter a simple text file that consisted
>of the strings and out pops the formated labels, ready to be printed
>on some heavier card stock and cut out for use.  I know I could
>do this all by hand with various drawing programs, but I am looking
>for something with a bit of intelligence.

>Does anyone know of any program that does this type of font scaling
>and line breaking automatically?

I just posted a program  (nametag.pl) to comp.lang.perl and alt.sources
that will generate nametags in postscript from a simple list.  It doesn't
break lines but it will rescale the font to fit if the first choice is
too large.  It consists of a perl program that calculates the
positioning for each line, but the scaling is done in postscript.
Changing a few constants in the program might make it do what you need.

Les Mikesell
  les@chinet.chi.il.us