Re: cgAxis labels in different orientation in PS than on screen [message #77619 is a reply to message #77618] |
Thu, 15 September 2011 14:46  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian J. Daniel writes:
> David, you're code is too good. I've been lulled in to a false sense
> of security that all of the cg tools will work perfectly every time,
> and all my frustrations with dg will all fade away. I'm creating 3D
> scatter plots in a cgWindow using cgSurf to create the 3D space,
> cgAxis to create the axes where I want them, and cgPlotS to plot the
> data. Using cgWindow, I programmatically save theses plots to image
> files via ImageMagick. The resulting postscript features the axis
> labels in either horizontal or vertical orientations, not the nice
> orientations in the direct graphics output on my screen.
>
> Via postscript w/ vertical and horizontal text orientations:
> http://dl.dropbox.com/u/20212184/usenet_example.png
>
> without using postscript with nice text orientations but blocky text:
> http://dl.dropbox.com/u/20212184/usenet_example_dg.png
>
> Is there a way to get the orientations to be "pretty" in postscript?
Well, the problem is that PS_START sets !P.FONT=0 when
configuring the PostScript device. You need it to be
set to 1, to do True-Type fonts, which can rotate in
3D space. (Hershey fonts, !P.FONT=-1 can do this, too,
but they suck in PostScript.)
This is trickier than it looks, because *which* True-Type
font you choose is really, really machine dependent, and
I don't like to make this choice for the user. It probably is
something that should be controlled by cgControl.
What I usually do is control this in the graphics command
I am loading into cgWindow, by putting something like this
in my code:
IF !D.Name EQ 'PS' THEN BEGIN
thisFont = !P.Font
!P.Font=1
ENDIF ELSE thisFont = !P.Font
Then, when finished with the graphics display, !P.Font = thisFont.
I'll give this some more thought this afternoon and see
if there is a better way to do this.
As it happens PSConfig (which is ultimately what is being
used to control the PostScript device here) is already
able to collect font information from the user. The
problem is that there is just no absolutely reliable
way to DEAL with font information! You are always
guessing about what the user intended.
keywords = PSConfig(/FONTINFO)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|