Hi all.
First, I've done my homework by searching through, and basically only found a solution of using proprietary Adobe Professional to 'optimize PDF' to possibly remove the duplicate fonts. Well, this still doesn't solve problem for those relying on *unix system,
The problem is simple, seeing too many of the same fonts in the final pdf, these also make the size larger, too. (including using gs, ps2pdf, pdflatex, etc)
I'm surprised that after searching hard for few days (and seeing some people with similar symptom), there's no real solution, i.e., if I have 100s of pdf figures, then I'll have 100's of the fonts.
Can someone please help. Using pdffonts, for example, I see.
ZBLNKV+Helvetica-Oblique Type 1C yes yes no 32 0
XGVVDE+Helvetica-Oblique Type 1C yes yes no 22 0
XGVVDE+Helvetica Type 1C yes yes no 26 0
XEXXRE+Helvetica-BoldOblique Type 1C yes yes no 38 0
ZBLNKV+Helvetica Type 1C yes yes no 29 0
XEXXRE+Helvetica-Bold Type 1C yes yes no 35 0
First, what the is the first 6 chars and + ? Maybe this is confusing the converter to think the fonts are completely different? How do I get rid of this in the first place, or how do I tell to ignore it?
Thanks
Graphics, Figures & Tables ⇒ duplicate, multiple font embed problem
NEW: TikZ book now 40% off at Amazon.com for a short time.

duplicate, multiple font embed problem
The random numbers at the beginning of the font name are an indication of font subsetting. (Source.) Typically when a PDF has embedded fonts, the entire font isn't embedded, but only the characters actually used. So "XGVVDE+Helvetica" isn't the entire Helvetica font, but some subset of it. "GHJDHD+Helvetica" would be a different subset of the same font.
So if you have both listed it's possible they don't overlap at all, but possible that they do. In your case, most likely each time you create a PDF figure to insert into your document, it gets one subset embedded in it, but since it's not quite the same subset as in any other figure, they're treated as different fonts. And yeah, there almost certainly is some redundancy in there.
I don't know how your PDF images are created or what they contain, but I would try to avoid putting text in them and instead add the text using LaTeX. If that's not feasible, then maybe see if there is a way to do complete font subsetting with them (maybe LaTeX would be smart enough to avoid duplicating complete fonts), or maybe avoiding embedding fonts altogether and then try to tackle that at the end with the final document.
Really, it's an interesting problem, though, and I don't really know of any easy solution (except possibly with Acrobat). Could you post a sample of a couple figures with overlapping but non-identical font subsets? It would be an interesting experiment to see if I or someone else could figure out a way to remove the redundancies -- no promises of course.
So if you have both listed it's possible they don't overlap at all, but possible that they do. In your case, most likely each time you create a PDF figure to insert into your document, it gets one subset embedded in it, but since it's not quite the same subset as in any other figure, they're treated as different fonts. And yeah, there almost certainly is some redundancy in there.
I don't know how your PDF images are created or what they contain, but I would try to avoid putting text in them and instead add the text using LaTeX. If that's not feasible, then maybe see if there is a way to do complete font subsetting with them (maybe LaTeX would be smart enough to avoid duplicating complete fonts), or maybe avoiding embedding fonts altogether and then try to tackle that at the end with the final document.
Really, it's an interesting problem, though, and I don't really know of any easy solution (except possibly with Acrobat). Could you post a sample of a couple figures with overlapping but non-identical font subsets? It would be an interesting experiment to see if I or someone else could figure out a way to remove the redundancies -- no promises of course.
Re: duplicate, multiple font embed problem
Thanks a lot, really appreciated.
sure, I'm working on the examples, and I'll get back asap.
sure, I'm working on the examples, and I'll get back asap.
Re: duplicate, multiple font embed problem
Ok, here's the two pdf and eps images
a.pdf (and a.eps)
b.pdf (and b.eps)
As you can see, I have fully embedded the fonts in them, so they display nicely like this
Helvetica Type 1C yes no yes 17 0
Helvetica Type 1C yes no yes 26 0
I used the pdflatex, e.g.,
\includegraphics[width=4.5cm, height=3.6cm]{a.pdf}
\includegraphics[width=4.5cm, height=3.6cm]{b.pdf}
So I used latex to dvips/ps2pdf (I converted them to a.eps and b.eps)
\includegraphics[width=4.5cm, height=3.6cm]{a.eps}
\includegraphics[width=4.5cm, height=3.6cm]{b.eps}
Once again, the problem still occurs, I see two same fonts.
Of course (and strangely) if I just includegraphics the same file many times, I only get a single font
In other words, for both a.pdf and b.pdf, I can include them as many as I want, and at most two (same) fonts will be embedded. If I have 3 of the pdfs, at most, three fonts shown, etc.
There's some tools like pdfsizeopt, but it didn't work, there's still the same fonts,
About your comment on avoiding putting text or embedding them (and make the final latex all-in-one). By any means, how do I do it? I'm happy to try that, either in eps or pdf format?. With just a simple Helv font in them and if latex can do it, that would be great too, or some matlab tool aid?
thanks a lot.
a.pdf (and a.eps)
b.pdf (and b.eps)
As you can see, I have fully embedded the fonts in them, so they display nicely like this
Helvetica Type 1C yes no yes 17 0
Helvetica Type 1C yes no yes 26 0
I used the pdflatex, e.g.,
\includegraphics[width=4.5cm, height=3.6cm]{a.pdf}
\includegraphics[width=4.5cm, height=3.6cm]{b.pdf}
So I used latex to dvips/ps2pdf (I converted them to a.eps and b.eps)
\includegraphics[width=4.5cm, height=3.6cm]{a.eps}
\includegraphics[width=4.5cm, height=3.6cm]{b.eps}
Once again, the problem still occurs, I see two same fonts.
Of course (and strangely) if I just includegraphics the same file many times, I only get a single font
In other words, for both a.pdf and b.pdf, I can include them as many as I want, and at most two (same) fonts will be embedded. If I have 3 of the pdfs, at most, three fonts shown, etc.

