0

Today I installed the Calibri font in my Ubuntu 16.04 using the method showed here, that is, I crated a ~/.fonts directory then used this command:

wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer | bash

do download and install a bundle of fonts.

But instantly after the download finished my Firefox stopped showing some characters. Apparently this happens with some monospaced fonts (not checked).

For example, here in the Stack Exchange network, text formatted as code appears as:


enter image description here


(this is a screenshot from the answer I mentioned)

Also, this cool github page appears like this:


enter image description here


Furthermore, this question you are reading was written in GEdit then copy-pasted here in the site, because the characters in the message body box do not show at all (although the title box does), like this:


enter image description here


What happened whant I ran that script? How to fix this?

  • 1
    Have you tried to delete the ~/.fonts directory? – Gunnar Hjalmarsson Jan 31 '18 at 21:37
  • @GunnarHjalmarsson I tried, but it didn't do anything. Wait, let me try something... So, after removing the directory from there and restarting Firefox (I tried it before, but didn't do the restart) it worked. The problem is that I actually need the Calibri font (stupid standards). Is there a way to make both live in peace? – Phelype Oleinik Jan 31 '18 at 21:40
  • 1
    One idea: Create the directory /usr/share/fonts/calibri and put them there instead of ~/.fonts. – Gunnar Hjalmarsson Jan 31 '18 at 22:08
  • It worked! Thanks! I put them in /usr/share/fonts/truetype/calibri/, change the permission to rw-r--r--, then executed sudo fc-cache -fvs to make the system aware of the new fonts. Everything's working now :) – Phelype Oleinik Jan 31 '18 at 22:22
  • Great! Can you please post that as an answer? (It's fine to answer your own question, and in a couple of days you'll be able to accept it.) – Gunnar Hjalmarsson Jan 31 '18 at 23:39
0

With the help of @GunnarHjalmarsson I solved the problem.

I don't know exactly why that happened, but perhaps Firefox looked for fonts there, found one, and used it. But those fonts don't have a typewriter variant, so maybe this is the cause.

The Solution

@GunnarHjalmarsson suggested to move the fonts to /usr/share/fonts/calibri.

Since these were TrueType fonts, I moved them to /usr/share/fonts/truetype/calibri

Actually, there are more fonts in the bundle, so I did this:

for i in calibri cambria candara consola constan corbel; do
    sudo mkdir /usr/share/fonts/truetype/$i # create the folder
    sudo mv ~/.fonts/$i* /usr/share/fonts/truetype/$i/ # move the font files
    sudo chmod 644 /usr/share/fonts/truetype/$i/* # change permission of the fonts to rw-r--r--
done

After that I removed the ~/.fonts and restarted Firefox and the problem was solved...

But then the fonts were no longer available (for XeTeX, at least). So I downloaded the script which installed the fonts in the first place:

wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer

but didn't execute it. At the end of the script I found fc-cache -fv ~/.fonts. Reading the man fc-cache page I found out that this command creates sort of a mapping of the available fonts, so I used:

fc-cache -fvs

to regenerate these mappings.

After that I had my Firefox working fine and the fonts were available for XeTeX to use.


I must add that on another computer (both with Ubuntu 16.04 and Firefox 58) I did the same procedure described in the question (the font installation), but the problem didn't happen... I have no idea why :P

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.