1

When compiliing with LuaLaTex, the font type Arial works:

\documentclass[english]{article}
\usepackage{lipsum}

\usepackage{fontspec} \setsansfont[Ligatures=TeX]{Arial}

\begin{document} \lipsum[1] \end{document}

enter image description here

But if I use CAMBRIA.TTC it does not work:

\documentclass[english]{article}
\usepackage{lipsum}

\usepackage{fontspec} \setmainfont[Ligatures=TeX]{CAMBRIA.TTC}

\begin{document} \lipsum[1] \end{document}

enter image description here

The compilation fails also with the following variation in the code:

\documentclass[english]{article}
\usepackage{lipsum}

\usepackage{fontspec} \setmainfont[Ligatures={TeX,Common}]{Cambria}

\begin{document} \lipsum[1] \end{document}

An error says Package fontspec Error: The font "CAMBRIA" cannot be found., but how to get it in Overleaf?

What is the correct way to use Cambria in Overleaf?

Ommo
  • 835
  • Just for information, I have tried also \usepackage{fontspec} \setmainfont{Calibri} and it does not work either (I get an error saying Package fontspec Error: The font "Calibri" cannot be found.) – Ommo Mar 07 '24 at 10:15
  • 1
    Cambria is not licenced for use on linux systsems, you can use the chromeos cambria compatible font Caladea – David Carlisle Mar 07 '24 at 10:20
  • Thanks a lot!! Thanks to your input, I found The Cambria clone called Caladea and the Calibri clone is called Carlito. Both can be loaded with fontspec and compiled using XeLaTeX or LuaLaTeX. from: https://tex.stackexchange.com/questions/653270/how-can-i-select-cambria-or-calibri-fonts-in-overleaf-for-greek-language – Ommo Mar 07 '24 at 10:24
  • As of my knowledge, both Calibri and Cambria are the Windows fonts, which OS you are using – MadyYuvi Mar 07 '24 at 10:24
  • 2
    @MadyYuvi the OP said overleaf, which is linux – David Carlisle Mar 07 '24 at 10:25
  • Overleaf (online editor), but the computer I am using to make this test has Windows... – Ommo Mar 07 '24 at 10:25
  • @DavidCarlisle Sorry, I missed to look the word Overleaf, please excuse – MadyYuvi Mar 07 '24 at 10:26
  • 1
    @Ommo Overleaf can not access your local system so the OS of you computer has no effect here. They use a linux tex. – David Carlisle Mar 07 '24 at 10:30
  • Ah, good to know! I did not know about it, many thanks! – Ommo Mar 07 '24 at 10:32

1 Answers1

2

Overleaf have the Chrome OS Core fonts installed which include the Cambria compatible Caladea. The Cambria font distributed with windows is only licenced for use on Windows.

\documentclass[english]{article}
\usepackage{lipsum}

\usepackage{fontspec} \setmainfont{Caladea}

\begin{document} \lipsum[1] \end{document}

works on overleaf with lualatex or xelatex

enter image description here

David Carlisle
  • 757,742