There's some tools like pdfsizeopt, but it didn't work, there's still the same fonts,
About your comment on avoiding putting text or embedding them (and make the final latex all-in-one). By any means, how do I do it? I'm happy to try that, either in eps or pdf format?. With just a simple Helv font in them and if latex can do it, that would be great too, or some matlab tool aid?
thanks a lot.
- Attachments
-
- image.zip
- (147.56 KiB) Downloaded 195 times
duplicate, multiple font embed problem
Thanks for this. I want to play around with these some more when I have some more time, though I do already have one interesting fact to report. Suppose I make a file, sample.tex:
And then call pdflatex on it, using the a.pdf and b.pdf you just uploaded. As you report, pdffonts then lists Helvetica twice:
But suppose I then take sample.pdf and run it through it through ps2pdf (yes, despite its name, ps2pdf accepts pdf files as input, not just ps files -- this makes it a good way to change pdf version numbers, etc.):
If I then run pdffonts output.pdf, I get:
Helvetica is only listed once. The file size is also drastically cut down. Now, most of that is probably the subsetting, since you'll notice it's now subsetted. But this might work in helping with your problem (though it might also generate others; I'm not sure if ps2pdf would preserve things like hyperlinks and metadata with pdf input... I haven't really experimented with it.)
Unfortunately, I don't know anything about matlab and I don't know of any tricks with it. I've never used it. Inkscape does have a nifty feature that lets you export a PDF along with a LaTeX file where the LaTeX file contains the code for the text to overlay on the picture. I'm not sure how practical it would be for you, however. (And of course, if you generate the diagram internally using pstricks or tikz etc., there is no issue...)
I do think it would be worth trying to export the files without embedding the fonts, however, and then try to embed the fonts later on. I know from experience that if you include PDF graphics with fonts that aren't embedded, and then run the output of LaTeX through ps2pdf, the fonts get embedded then.
Code: Select all
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\pagestyle{empty}
\includegraphics[scale=0.25]{a}
\includegraphics[scale=0.25]{b}
\end{document}
Code: Select all
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Helvetica Type 1C yes no yes 11 0
Helvetica Type 1C yes no yes 20 0
Code: Select all
ps2pdf sample.pdf output.pdf
Code: Select all
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
ANJPTB+Helvetica Type 1C yes yes no 8 0
When I made that remark, I mainly had in mind something like the overpic package, but I didn't really know what your figures were like. If they're like a and b, then that method probably wouldn't work out too well, since manually lining up labels of the grid in the right spot would be too much work to make it worthwhile probably.About your comment on avoiding putting text or embedding them (and make the final latex all-in-one). By any means, how do I do it? I'm happy to try that, either in eps or pdf format?. With just a simple Helv font in them and if latex can do it, that would be great too, or some matlab tool aid?
Unfortunately, I don't know anything about matlab and I don't know of any tricks with it. I've never used it. Inkscape does have a nifty feature that lets you export a PDF along with a LaTeX file where the LaTeX file contains the code for the text to overlay on the picture. I'm not sure how practical it would be for you, however. (And of course, if you generate the diagram internally using pstricks or tikz etc., there is no issue...)
I do think it would be worth trying to export the files without embedding the fonts, however, and then try to embed the fonts later on. I know from experience that if you include PDF graphics with fonts that aren't embedded, and then run the output of LaTeX through ps2pdf, the fonts get embedded then.