Good Morning,
I am currently working on a project where I write times in a postscript file. The position of the times varies. Their format is hh mm 1/2 where the 1/2 is optional if there are between 15 and 44 seconds to any minute.
I wanted to use the character representing halfes, but it did not print as such on my PS files. Currently I am shifting the text a bit to the left and insert a 1 a line and a 2 in a different font size. This unfortunately bloats the filesize as I need to redefine the fonts so often. This looks simplified as:
$p->text( {align => 'center'}, - 0.75, $line_height * $out_line, $tim +e); $p->setfont("Arial", 4); $p->setlinewidth(0.05); $p->text( {align => 'center'}, 2.5 , 0.7 - $line_height * $out_line, " +1"); $p->line( 2.7, $line_height * $out_line, 2.7 + 0.4, $line_height * $out_line ); $p->text( {align => 'center'}, 3.2, 0.25 - $line_height * $out_line, " +2");
New restrictions limit the time format even further. Variations are lots and fixed relation placing of the halves would not fit anymore. I am looking for a way to either directly add a half in the string, or to get the width of the printed string in mm, so I know where it ends, ... .

I am currently using PostScript::Simple and would prefer to use it in future yet I am open for other packages if this is not possible. My Perl is AS Perl 5.8.4 on Win XP.

Thank You for any help.


In reply to Special characters and PostScript::Simple by PerlingTheUK

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.