2

I'm trying to get a Calibri font to work on Overleaf for the entire document with the LuaLaTeX as the compiler. I'm a bit new to LuaLaTeX.

Currently, I have defined a folder, called Fonts, which has the uploaded Calibri font files as .ttf extension.

The folder contains: CALIBRI.TTF, CALIBRIZ.TTF, CALIBRIB.TTF, CALIBRII.TTF, CALIBRIL.TTF, and CALIBRILI.TTF.

Then I added the following code, from How to use the Calibri font :

\usepackage{fontspec}     
\setmainfont[Fonts/,
    BoldItalicFont=Fonts/CALIBRIZ.TTF,
    BoldFont      =Fonts/CALIBRIB.TTF,
    ItalicFont    =Fonts/CALIBRII.TTF]{CALIBRI.TTF}

I'm getting a font to display; however, I'm also getting a few error messages and the text is corrupted.

Error:

1:
Package fontspec Error: The font "CALIBRI" cannot be found.

2: Font \TU/CALIBRI.TTF(0)/m/n/12=[CALIBRI.TTF]:mode=node;language=dflt;+tlig; at enter code here 12pt not loadable: metric data not found or bad. <to be read again> relax l.17

I wasn't able to read the size data for this font, so I will ignore the font specification. [Wizards can fix TFM files using TFtoPL/PLtoTF.] You might try inserting a different font spec; e.g., type `I\font<same font id>=<substitute font name>'.

The last one is repeated couple times for the other fonts.

Below is a picture of how the PDF currently looks:

enter image description here

Any Ideas how to fix this font and the error message?

Thank you in advanced.

  • Try adding Path= in front of the first Fonts/ and remove the other three instances of Fonts/. – Marcel Krüger Mar 23 '21 at 13:48
  • 1
    Note that Calibri isn't usually licenced for use away from windows, and overleaf uses linux, You can use the Google Carlito font which is metric compatible with Calibri and already available in Overleaf so you simply need \usepackage{fontspec}\setmainfont{Carlito} – David Carlisle Mar 23 '21 at 16:50

0 Answers0