Ubuntu – PFB fonts are broken in certain applications and missing in others (Kubuntu 20.04)

fontsinkscapekubuntutexlive

I am running Kubuntu 20.04. I have a problem where certain fonts (Courier and Century Schoolbook L) are broken in applications like Inkscape (where they are invisible) or font-manager where they show like this:
Font-manager with broken fonts

They also don't show up in Libre office (Don't really care about this as I rarely touch word-processors).

All broken fonts are .pfb fonts installed through TeX-live or ghostscript. As the font is already installed I am not able to install TTFs of the font I need. Obviously I do not want to uninstall ghostscript or tex-live as I use them regularly.

I have tried running

sudo fc-cache -f -v

to no avail. The font show up find in KFontView:
enter image description here

The bug is particularly frustrating as I have existing artwork in inskcape which used courier and Century Schoolbook L.

Is there a way to fix this?

Best Answer

Many programs have explicitly dropped support for Type 1 fonts, years ago. While fontconfig and FreeType do support Type 1 fonts, many other libraries and programs don't. In most cases, fontconfig just passes font locations to the program, which can either use another library or render them itself. That's why the fonts render inconsistently across programs.

Cross-platform applications, such as LibreOffice, Inkscape, and Firefox, in particular are likely to have dropped Type 1 support because they are working with the least common denominator. According to Wikipedia, "[Type 1 fonts] are not supported in the Windows GDI+, WPF or DirectWrite APIs." Other issues with Type 1 fonts are limited character set and absent unicode support.

Going forward, the trend is to see less and less Type 1 use. Ultimately, the only programs that will support it are the ones that have to, namely PDF/PS viewers and font editors. Once this happens, there's no easy way to recover Type 1 support except to go back to using software from five or more years ago, when Type 1 support was more prevalent.


To avoid seeing "broken" Type 1 fonts, you can configure fontconfig to hide them. This is basically jumping forward to where Type 1 support is heading.

Create the file /etc/fonts/conf.d/00-reject-type1.conf with the following contents:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "/etc/fonts/conf.d/fonts.dtd">
<fontconfig>

<selectfont>
   <rejectfont>
      <pattern><patelt name="fontformat">
         <string>Type 1</string>
      </patelt></pattern>
   </rejectfont>
</selectfont>

</fontconfig>

Then refresh the font cache with sudo fc-cache -r.

Font viewers and editors should continue to work as expected, as long as they access the font files directly.

PDFs with embedded fonts should display correctly. When external fonts are referenced, they should use the OpenType or TrueType font that fontconfig specifies. (I use Okular. Other Poppler based viewers should behave similarly.)


TrueType and OpenType versions of most Type 1 fonts are available. Many converted fonts have been extended with unicode support. Here are a few packages:

  • fonts-urw-base35
  • fonts-texgyre
  • fonts-lmodern

Some typefaces will have different names. If the fonts are installed via the package manager, fontconfig should be configured to substitute the correct fonts. If you install fonts by copying font files, you'll have to configure font substitution yourself or manually change font names in documents.

  • Avant Garde Gothic ~ TeX Gyre Adventor ~ URW Gothic
  • Bookman ~ TeX Gyre Bonum
  • Century Schoolbook ~ TeX Gyre Schola ~ C059
  • Chancery ~ TeX Gyre Chorus ~ Z003
  • Courier ~ TeX Gyre Cursor ~ Nimbus Mono
  • Dingbats ~ D050000L
  • Helvetica ~ TeX Gyre Heros ~ Nimbus Sans
  • Palatino ~ Palladio ~ TeX Gyre Pagella ~ P052
  • Times ~ TeX Gyre Termes ~ Nimus Roman

The behavior of TeX Live with Type 1 fonts hidden in fontconfig is as follows...

  • latex + dvipdf embeds Type 1C fonts.
  • pdflatex embeds Type 1 fonts.
  • xelatex and luatex embed Type 1C and CID Type 0C fonts.
    • TrueType and OpenType fonts can also be specified and embedded.

This is the test document I used:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{lipsum}
%%\usepackage{fontspec}
%\usepackage{mathspec}

%\setmainfont{Noto Serif}
%\setmonofont[Scale=0.8]{Noto Sans Mono}

%\setmathsfont(Digits,Latin,Greek){Noto Serif}
%\setmathrm{Noto Serif}

\begin{document}

\lipsum[1]

\[ \int_0^\infty \frac{1}{x} \;\mathrm{d}x \]

\raggedright
\tt{\lipsum[2]}

\end{document}
Related Question