Re: Problem with string replacement in postscript using psfrag

From: Benjamin R. Hillman <benjaminr.hillman_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 24 2011 - 11:36:05 MDT

Yes, font quality is set to low for all fonts in my .hluresfile. Hmm,
that's disappointing about the postscript output, but definitely
explains the problem. I will have to figure something else out I
guess. Thank you for the reply.

On Mon, Oct 24, 2011 at 8:02 AM, David Brown <dbrown@ucar.edu> wrote:
> Hi Benjamin,
> I am not quite sure how this is working at all for you unless you are setting the FontQuality class resource to "low" in your .hluresfile. I could be wrong but I think that "high" and "medium" quality fonts are always rendered in software, meaning that PostScript would only see lines or polygons for the text rather than actual letters. Even using the "low" font quality text is output a single character at a time, which may relate to the problem you are experiencing. For instance, if the y axis title consists of the string "yaxis", and font quality is set to "low", you would get the following postscript output:
>
> Gs 2156 9321 Tr 0 0 M [0.000 1.000 -1.000 0.000 0 0 ] Co -100 -144 Rm
> /Helvetica 402 Fs 0 0 (y) As Gr
> Gs 2156 9610 Tr 0 0 M [0.000 1.000 -1.000 0.000 0 0 ] Co -111 -144 Rm
> /Helvetica 402 Fs 0 0 (a) As Gr
> Gs 2156 9900 Tr 0 0 M [0.000 1.000 -1.000 0.000 0 0 ] Co -100 -144 Rm
> /Helvetica 402 Fs 0 0 (x) As Gr
> Gs 2156 10189 Tr 0 0 M [0.000 1.000 -1.000 0.000 0 0 ] Co -44 -144 Rm
> /Helvetica 402 Fs 0 0 (i) As Gr
> Gs 2156 10478 Tr 0 0 M [0.000 1.000 -1.000 0.000 0 0 ] Co -100 -144 Rm
> /Helvetica 402 Fs 0 0 (s) As Gr
>
> This may explain why you are limited to single characters for substituting with psfrag. At any rate, I am not optimistic that you could ever substitute multi-character strings without major changes to our postscript output. Perhaps it would be possible to write some kind of preprocessor for psfrag that would substitute actual strings for the above PostScript, but that sounds rather complicated.
>  -dave
> On Oct 23, 2011, at 11:37 AM, Benjamin R. Hillman wrote:
>
>> I am trying to mark-up figures made with NCL with tags to allow
>> replacement in LaTeX documents using psfrag. The issue I am running
>> into is that psfrag will find and replace a single character, but not
>> strings with length greater than one. I have attached a simple NCL
>> script and tex document that reproduce this limitation/bug/feature on
>> my machine using NCL 6.0.0, as well as the pdf output resulting from
>> running "latex testDoc && dvipdf testDoc". I suspect that maybe this
>> is a result of how NCL is writing the postscript files, but
>> unfortunately I know very little about postscript and can't confirm
>> this. My solution so far has been to just define an array of different
>> single characters and successively assign these to the various labels
>> I want to change, but in some of my panel plots with a lot of labels I
>> am running out of characters, and this is somewhat awkward. Thanks in
>> advance for any light you can shed on this problem.
>>
>> --
>> Benjamin R. Hillman
>> Graduate Research Assistant
>> UW Department of Atmospheric Sciences
>> <test.ncl><testDoc.tex><testDoc.pdf>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Benjamin R. Hillman
Graduate Research Assistant
UW Department of Atmospheric Sciences
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 24 11:36:14 2011

This archive was generated by hypermail 2.1.8 : Fri Oct 28 2011 - 10:52:03 MDT