X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Dec 2012 10:05 PM by  anon
device, set_font='Some TTF", /tt_font does not work in Z buffer? (IDL 7.1.1, 8.2 on Mac OS 10.8)
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 Dec 2012 10:05 PM
    I can't seem to specify custom TrueType fonts in Z-buffer plots in IDL 7.1.1 or 8.2 on Mac OS 10.8.2. I've tried most of the fonts listed in resource/fonts/tt/ttfont.map with no luck. Example code: pro zfont_test x=dindgen(100)/50.*!dpi y=sin(x) set_plot,'Z' device,decomposed=0, set_resolution=[800,600],set_pixel_depth=24 device,set_font="Helvetica",/tt_font plot,x,y,title='plot title',xtitle='x axis', ytitle='y axis',/xstyle write_png,'zfont_test_h.png',tvrd(true=1) device,set_font="Courier Bold Italic",/tt_font plot,x,y,title='plot title',xtitle='x axis', ytitle='y axis',/xstyle write_png,'zfont_test_cbi.png',tvrd(true=1) end The fonts in these plots appear identical. Is this a bug, or am I just doing something entirely wrong?

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Dec 2012 09:10 AM
    You are doing something entirely wrong. :-) Actually, you are just forgetting to select true-type font output when you draw the plots. Set the Font keyword on the Plot command to 1 and you should be good to go. Most true-type fonts will not look so good on the display or in the Z-buffer. You may be better off using them only in the PostScript device and making your raster output from PostScript intermediate files: http://www.idlcoyote.com/...s_tips/weboutput.php http://www.idocoyote.com/cg_tips/cgwfg.php

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Dec 2012 09:17 AM
    Whoops! The second reference should be: http://www.idlcoyote.com/cg_tips/cgwfg.php

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Dec 2012 09:47 AM
    Hi David, Thanks for the reply. Setting font=1 in the PLOT call is the trick. And you're exactly right--the output looks mostly horrible. Unfortunately, the reason I was digging in to this problem was to avoid using ImageMagick to create raster output from PS. I'm dealing with some incredibly dense PS output, and going from PS to PNG (or PS -> PDF -> PNG) is terribly slow (minutes, or even tens of minutes!). Another problem is that the example code in my first post is not completely representative of my actual workflow. I'm using a big wrapper routine for the plotting, and it's not trivial to modify all the supporting routines to allow for setting the font keyword in each PLOT call. So I guess it's back to the drawing board. -Kris

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Dec 2012 03:14 PM
    You don't have to set the FONT keyword on every PLOT command. Set !P.FONT=1 instead! Why are you going through a PDF file to get to a raster file? I would just go from PostScript to raster directly. Once you create your PostScript file, you can use cgPS2Raster to convert to either PDF or PNG, as needed.
    You are not authorized to post a reply.