Problem with CUPS/texttopdf and "Noto" truetype fonts

Solution 1:

The problem, apparently, is in one of the "noto" fonts, NotoColorEmoji, and texttopdf was choking on it.

I fixed this by creating the file /etc/fonts/local.conf and adding the lines

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <selectfont>
    <rejectfont>
      <glob>/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf</glob>
    </rejectfont>
  </selectfont>
</fontconfig>

Then run fc-cache -f -v to rebuild the font cache.

This disables the offending font and all is well.

BTW, credit where credit is due: See https://unix.stackexchange.com/questions/534284/reject-all-fonts-from-a-directory-except-one-with-fontconfig

Further note:

I decided to download the source code for cups-filters and the abort is indeed an assert in the library libfontembed in the function otf_get_width, snippeted here:

  // ensure hmtx is there
  if (!otf->hmtx) {
    if (otf_load_more(otf)!=0) {
      assert(0);
      return -1;
    }
  }

Sheesh. . .