You are not logged in.

#1 2013-08-28 22:17:24

x2b
Member
Registered: 2012-05-13
Posts: 23

[Solved] Substituting an unknown font in a pdf

Hello all,

I just downloaded a pdf that has some fonts which are not included in my font selection. evince tells me that their names are "CourierNewPSMT" and  "CourierNewPS-BoldMT". Unfortunately, the font manager seems to think that it is a good idea to substitute "Liberation Mono" (a monospace font!). I think that a pdf containing only monospace fonts is rather annoying, so I would like to substitute "Liberation Sans" instead. To this end I created a file "~/.config/font-manager/local.conf" containing
the following xml code:

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

  <match target="font">
    <test qual="any" name="family">
      <string>CourierNewPSMT</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>Liberation Sans</string>
    </edit>
  </match>

</fontconfig>

I restarted evince, I noticed that the file is read (evince complains if the syntax is wrong), but unfortunately the substitution remains the same.
Does anyone know how to correctly substitute fonts using font-manager?

Last edited by x2b (2013-09-03 14:32:15)

Offline

#2 2013-08-28 22:37:57

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] Substituting an unknown font in a pdf

An example fontconfig rule:

    <match>
        <test name="family"><string>Trebuchet</string></test>
        <edit mode="assign" name="family" binding="strong">
            <string>Trebuchet MS</string>
        </edit>
    </match>

Offline

#3 2013-09-02 15:55:24

x2b
Member
Registered: 2012-05-13
Posts: 23

Re: [Solved] Substituting an unknown font in a pdf

Well I tried this:

  <match>
      <test name="family"><string>CourierNewPSMT</string></test>
      <edit mode="assign" name="family" binding="strong">
          <string>Liberation Sans</string>
      </edit>
  </match>

But the font is still subsituted by "Liberation Mono". I am unsure whether this night not be a problem specific to evince: If I type in

fc-match "CourierNewPSMT"

on a terminal then the response is

LiberationSans-Regular.ttf: "Liberation Sans" "Regular"

.

Offline

#4 2013-09-03 14:18:06

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] Substituting an unknown font in a pdf

It might be e.g. "Courier New PSMT" instead. Might be able to see with:

FC_DEBUG=1 evince blah.pdf

Offline

#5 2013-09-03 14:32:01

x2b
Member
Registered: 2012-05-13
Posts: 23

Re: [Solved] Substituting an unknown font in a pdf

Ok, it was "Courier New", thank you, problem solved

Offline

Board footer

Powered by FluxBB