Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

postscript::simple scalefont

by daviekiernan (Initiate)
on Sep 21, 2012 at 16:49 UTC ( #994943=perlquestion: print w/replies, xml ) Need Help??
daviekiernan has asked for the wisdom of the Perl Monks concerning the following question:


I am creating headers of different width i.e. 1 to 8 columns wide, but am trying to scale the font to be wider as the columns get wider but can;t find anything online as to how this is done using postscript::simple, I have managed to manually manipulate a postscript file to do this but wondering where anyone knows how to do this using postscript::simple; Has anyone any ideas? Below is the main part of the perl

Thanks Dave

while ($counter <= $number_of_columns)
{#start counting columns
# Build up measure e.g. total width for 6-col is 6 x number of cols + 5 x gutters
$measure = ($column_width * $counter) + ($gutter * ($counter-1));
$center_point = $measure/2; # Used for centering lines of type
use PostScript::Simple;
# create a new PostScript object
$p = new PostScript::Simple(portrait => 1,
xsize => $measure,
ysize => $depth,
colour => 0,
reencode => undef,
eps => 0,
units => "pt");
# create a new page
# draw lines or other shapes
$p->setlinewidth( 1.00 );
$p->box(.25,.25, $measure,$depth);
$p->box( {filled => 1},0,0,$measure,$depth);
$p->setlinewidth( 0 );
$p->box(.25,.25, $measure,$depth-1.75);
$p->box( {filled => 1},.25,.25,$measure,$depth-2);
# add text
$p->setfont("FlamaNewsMedium", 9);
#$p->setfont("FlamaNewsMedium", 15);
$p->text( {align => 'center'},$center_point,$depth/3, "$categories{$cat_number}");
# write the output to as many files as you need

Replies are listed 'Best First'.
Re: postscript::simple scalefont
by AnomalousMonk (Chancellor) on Sep 21, 2012 at 18:03 UTC

    Hi, daviekiernan. Welcome to the Monastery!
    I see you're getting your money's worth out of the  <br> tag.
    Do yourself a favor and investigate the  <code> ... </code> and shorthand  <c> ... </c> tags.
    Please see Markup in the Monastery.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://994943]
Approved by sundialsvc4
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2018-03-19 01:53 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (231 votes). Check out past polls.