[texworks] Embed fonts with ps2pdf - argument parsing problem

Brandon Kuczenski brandon.kuczenski at 301south.net
Wed Jul 25 03:48:58 CEST 2012


On 7/24/2012 5:55 PM, Reinhard Kotucha wrote:
> On 2012-07-24 at 12:49:04 -0700, Brandon Kuczenski wrote:
>
>  > On 7/23/2012 12:35 AM, Siep Kroonenberg wrote:
>  > > On Mon, Jul 23, 2012 at 07:50:26AM +0200, Stefan Löffler wrote:
>  > >> Hi,
>  > >>
>  > >> On 2012-07-21 01:07, Brandon Kuczenski wrote:
>  > >>> I know this question has been "answered" on this list before, namely here:
>  > >>>
>  > >>> http://tug.org/pipermail/texworks/2009q2/000822.html
>  > >>>
>  > >>> However, the solution included there does not embed fonts,
>  > >>> which is clearly not acceptable.  Because of the byzantine
>  > >>> argument parsing that happens between the batch file and Tw, I
>  > >>> cannot for the life of me figure out how to pass the options
>  > >>> "-dEmbedAllFonts=true -dPDFSETTINGS=/prepress
>  > >>> -dCompatibilityLevel=1.4" to ps2pdf from within TexWorks.  > >>
>  > >>> Assuming the batch file cited above works for you (I don't have
>  > >>> Windows > >> w/ TeX available at the moment to test), you can
>  > >>> modify it to
>  > >>
>  > >> @latex %1 && dvips "%~dpn1.dvi" && ps2pdf -dEmbedAllFonts=true -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.4 "%~dpn1.ps"
>  > >>
>  > >>
>  > >> to pass additional parameters to ps2pdf. Note that this has to be done
>  > >> in the batch file, the TeXworks configuration is unchanged.
>  > > Or replace '=' with '#'. I recall that that may be needed for
>  > > Windows batchfiles when invoking Ghostscript.
>  > >
>  > 
>  > Sorry, it does not work. 
>
> I tested it on Gentoo Linux and it works.  I also tried ancient
> gs-8.60 and it works there too.
>
>  

Thanks.  I do believe the OP mentioned the problem was platform-specific. 

>
>
>
> When I run
>
>   latex TW-test.tex
>   dvips TW-test.dvi
>   ps2pdf TW-test.ps
>
> I get
>
>   $ pdffonts TW-test.pdf
>   name                          type         emb sub uni object ID
>   ----------------------------- ------------ --- --- --- ---------
>   AQAEUC+CMR10                  Type 1C      yes yes no      10  0
>   GAXVVL+NimbusSanL-Regu        Type 1C      yes yes no       8  0
>
> even with gs-8.60.  I'm wondering why you need -dEmbedAllFonts at all.
>
> What's the output of pdffonts if *you* run pstopdf without the
> -dEmbedAllFonts option?
>


I do believe the OP mentioned that fonts were not properly embedded!  I
assure you, I have no problem building documents properly using
command-line tools on a well-outfitted computer.  Unfortunately, I do
not have that liberty. 

For your edification, here is the output:
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
OTJKZH+CMR10                         Type 1C           yes yes no       9  0
Helvetica                            Type 1            no  no  no       8  0

Incidentally, I can tell the font is not embedded because the TW viewer
helpfully does not display non-embedded fonts, allowing me to spot the
problem instantly.

Thank you for the suggestion to remove the ostensibly superfluous
command switches -dPDFSETTINGS and -dCompatibilityLevel, and to remove
the "=true" (or "#true") from the command switch; unfortunately, the
program's behavior is unchanged: the psfile is bogus and the pdf does
not build.

Anyone out there use Windows?  I mean, if not, I can certainly see why.. 

I've been using a virtual machine running linux as a workaround, but
that is its own headache and I've been hoping for a proper solution. 
Also, it is embarrassing to have to tell ALL my colleagues, "no, sorry,
there is in fact no way to do this on Windows."  Because in my field,
nobody uses linux.  Professionally, it turns out to be something of a
black mark to be that sort of outlier.

As for the gs version, I had version 9.02 installed; as of now I have
version 9.05 installed.  I don't know how to get TW to use the new
version- it doesn't seem to be configurable in any of the dialogs.  I
suspect it has something to do with MikTeX, which is its own abomination
but not the subject of this thread.

(checks)

Yes, indeed, MikTeX comes bundled with its own version of ghostscript
and yes, it's dated to 2007. sigh. 

-Brandon




More information about the texworks mailing list