6

I have one font -- PragmataPro. The bold version of this font lies in another family, Essential PragmataPro. I would like applications to use Essential PragmataPro Bold when it tries to use PragmataPro Bold.

Additionally, a bold weight of PragmataPro does not exist, and a regular weight of Essential PragmataPro does not exist. The first remark is the source of my problem.

This is what I have tried:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test name="family"><string>PragmataPro</string></test>
        <test name="weight" compare="more_eq"><const>bold</const></test>
        <edit name="family" mode="assign"><string>Essential PragmataPro</string></edit>
        <edit name="embolden" mode="assign"><bool>false</bool></edit>
    </match>
</fontconfig>

All it does is apply DejaVu Sans bold.

Any suggestions?

2 Answers 2

3

Adding binding="strong" to your first edit line like so:

<edit name="family" mode="assign" binding="strong"><string>Essential PragmataPro</string></edit>

should do the trick. It also seems that your second edit line:

<edit name="embolden" mode="assign"><bool>false</bool></edit>

isn't needed.

0

Move the bold lib you're currently using to another directory. Virtual Link (ln -s) the former name of your DejaVu Sans bold font lib to whatever lib you want.

You'll have to rebuilt your fontcache but this sort of thing works.

2
  • I don't think I would be a good idea to symlink DejaVu Sans...
    – Skip R.
    Commented Sep 24, 2016 at 1:57
  • Depends on your application. I've done exactly this in the embedded space for a product we sold (it absolutely works), but no one else was ever going to be getting to that level of the system so I had a lot more control on what the user could experience than others might. Commented Sep 24, 2016 at 2:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .