13

I have the Microsoft C-Fonts installed, and they're wonderful. However, Calibri appears as a bitmap font in a lot of the sizes that it appears. How do I tell fontconfig to forbid Calibri (and Cambria,etc.) from being rendered from the embedded bitmaps? I already have 70-no-bitmaps.conf in my /etc/fonts/conf.d/ directory.

The fonts in question can be extracted from the PowerPoint Viewer.

3 Answers3

21

/etc/fonts/conf.d/70-no-bitmaps.conf only rejects bitmap fonts, they don't disable embedded bitmaps, which is the case here. I don't know why they didn't put the setting to disable embedded bitmaps in the same conf file. Anyways, put the following in your ~/.config/fontconfig/conf.d/20-no-embedded.conf (or, for older versions of Ubuntu, in ~/.fonts.conf.d/20-no-embedded.conf):

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>

This will disable embedded bitmap for all fonts. If you want to disable only for select fonts, add <test> element:

<test name="family" compare="contains">
  <string>Calibri</string>
  <string>Cambria</string>
</test>

before <edit ....

Frederik
  • 189
syockit
  • 338
1

In the example you give you have the "<string>" attribute mentioned twice in the "<test>" stanza. This causes a warning on Ubuntu 13.10 and 14.04. To eliminate the warning the stanza in the file should look like:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <test name="family" compare="contains">
       <string>Calibri</string>
       <string>Cambria</string>
    </test>
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>
0

Using syockit's answer breaks emoji fonts in GTK3/4 apps including Firefox. Limiting the rule to Calibri and Cambria works. Alternatively you can apply it to all fonts except for color (emoji) fonts:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <test name="color" compare="not_eq">
            <bool>true</bool>
        </test>
        <edit name="embeddedbitmap" mode="assign">
            <bool>false</bool>
        </edit>
    </match>
</fontconfig>