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

Home » Public Forums » archive » Explicit text formatting for Object Axes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Explicit text formatting for Object Axes [message #16829] Tue, 24 August 1999 00:00 Go to next message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>

<pre>I must be missing something important - but haven't a clue about how to 'get it'.</pre>
&nbsp;
<pre>I think that I am explicitly formatting the text style for Object Axis annotation as follows ...</pre>

<pre></pre>

<pre>oHelvetica10 = obj_new('IDLgrFont', 'Helvetica',size = 10.)</pre>

<pre>oOrigXAxis1 -> getProperty,$
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; TickText = oTickText
oTickText -> SetProperty, Font= oHelvetica10
oOrigXaxis1 ->setProperty, Ticktext = oTicktext</pre>

<pre></pre>

<pre>To my great surprise the text is scaled to different sizes when displayed (and frequently illegible).</pre>

<pre>It looks like the scaling is related to the axis data range (big ranges yield small text sizes).</pre>

<pre>Shouldn't Helvetica 10pt be sized to 10pt?</pre>

<pre></pre>

<pre>Thanks, Ben</pre>

<pre>--&nbsp;
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

Pemaquid River Company
pemaquidriver@tidewater.net</pre>
&nbsp;</html>
Re: Explicit text formatting for Object Axes [message #16893 is a reply to message #16829] Wed, 25 August 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ben Tupper (tupper@seadas.bigelow.org) writes:

> I've combed through my code regarding axis scaling and can't figure out what
> is going on. The first time I launch the application, the fonts are
> 'proportional and quite readable'. If I load a new differently sized image
> into the application the fonts are scaled badly. Now, if I load a third image of identical size to the
> very first image the font scaling returns to its 'proportional and quite readable' scaling.

> So, I think I'm setting the axis scaling correctly ... but, clearly, I am not.
> It seems that IDL has developed a scaling memory that I can't override. gak!

I think you have your text objects in a "never recompute
dimensions" state. :-)

Try changing the setting on the RECOMPUTE_DIMENSIONS keyword
when you create the text object.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Explicit text formatting for Object Axes [message #16895 is a reply to message #16829] Wed, 25 August 1999 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
David Fanning wrote:
<blockquote TYPE=CITE>&nbsp;
<p>I would just make sure your axes are scaled into your
<br>view before you muck around with your fonts. This will
<br>ensure that they are scaled "proportionally" to the
<br>axis they are attached to. Then, as you change axis
<br>scaling, these will change too. :-)
<br>&nbsp;
<br>&nbsp;</blockquote>
Oops, I thought that vector drawn fonts were scaled but hardware fonts
<br>were 'hard'.&nbsp;&nbsp; I tinkered with Xplot and can see what you
mean about
<br>needing to have scaleable fonts.&nbsp; Duh!
<p>I've&nbsp; combed through my code regarding axis scaling and can't figure
out what
<br>is going on.&nbsp; The first time I launch the application, the fonts
are
<br>'proportional and quite readable'.&nbsp;&nbsp; If I load a new differently
sized image
<br>into the application the fonts are scaled badly.&nbsp; Now, if I load
a third image of identical size to the very first image the font scaling
returns to its 'proportional and quite readable' scaling.
<p>Below is the code embedded in the event handler that loads a new image.
<p>;
<br>;
<br>;
<br>&nbsp;
<br>&nbsp;
<p>&nbsp;;get the dimensions of the new image called Value
<br>info.Origsz = SIZE(*info.Value, /dimensions)
<br>&nbsp;
<br>&nbsp;; establish the range of values
<br>Xrange = [0,info.Origsz[0]]
<br>Yrange = [0,info.Origsz[1]]
<p>&nbsp;;normalize the range
<br>info.OrigXscale = Normalize(Xrange, position = [0,1])
<br>info.OrigYscale = Normalize(Yrange, position = [0,1])
<p>&nbsp;; make the window slightly larger than the dimensions of the image
<br>xsize = info.Orig_rect[2]*info.Origsz[0]
<br>ysize = info.Orig_rect[3]*info.Origsz[1]
<br>widget_control, info.OrigDrawID, $
<br>&nbsp;xsize =xsize , $
<br>&nbsp;ysize = ysize
<p>&nbsp;; load the new data into the image object with
<br>&nbsp;; the normalized X and Y scaling
<br>info.oOrig -> setProperty, $
<br>&nbsp;Data = *info.image, $
<br>&nbsp;Xcoord_conv = info.OrigXscale, $
<br>&nbsp;Ycoord_conv = info.OrigYscale
<p>&nbsp; ; change the data range and scaling for the X axis
<br>&nbsp;; the Exact keyword has already been set to 1
<br>info.oOrigXaxis1 ->setProperty, $
<br>&nbsp;range = xrange, $
<br>&nbsp;Xcoord_conv = info.OrigXscale
<br>&nbsp;
<p>;
<br>;
<br>;
<p>So, I think I'm setting the axis scaling correctly ... but, clearly,
I am not.
<br>It seems that IDL has developed a scaling memory that I can't override.&nbsp;
gak!
<p>Thanks,
<br>&nbsp;
<p>Ben
<br>&nbsp;
<pre>--&nbsp;
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

Pemaquid River Company
pemaquidriver@tidewater.net</pre>
&nbsp;</html>
Re: Explicit text formatting for Object Axes [message #16925 is a reply to message #16829] Tue, 24 August 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ben Tupper (tupper@seadas.bigelow.org) writes:

> I must be missing something important - but haven't a clue about how to 'get it'.
>
> I think that I am explicitly formatting the text style for Object Axis annotation as follows ...
>
> oHelvetica10 = obj_new('IDLgrFont', 'Helvetica',size = 10.)
>
> oOrigXAxis1 -> getProperty,$
> TickText = oTickText
> oTickText -> SetProperty, Font= oHelvetica10
> oOrigXaxis1 ->setProperty, Ticktext = oTicktext
>
> To my great surprise the text is scaled to different sizes when displayed (and frequently illegible).
>
> It looks like the scaling is related to the axis data range (big ranges yield small text sizes).
>
> Shouldn't Helvetica 10pt be sized to 10pt?

Uh, no. Well, perhaps in a print shop. But certainly not
on a computer display screen. On a computer, when you select
something like Helvetica 12 point what you mean is "something
that looks about right when I use a computer with this resolution
and an axis about this long". If the designer of the "display
type" was any good, you'll get something that looks reasonable.
But is it 12 point? No, not likely.

And in object graphics, we normally want the "size" of the
font to change. That is to say, when we expand our window
to the full size of the display, it would be nice if the
type on the axes was sized proportionally. In fact, it does
this. Small windows give a "small" size 12 font. Large
windows give a "large" size 12 font. Think of the work
you would have to go to otherwise, or what a nightmare
it would be to calculate the "appropriate" size font
for every viewplane rectangle, on every display, in every
resolution that you might encounter. :-(

I would just make sure your axes are scaled into your
view before you muck around with your fonts. This will
ensure that they are scaled "proportionally" to the
axis they are attached to. Then, as you change axis
scaling, these will change too. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl > memory problems
Next Topic: IDL Syntax ?

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

Current Time: Wed Oct 08 15:06:10 PDT 2025

Total time taken to generate the page: 0.00635 seconds