For Programmers: Free Programming Magazines  


Home > Archive > PostScript > May 2005 > right justify text









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author right justify text
Gunnar G

2005-04-29, 9:00 am

How can I right justify the text I print with

/temp 12 string def
/Times-Italic findfont
14 scalefont setfont

100 100 moveto
314 10 temp cvrs show
100 120 moveto
1 10 temp cvrs show

i.e. I want it to be printed with the right margin at (100,100)?
i.e. the result should look like

1
314
Ian Wilson

2005-04-29, 9:00 am

Gunnar G wrote:
> How can I right justify the text I print with
>
> /temp 12 string def
> /Times-Italic findfont
> 14 scalefont setfont
>
> 100 100 moveto
> 314 10 temp cvrs show
> 100 120 moveto
> 1 10 temp cvrs show
>
> i.e. I want it to be printed with the right margin at (100,100)?
> i.e. the result should look like
>
> 1
> 314


%!PS-Adobe
/rsh { dup stringwidth pop neg 0 rmoveto show } bind def
%%EndProlog
%%Page: One 1
/temp 12 string def
/Times-Italic findfont 14 scalefont setfont
100 100 moveto
314 10 temp cvrs rsh
100 120 moveto
1 10 temp cvrs rsh
showpage
%%Trailer
%%EOF
hoffmann@fho-emden.de

2005-05-01, 3:59 pm

Gunnar,

if you should need a PS procedure for printing (drawing)
arbitrary numbers formatted and with fixed space by otherwise
proportional fonts like Helvetica (e.g. mantissa length 0..6),
then write an E-Mail to
hoffmann@fho-emden.de

Best regards --Gernot Hoffmann

Ian Wilson

2005-05-01, 3:59 pm

Gunnar G wrote:
> How can I right justify the text I print with
>
> /temp 12 string def
> /Times-Italic findfont
> 14 scalefont setfont
>
> 100 100 moveto
> 314 10 temp cvrs show
> 100 120 moveto
> 1 10 temp cvrs show
>
> i.e. I want it to be printed with the right margin at (100,100)?
> i.e. the result should look like
>
> 1
> 314


%!PS-Adobe
/rsh { dup stringwidth pop neg 0 rmoveto show } bind def
%%EndProlog
%%Page: One 1
/temp 12 string def
/Times-Italic findfont 14 scalefont setfont
100 100 moveto
314 10 temp cvrs rsh
100 120 moveto
1 10 temp cvrs rsh
showpage
%%Trailer
%%EOF
Rune Zedeler

2005-05-01, 9:08 pm

hoffmann@fho-emden.de skrev:

> if you should need a PS procedure for printing (drawing)
> arbitrary numbers formatted and with fixed space by otherwise
> proportional fonts like Helvetica


The numbers in Helvetica are NOT proportional. Chars '0'-'9' have same
width.

-Rune
hoffmann@fho-emden.de

2005-05-02, 3:59 am

Rune,

didn't know this. Fortunately my algorithm is based on fixed
spacing - we have additionally (+), (-) and (.), characters with
different widths.

Best regards --Gernot Hoffmann

hoffmann@fho-emden.de

2005-05-04, 3:58 am

Gunnar,

if you should need a PS procedure for printing (drawing)
arbitrary numbers formatted and with fixed space by otherwise
proportional fonts like Helvetica (e.g. mantissa length 0..6),
then write an E-Mail to
hoffmann@fho-emden.de

Best regards --Gernot Hoffmann

Rune Zedeler

2005-05-04, 3:58 am

hoffmann@fho-emden.de skrev:

> if you should need a PS procedure for printing (drawing)
> arbitrary numbers formatted and with fixed space by otherwise
> proportional fonts like Helvetica


The numbers in Helvetica are NOT proportional. Chars '0'-'9' have same
width.

-Rune
Rune Zedeler

2005-05-06, 4:00 am

hoffmann@fho-emden.de skrev:

> if you should need a PS procedure for printing (drawing)
> arbitrary numbers formatted and with fixed space by otherwise
> proportional fonts like Helvetica


The numbers in Helvetica are NOT proportional. Chars '0'-'9' have same
width.

-Rune
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com