Hi Chris, Michael et al.,

On Thu, Nov 12, 2009 at 7:29 AM, Chris van Dijk <[email protected]> wrote:
> Yes you are right, by looking into the eps file I can see that the
> fonts are embedded in there (as a side note does anybody know of a
> convenient tool like pdffonts for eps?). So the problem is obviously
> not with PyX. Apologies for bothering you guys then...
>
> I will just need to figure something else out, as the text in my
> figures does not show up in the merged pdf compiled from my tex file by
> the system. I would prefer not to use a standard font for the figures,
> as the rest of the article is in computer modern too. I use the
> graphicx package to include the figures if it matters.

In my experience with most journals (with some honorable exceptions),
their definition of an "acceptable" figure is one that works with
their buggy, outdated, proprietary software. Figures produced by
LaTeX, PyX, etc often do clever things with the EPS that, even though
they may be perfectly standards-compliant, often throw a spanner into
their inflexible workflow. Two recent examples that I remember off the
top of my head are negative values in the bounding box (which
apparently confuses the hell out of some old version of Adobe
Illustrator), and that my fonts, although embedded, were also
subsetted, which they did not like.

There is little point in fighting with them about this. The easiest
approach is to simply post-process your PyX-created graphics to
convert them into high-resolution, anti-aliased raster images or
low-level vector postscript commands before you submit the figures.
Which is more appropriate depends on the nature of your figures. A
side effect of converting to low-level postscript (e.g., with
ghostscript's epswrite device) is that all the text is converted to
outlines, so there are no longer any fonts in your file at all.

Below I have pasted an example bash script that I wrote a few years
back, which does a bit of both. You probably already have gs, but you
will likely have to download http://imgtops.sourceforge.net, which is
a (now old and seemingly unmaintained) python package that includes
both the imgtops and epstoimg utilities. On the other hand, there may
now be better ways of embedding raster images in EPS.

The script sanitizes each figure listed in figlist.txt according to
the heuristics described in the comments. Maybe you will find it
useful.

On a more positive note, I have noticed that journals that have gone
over to an all-PDF workflow seem to be able to deal much better with
PyX-generated figures. So these steps may become increasingly
unnecessary as EPS dies out in scientific publishing.

Cheers

Will

#! /bin/bash
#
# convertfigs.sh - Will Henney ([email protected]) 11 Sep 2006
#
# Revised 28 Dec 2006 to do revised version of paper (one new figure)
#
outdir=../Revised
i=0
for origfig in $(cat figlist.txt); do
    i=$(( i + 1 ))
    newname=$outdir/f$i
    if [ -f $origfig.eps ]; then
        # these are files written by PyX - need to pass through gs
        # to convert all fonts to outlines
        echo "$newname: converting fonts to outlines"
        gs -dBATCH -dNOPAUSE -dSAFER -q -dEPSFitPage \
            -dNOCACHE -sDEVICE=epswrite \
            -sOutputFile=$newname.ps $origfig.eps
    elif [ -f $origfig.pdf ]; then
        # convert PDF to image with width 1600 pixels
        printf '%s' "$newname: converting to image..."
        epstoimg -v -w 1600 -o $origfig.png $origfig.pdf
        # then embed in a PS file
        printf '%s\n' "... and embedding in PS"
        imgtops -v -o $newname.ps $origfig.png
    else
        # already an image, just embed in a PS file
        echo "$newname: embedding in PS"
        imgtops -v -o $newname.ps $origfig.jpg
    fi
done





-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to