42

For a publisher I have to generate a pdf file which does not contain any Type3 fonts.

Until now I thought that using pdflatex on current LaTeX distributions should be enough to get a pdf file without any Type3 fonts, but for the current document this is not true:

$ pdffonts paper.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
ZFUCHW+NimbusRomNo9L-Medi            Type 1            yes yes no      41  0
VNQOQC+NimbusRomNo9L-Regu            Type 1            yes yes no      42  0
[none]                               Type 3            yes no  no      43  0
NXAFJF+NimbusRomNo9L-ReguItal        Type 1            yes yes no      46  0
CBNMRR+NimbusRomNo9L-MediItal        Type 1            yes yes no      48  0
MNSAJN+NimbusRomNo9L-Regu-Slant_167  Type 1            yes yes no      52  0
FJTKHV+CMSY7                         Type 1            yes yes no      53  0
VVITQE+CMMI9                         Type 1            yes yes no      54  0
CHSHRJ+CMR9                          Type 1            yes yes no      56  0
EAPUQB+CMR6                          Type 1            yes yes no      57  0
KBHVYI+CMMI6                         Type 1            yes yes no      58  0
EHULJT+CMTI9                         Type 1            yes yes no      59  0
JLLCEK+CMSY9                         Type 1            yes yes no      61  0
YEIEPQ+CMEX9                         Type 1            yes yes no      64  0
DFKMIY+CMSY8                         Type 1            yes yes no      84  0
NEDAGG+CMSY6                         Type 1            yes yes no      87  0
QDTWCG+MSBM10                        Type 1            yes yes no     127  0
[none]                               Type 3            yes no  no     198  0
OKAOPP+CMMI8                         Type 1            yes yes no     199  0
TIGOKK+CMR8                          Type 1            yes yes no     200  0
GWSFMB+CMTI8                         Type 1            yes yes no     201  0
[none]                               Type 3            yes no  no     397  0

I am surprised that all the Type3 fonts haven't a real name.

The document uses the sigplanconf documentclass. For figures only the tikz and listings packages are used (no graphicx package is used, i.e. no \includegraphics is used and no postscript files are embedded).

I am using Ubuntu 10.04 with TeX Live:

$ pdflatex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)

I have found an ACM FAQ about Type1 fonts, but it seems to be outdated and the suggested method still yield pdf files with Type3 fonts.

pk fonts: Looking for pk fonts in the doc.log find I found this ouput:

 75i,27n,56p,866b,2711s stack positions out of 5000i,500n,10000p,200000b,50000s
 </mnt/max/.texmf-var/fonts/pk/ljfour/jknappen/ec/ectt0800.600pk> </mnt/max/.texmf-var/fonts
 /pk/ljfour/jknappen/ec/ectt0900.600pk>{/usr/share/texmf-texlive/fonts/enc/dvips/base/8r.enc} 
 </mnt/max/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecss0900.600pk>

What could be reasons for this? Is some font package missing? Or has it something to do with tikz?

3
  • 1
    Installing the cm-super fonts package seems to be the easy answer to me.
    – user18839
    Sep 17, 2012 at 20:18
  • @Ryan, this is already mentioned in an upvoted comment of the accepted answer. Please upvote it as well. You could even post a new short answer to the same effect - which I would upvote. Sep 20, 2012 at 18:11
  • 2
    In my case, what caused my pdf to have type 3 fonts is that I used the bbm package for the mathematical indicator sign. Aug 18, 2016 at 8:29

9 Answers 9

13

Look at the end of the log-file of pdflatex. It will tell you which fonts are included and which are bitmap (pk) fonts.

4
  • Thanks, I've found some pk fonts the log file (see the update) - I have no real idea, where they are coming from, though ... May 20, 2011 at 13:27
  • 6
    Install the cm-super fonts. May 20, 2011 at 14:02
  • 1
    thanks a lot, with the cm-super package installed there aren't any Type3 fonts included anymore in the pdf file. May 20, 2011 at 14:09
  • 5
    The bbm package, which you might want to use to write blackboard bold numbers, is a source of Type 3 fonts. Try the dsfont package instead.
    – nemarona
    May 27, 2015 at 15:42
9

First off, most people use pdflatex nowadays. Change every image to pdf if possible replacing eps files by pdf using

     convert file.eps file.pdf

convert is found in the imagemagick package. Remove epsfig and use includegraphics instead.

Next run:

     pdffonts final_upload_document.pdf | less

to ensure that a type 3 font problem is actually the issue. If it isn't then the problem is most likely related to spaces in file names.

Next run:

     pdffonts each_image.pdf

to find any type 3 fonts on the individual pdf files to find which image is causing the problem. It could be an xfig or matlab problem, or a problem from another image generator.

If the contained pdfs don't create the issue, then it is most likely an include such as blackboard fonts that is causing the problem inside the source latex file.

Using the above method I found in particular that xfig in addition to matlab can cause the same artefacts if you are using export to latex+pdf part.

When you find the pdf + latex file you can run:

  xfig -specialtext -latexfonts -startlatexFont default

to start up xfig with the right settings. You also might find as in my case that the xfig image was generated some years ago that was to go into the paper, and that it now doesn't even open in newer versions of xfig giving a sigsegv fault. In this case your only option is to regenerate the image using the above xfig call.

