Skip to content

Instantly share code, notes, and snippets.

@dangmanhtruong1995
Last active April 24, 2024 15:05
Show Gist options
  • Save dangmanhtruong1995/1deb06f54cfa11d29d4be4e27a7208b7 to your computer and use it in GitHub Desktop.
Save dangmanhtruong1995/1deb06f54cfa11d29d4be4e27a7208b7 to your computer and use it in GitHub Desktop.
Check Type 3 font error during Latex paper submission.
#!/bin/sh
for f in ./*.pdf; do
echo $f
pdffonts "$f"
done

Sometimes, when you write a paper using Latex, and you submit to some conference, such as IEEE's for example, you might encounter this error, or some of its variants:

fonttype: Upload failed: Font DejaVuSans is of type Type 3

This is usually due to the fact that some of your figures in the paper uses Type 3 font, which needs to be changed. See here for more information: http://phyletica.org/matplotlib-fonts/

In order to fix this, you first need to find the PDF figures responsible. This can be done as follows:

  1. apt install poppler-utils
  2. pdffonts figure1.pdf

But for cases when you have too many figures, this might take some time. Here is the script, called checktype3.sh, which will do it for all PDF files in the current directory.

  1. chmod +x checktype3.sh
  2. ./checktype3.sh

Look for "Type 3" in the output, and redraw the files accordingly.

Tested on Ubuntu 22.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment