Re: String length when FONT=1 [message #29091] |
Thu, 31 January 2002 13:20  |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
Paul van Delst wrote:
>
> Hey there,
>
> Anyone know how to determine string length in normalised units when you're using truetype
> fonts?
>
> Currently I have:
>
> ch_size = CONVERT_COORD( !D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL )
> x_ch_size = ch_size[ 0 ] * charsize
> x_length = STRLEN( my_string ) * x_ch_size )
>
> which works great for the regular on-screen hershey type of fonts, but not for proportional
> fonts.
>
> any ideas? what I want to do is blank out the plot behind the text, e.g. like for legends etc.
>
> paulv
Hiya Paul,
Does the Width keyword to XYOUTS not help? e.g. :-
XYOUTS, x, y, string, WIDTH=thisWidth, CHARSIZE=-1
Charsize of -1 suppresses printing to the window, and the variable
thisWidth returns the width of the string in normalized coordinates.
Andrew
------------------------------------------------------------ ---------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group `-<-'
Surveillance Systems Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Salisbury electrons
South Australia 5108
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ ---------
|
|
|