wch / extrafont

Tools for using fonts in R graphics
313 stars 49 forks source link

EPS processed with embed_fonts() fails to show up in Word 2007 while embedFonts() with defaults does #22

Open mlt opened 11 years ago

mlt commented 11 years ago

I installed this package from CRAN (0.12). I imported system fonts, loaded fonts for postscript, and tried to create a postscript device with Verdana font family. I tried Calibri as well.

I got some unknown AFM entity encountered warnings, and it looks like character width is not estimated well as I can see with XnView image viewer. Nevertheless I can insert this file into MS Word 2007 though with ugly preview generated from wrong fonts.

If I try to embed fonts with embed_fonts, I get EPS unusable in MS Word. It adds as an icon when I drag it there. If I try to insert it, it says An error occured while importing this file. <full path name to my file.eps>.

If I try to epstool --test-eps one_generated_with_embed_fonts.eps, I see the following:

GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
"C:\Program Files\gs\gs9.05\bin\gswin32c.exe"  -dNOEPS -dNOPAUSE -dBATCH -dNODISPLAY  "c:\docume~1\tito0003\locals~1\temp\gsviewa03704"
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
EPSWARN FAIL: EPS file must not set page size: /a4

EPSWARN FAIL

"C:\Program Files\gs\gs9.05\bin\gswin32c.exe"  -dNOPAUSE -dBATCH -sDEVICE=bbox   -c "<</PageSize [9400 9400] /PageOffset [3000 3000]>> setpagedevice" -f "c:\docume~1\tito0003\locals~1\temp\gsviewa03704"
%%BoundingBox: 0 0 0 0
%%HiResBoundingBox: 0.000000 0.000000 0.000000 0.000000

File has   %%BoundingBox: 0 0 504 360
Correct is %%BoundingBox: -3000 -3000 -3000 -3000
File bounding box needs to be larger
File used PostScript operators that are prohibited in an EPS file.
File is not EPS.
FAIL: File does not comply with EPS specification.
Failed

The weird thing is that if I just use embedFonts(args[1], outfile=args[2]), it does produce useable EPS, though fonts are missing.