Ubuntu – How to specify a more appropriate font substitution

evincefontspdf

A particular PDF I have uses a non-embedded font named "TimesNRMT" that is not installed on my system. Instead of substituting the font with a similar one such as Times New Roman, Document Viewer is inappropriately choosing to use some sans-serif font, which makes the text nearly unreadable:

screenshot

How can I override this choice of font substitution?

Best Answer

Create a rule in your .fonts.conf file. If it's not in your home folder, create it. Here's a full example of a .fonts.conf file:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <match target="pattern">
    <test name="family" qual="any" >
      <string>TimesNRMT</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>Times New Roman</string>
    </edit>
  </match>

</fontconfig>

If you already have the file, just paste in the part enclosed by the match tags.

If you're using Font Manager the file is in a different place(~/.config/font-manager/local.conf).