Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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 (Canon) 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
[stevieb]: Coding circles around Python devs, showing how unit tests should be done, enabling easy access to everything, learning basic C to wrap for direct hardware access... I am thankful.
[stevieb]: I'm in an appreciative mood. Thank you fellow Monks, for all I know, and for the knowledge which I can pass on

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2017-02-25 01:28 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (364 votes). Check out past polls.