|
Home |
Electronic Figures |
|
|
I've stumbled on this problem so many times that I must write down the inner secrets Embedding fonts Many programs make PostScript (or Encapsulated PostScript) output without fonts. This reduces file size. The notion is that modern printers and operating systems have the standard set or PostScript fonts available somewhere and can supply them when a drawing application starts processing a PostScript file and runs into commands that need to draw the fonts. Although standard fonts are standard , journals still often require that submitted figures have embedded in the file the actual fonts used when the originating program composed the figure and emitted the original PostScript code. That may mean you have to stick Helvetica fonts into the file even though probably every publishing house in the Western world has Helvetica fonts. How to do this? Under a recent version of Linux, there should be ghostscript along with its full complement of free fonts. Assuming a file foo.eps originally composed under a Linux-like environment, this command makes a new file bar.eps with the necessary fonts embedded: gs -sDEVICE=epswrite -dSAFER -dNOPAUSE -dBATCH -sOutputFile=bar.eps foo.eps Files tend to grow in size by about 10 kB for every font family embedded. If the file grows A LOT, like 200 kB, then the font has been rasterized, and this will result in reduced quality characters when the figure is subsequently rendered. One uses vector fonts specifically to avoid ugly this problem. Verifying the Existence of Embedded fonts How do you know the fonts are in there? This has worked on EPS files built under Matlab:
Update: Embedding fonts screws things up! After I embedded the fonts into the EPS file as indicated above, I had more problems because the Bounding Box of the new file was wrong, in fact, generally too small. This problem primarily occurs with EPS files generated in Matlab. I did not have this problem with EPS files generated with Abode Illustrator or R. The only solution I found (tried multiple) was this: Use the program ps2eps to write a new EPS file. (Despite the name, I applied it to input EPS files.) Like this: ps2eps --ignoreBB -H --loose foo.eps This will make an outputfile named "foo.eps.eps" (I.e., it appends ".eps" to the input file name) AND if foo.eps.eps exists, it will refuse to output. There are various tricks used to query the Bounding Box for an EPS file. Ignore all of them. The only sure way to determine the bounding box is to look in the file (editor, grep) for the line with the string %%BoundingBox: . PDF Files Here is the other way to examine a file for embedded fonts. If you have a PDF file "foo.pdf", execute pdffonts foo.pdf . This should summarize the font situation in the file, specifically if fonts are embedded. |
||