comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Translate characters/string size to data/normal coordinates?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Translate characters/string size to data/normal coordinates? [message #40253] Sun, 01 August 2004 17:41 Go to previous message
andrew.cool is currently offline  andrew.cool
Messages: 47
Registered: July 2003
Member
ellips@yahoo.com (J.K.) wrote in message news:<90c173a.0407290707.65405a8@posting.google.com>...
> Is there any way to know the position of characters written to a
> device with xyouts? I'd like to do an xyouts but clear anything
> drawn underneath the text first with a polyfill.
>
> I can do it by trial and error but I could generalize it if I could
> translate characters to width and height in data or normal coordinates.
> I suppose this would change with !p.charsize/charsize/font selection.
>
> Any ideas?
>
> Thanks,
> John K.

Hi John,

Try using a negative value with the CHARSIZE keyword, which will

1. Not write anyhting to the screen, and

2. Return in the Width keyword the width of the string in
normalised coordinates.

e.g. :-

string = 'This is a normal string'
XYOUTS, x, y, string, WIDTH=thisWidth, CHARSIZE=-1

Of course, Charsize = -2 gives you a string twice as wide.

See http://www.dfanning.com/tips/stringsize.html for more info.


Cheers,

Andrew Cool
DSTO, Adelaide, South Australia
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Object Graphics: Combine 2d with 3d
Next Topic: Re: Combobox / Droplist index problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:52:17 PDT 2025

Total time taken to generate the page: 0.00376 seconds