How can I specify a more appropriate font substitution?

8,422

Solution 1

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).

Solution 2

Maybe you’ll need to install MS Core Fonts.

sudo apt-get install msttcorefonts
Share:
8,422
RusGraf
Author by

RusGraf

My goal here is usually to document.

Updated on September 18, 2022

Comments

  • RusGraf
    RusGraf over 1 year

    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?

  • RusGraf
    RusGraf almost 13 years
    Are you recommending that I just disregard the giant DO NOT EDIT THIS FILE warning at the top?
  • vermin
    vermin almost 13 years
    Not really, I've done similar substitutions in my local .fonts.conf. I'm editing my answer. Silly of me to think it's obvious which file I was talking about. Sorry.
  • BZ1
    BZ1 almost 13 years
    A better option would be to install Red Hat's Liberation fonts, which are near equivalents of popular Microsoft fonts, and substitute them as susggested by miloshadzic.
  • RusGraf
    RusGraf almost 13 years
    Thanks, this is just what I needed. I chose to use alias to keep it simple. ~/fonts.conf.
  • scruss
    scruss over 9 years
    Better to use the real thing, as ‘near equivalents’ don't cut it in publishing.
  • ovolve
    ovolve almost 8 years
    In the latest versions of Ubuntu, you can also do this through the GUI if you are using font-manager. In the Font Manager app there's a button in the bottom left for font preferences, and this brings up a menu which has "Alias Editor". You can edit font aliases in there. This gets written out to ~/.config/font-manager/conf.d/XX-aliases.conf.