[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

width of xyouts?



Hello all,

I am trying to use the width keyword of xyouts to determine when a text
line extends past a boundry so that I can parse the line into smaller
pieces.

I have been obtaining the width of the text string by first calling
xyouts with a charsize of -1 to suppress printing.  i.e.,

xyouts,0,0,charsize=-1,width=width,'whatever'

This works well until I try and use postscript fonts.  Whenever I set 
!p.font=0  the above xyouts call, instead of suppressing the text,
visibly writes the text upside down on the page.

If I try:

!p.font=-1
xyouts,0,0,charsize=-1,width=width,'whatever'
!p.font=0

I end up with a different value for width that I would get just using 
!p.font=0.  I also get different values when using the Z buffer so I
think I have to stay in the postscript device.

I could just call the xyouts with a position that will never be seen on
the page but that adds to the size of the postscript file whereas the
suppressed xyouts call does not.  The same applies for writing the text
in the background colour.

So my question is:  Is there a way to obtain the width of a text string
using postscript fonts without adding to the size of the postscript
file?

Cheers,
eddie

----- ---- --- ---  ---- --- --  --- --- --  -- - -  -  -
|\               A G Edward Haskell              
|\    Center for Coastal Physical Oceanography    
|\   Old Dominion University, Norfolk VA  23529   
|\     Voice 757.683.4816    Fax 757.683.5550     
|\          e-mail  haskell*ccpo.odu.edu          
----- ---- --- ----  --- --- ---  --- -- --  -- - -  -   -