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

Re: Explicit text formatting for Object Axes

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. :-)


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