Since the write() method allows you to specify the starting point of a string, *don't* join the lines. Instead, chop your postcard into two blocks, one for the message, and one for the address. Then write all your message lines in the message box, and write the address to the address box. That way, you can control your left margin without worrying about tabs, blanks, etc.

You might write a sub to write a block of text, something like this (*untested*):

# Write message write_text($dc, 1.0, 1.0, 0.2, "Anonymous Monk--", "Am in Hell, having a terrible time.", "Wish *you* were here! (Ha, ha!)", "--roboticus" ); # Where to send it! write_text($dc, 4.0, 2.5, 0.25, "Anonymous Monk", "11 Two-bit lane", "Cyberspace, 11010-0101" ); sub write_text { my $hPrt = shift; my $Left = shift; my $Top = shift; my $NL = shift; for (@_) { $hPrt->write($_, $Left, $Top); $Top += $NL; } }
--roboticus

In reply to Re: Formatting Printed column output with variable width Fonts by roboticus
in thread Formatting Printed column output with variable width Fonts by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.