1
  • 3
    Very interesting, I found the exact source of the xfig Type 3 font problem. It occurs not in the text fonts, but in the patterned polylines. If you use filled instead of patterned polylines and export to pdf/latex, you will then find that pdffonts will not return a type 3 font on your pdf. Nov 12, 2015 at 12:52
8

A Type 3 font is not by default a bitmap font. It means only not a Type 1 one. This is the reason why a Type 3 font can also be a vector font. If there is no listed pk font in the log file, then you have such a type 3 font included. It may also be loaded by an image with \includegraphics

3
  • Ok, I've found some pk fonts and I am not using includegraphics (updated the question). May 20, 2011 at 13:29
  • then show exactly your font setting in the preamble. However, it looks like that you are using the package times instead of mathptmx. Right?
    – user2478
    May 20, 2011 at 14:00
  • no, I am not using the times package - the system was missing the cm-super package - see my comment to Ulrike Fischer's answer. May 20, 2011 at 14:12
7

When including graphics coming from matplotlib, they may contain a Type3 font. However, matplotlib can be instructed to use tex rendering and the correct font family:

import matplotlib.pyplot as plt

plt.rc('text', usetex=True)
plt.rc('font', family='serif')
3
  • I had a similar problem and in my case figures generated by matplotlib were the ultimate culprit. Thanks for this answer! Jan 26, 2019 at 3:46
  • I tried this and ran pdffonts fig.pdf on the output figure from matplotlib and it was still chock full of the type 3 fonts May 10, 2019 at 18:16
  • 1
    This did not work for me, but i agree matplotlib figures were the culprit. This other solution worked for me: phyletica.org/matplotlib-fonts May 14, 2019 at 13:58
7

I also had an issue with an image generated by matplotlib, and tried other suggestions proposed here but none of them really helped. What finally worked was an advice I found here (http://phyletica.org/matplotlib-fonts/):

import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42

After I regenerated images my PDF was finally free of Type3 fonts.

1
  • 1
    This is the best solution for matplotlib, IMO, as it doesn't seem to otherwise change the appearance. Apr 20, 2020 at 14:52
5

I solved this by adding the following command to the head of my latex file:

\pdfminorversion=4              % tell pdflatex to generate PDF in version 1.4
2
  • Can you be a little more explicit in what this is ... answers get reordered by votes and the antecedent is no longer clear. Maybe this answer should be a comment to another answer (than it it not moved away from it)? Jan 17, 2017 at 16:34
  • Sorry, I am unable to say why this worked for me. In case somebody else has insight, he is free to edit my answer and extend it. Jan 17, 2017 at 17:48
3

As a complement to the answer by Eamonn Kenny: once you have identified the offending figure containing the problematic font, opening it in Inkscape and exporting it to PDF with the export option "convert text to paths" gets rid of all fonts.

In my case, the publisher website still gave a vague error message, and the solution by Peter Pablo solved it finally: forcing PDF v1.4 ensured compatibility

N.B. I have too low a reputation to comment or upvote, hence this post.

1

cm-super did not work for me, as it turns out that the Type-3 fonts were loaded from the pictures. The easiest fix: just save your pdf file with Apple Preview or Adobe Reader and it will do the trick!

3
  • Welcome! This does not answer this question because you, unlike the OP, were including external images which used type3 fonts. On the other hand, the OP, unlike you, had type3 fonts solely as a result of not having type1 versions of the T1-encoded CM fonts available. Obviously, cm-super won't help in your case, but neither will your suggestion help in the OP's. That is, you have a quite distinct problem which is unrelated to this one. Have I missed something?
    – cfr
    Mar 6, 2018 at 1:44
  • @cfr it might be a different issue, but googling brought me here, and my problem is more similar to Mauro's problem so it is helpful to me to know of this approach.
    – FionaSmith
    Aug 29, 2018 at 1:55
  • @FionaSmith To say that it does not answer the question is not to say that it may not be a useful answer to a different question. So it may be useful to you, but it still doesn't answer this question. For one thing, the OP clearly can't use Apple Preview and almost certainly can't use Adobe Reader either.
    – cfr
    Aug 29, 2018 at 23:55
1

If you are using figures generated by matplotlib and these figures are the source of font type, there are two key settings: pdf.fonttype and ps.fonttype. You have to change these settings from the default of 3 to the alternative 42. You can do this in your matplotlibrc file with:

pdf.fonttype : 42
ps.fonttype : 42

Or, you can change these settings in your code using:

import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
3
  • Since the OP explicitly does not use external graphics or references matplotlib in any way, this doesn't really answer the question. It might still be useful for matplotlib users, but I think that it should at least mention that the settings are related to matplotlib and that this solution only applies if the issue is caused by using that library. Feb 10, 2022 at 10:42
  • Yes, indeed. I edited the answer. In my case, these settings to matplotlib solved the Type3 font issue. Feb 11, 2022 at 15:10
  • RT. This did the trick for me too, matplotlib version 3.6.2. (I agree with Marcel Kruger that the OP didn't ask about matplotlib, so it might be useful to post this somewhere else too) Feb 22 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .