How to get Calibri font to display nicely

17,870

MS-C fonts embedded bitmaps

Per comments to this answer, the most common problem with MS C-fonts (Cambria, Calibri...) is that they use embedded bitmaps. To change this disable them. Either in

  1. ~/.fonts.conf
  2. or ~/.config/font-manager/local.conf in 14.04; Font Manager reserves the right to manage the ~/.fonts.conf file, thanks @Alain)
  3. or ~/.config/fontconfig/fonts.conf (per @SpinUp and @Glutamine's comments) you need to add this XML snippet:
<!-- disable embedded bitmaps in fonts to fix Calibri, Cambria, etc. -->
<match target="font">
   <edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>
</match>

Antialiasing toggle

You should be able if you toggle configs in /etc/fonts/conf.avail/, namely antialiasing, less so autohinting. How to do so: change the true to false in 10-antialias.conf or vice versa and you toggled the antialiasing and can see if it helps. Similarly for 10-autohinting.conf. This toggles the setting for all fonts AFAIR, so just take a look if it helps your case, you'll know if the problem is there or not.

Note: read-only file needs sudo to be modified (or needs to be made write-also prior to writing to it), so whatever your editor is (mine is vim), run it with sudo: sudo vim /etc/fonts/conf.avail/10-antialias.conf.

animated gif showing which true to change to false

Cache rebuilding and font-stack changes

Also, oft-advised solution with fonts is rebuilding cache: sudo fc-cache -v -f. Especially if you made changes to font stack (installed new fonts, deleted, moved etc.).

Also, what does fc-match calibri display? Why I ask: in my case to display Calibri well, I had to fall back to DejaVu Sans, otherwise I had a missing ligatures problem: see my Calibri question here. I did that by deleting the Calibri regular font file (.ttf). So, for me, fc-match output is as follows:

➜  ~  fc-match calibri
DejaVuSans.ttf: "DejaVu Sans" "Book"
Share:
17,870

Related videos on Youtube

artfulrobot
Author by

artfulrobot

Stitching together websites, databases and open source cunning to help you change the world.

Updated on September 18, 2022

Comments

  • artfulrobot
    artfulrobot over 1 year

    I have Calibri installed because it's the default font for M$ Office and so many of my clients send me documents using this font.

    But it displays without anti-aliasing which is horrible. It's like being on a Windoze machine again :-O

    screenshot

    It only seems to happen at small sizes; it's antialiased at larger sizes. Can I disable this?

    EDIT:

    My /etc/fonts/config.avail/10-antialias.conf contains

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <!--  Use the Antialiasing -->
      <match target="font">
        <edit name="antialias" mode="assign"><bool>true</bool></edit>
      </match>
    </fontconfig>
    

    And

    % fc-match calibri          
    calibri.ttf: "Calibri" "Regular"
    
  • artfulrobot
    artfulrobot about 9 years
    I've added that info to my question - not sure what to do in the conf.avail/ file?
  • Jos
    Jos about 9 years
    What exacly do you mean by "toggle configs, namely antialiasing, less so autohinting"?
  • LAFK says Reinstate Monica
    LAFK says Reinstate Monica about 9 years
    Expanded my answer. You toggle by switching "true" to "false" and vice versa, this enables/disables given setting, here: antialiasing.
  • artfulrobot
    artfulrobot about 9 years
    Wow love the gif video! Well, yes, I can use that file to turn off antialiasing for ALL fonts, but the question is how to turn it ON for Calibri. Your other solution (uninstalling Calibri) is not what I'm after either because different fonts have different spacings, so changing font messes up layout and pagination.
  • LAFK says Reinstate Monica
    LAFK says Reinstate Monica about 9 years
    Glad you liked it. :-) Byzanz is awesome for these. Have you tried my solutions temporarily? To see if there lies the problem? What were the results? What about cache rebuilding? Is your layout/pagination designed ONLY for Calibri? That's rather bad practice, designing for one font only, without fall-back (as there will be cases you won't have Calibri on the machine you display content on). I can't help you without exact information (what you did, how, what was the result, where you see the problem, etc.), because I can't replicate your problem on my machine (see linked question). :(
  • artfulrobot
    artfulrobot about 9 years
    The last tip worked! As for layout, I'm talking about word docs etc. that others send me (therefore I have no control over their creation). Anyway, thanks for the great answer.
  • Alan De Smet
    Alan De Smet over 8 years
    The last tip worked for me (Kubuntu 14.04). I think it's the more correct answer given the question. Perhaps move it to the top of the answer? Also, on 14.04, ~/.config/font-manager/local.conf may be the better location; Font Manager reserves the right to managle the ~/.fonts.conf file.
  • LAFK says Reinstate Monica
    LAFK says Reinstate Monica over 8 years
    @AlanDeSmet done.
  • SpinUp __ A Davis
    SpinUp __ A Davis about 8 years
    Adding the config in the font-manager directory had no effect for me (14.04). The correct location for the file was ~/.config/fontconfig/fonts.conf, which solved my problem.
  • Tim Richardson
    Tim Richardson about 7 years
    thanks. On ubuntu 16.04 I added the file in ~/.fonts.conf and after logging out and in, it looks better. I get email in calibri, it was annoying me a little.
  • Glutanimate
    Glutanimate over 6 years
    @spinup Thank you! ~/.config/fontconfig/fonts.conf is the only location that ended up working for me on Kubuntu 17.04.
  • flowtron
    flowtron over 5 years
    On 18.04 bionic creating the file ~/.fonts.conf with just the content provided in this answer and restarting the email client fixed it
  • Chris H
    Chris H over 4 years
    @flowtron's comment works for me too
  • sxc731
    sxc731 over 3 years
    20.04: put the "disable embedded bitmaps" XML snippet in ~/.config/fontconfig/fonts.conf; restart Thunderbird (which is where this issue manifested itself in emails received from M$ clients) - job done :-)