Fonts from Windows 10 system fonts can't be found

I'm using quarto and struggling with latex package installation issues. After upgrading tinytex I can't use windows system fonts and am struggling to install fonts and other .sty files. The advice in the Quarto manual fails, advice in latex forums fails, tlmgr during rendering a pdf document fails, and tlmgr from the windows (system admin) prompt fails. Here's a simple example where I've installed both Roboto and Lato into the windows system fonts and tried to use them in a quarto pdf. The quarto response messages follows the example code. Any advice is welcome

Simple example

---
title: "Fonts in Quarto" 
format: pdf 
pdf-engine: xelatex 
include-in-header:
  text:
    \usepackage{fontspec}
mainfont: Lato 
monofont: Roboto 
---

## Fonts

-   mainfont: For LaTeX output, the main font family for use with xelatex or lualatex. Takes the name of any system font.\
-   monofont: For LaTeX output, the monospace font family for use with xelatex or lualatex: take the name of any system font.

Response starts here

kpathsea: Running mktextfm Lato

The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktextfm
name = Lato, rootname = Lato, pointsize =
mktexmf: empty or non-existent rootfile!

kpathsea: Running mktexmf Lato.mf

The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktexmf
Cannot find Lato.mf.
kpathsea: Appending font creation commands to missfont.log.

updating tlmgr

updating existing packages
finding package for Lato(-(Bold|Italic|Regular).*)?.
finding package for Lato
finding package for mktextfm

2 packages to install
installing lato (1 of 2)
installing texlive-scripts (2 of 2)
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode

kpathsea: Running mktextfm Lato

The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktextfm
name = Lato, rootname = Lato, pointsize =
mktexmf: empty or non-existent rootfile!

kpathsea: Running mktexmf Lato.mf

The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktexmf
Cannot find Lato.mf.
kpathsea: Appending font creation commands to missfont.log.

finding package for Lato(-(Bold|Italic|Regular).*)?.
finding package for Lato
finding package for mktextfm

compilation failed- package installation error
Package fontspec Error: The font "Lato" cannot be found.

For immediate help type H .
...

l.26 \setmonofont
{Roboto}

end of response

This might help

Thanks for the reply. I had seen this option and tried it, but it didn't help. What's puzzling is that the two fonts in play here, Roboto and Lato, are in my windows fonts directory and are discovered by systemfonts::system_fonts(). Other Windows fonts can be used but not these two. They are also available as LaTeX .sty fonts but tlmgr fails to install them and my clumsy efforts to install them manually didn't work out. I'm not sure where to go next except to find alternatives.

Maybe try:

---
title: "Fonts in Quarto"
format: pdf
pdf-engine: xelatex
header-includes:
  - \usepackage{fontspec}
text:
mainfont: Lato
monofont: Roboto
---

Hi

It runs but I have no idea if it does what you want.

Thanks. I created a new .qmd project and copied/pasted your code, and got the same results as before (below). Somehow tlmgr is not seeing my Roboto and Lato fonts.

running xelatex - 1
  This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  
  kpathsea: Running mktextfm Lato
  
  The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktextfm
  name = Lato, rootname = Lato, pointsize = 
  **mktexmf: empty or non-existent rootfile!**
  
  kpathsea: Running mktexmf Lato.mf
  
  The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktexmf
  Cannot find Lato.mf.
  kpathsea: Appending font creation commands to missfont.log.
  
updating tlmgr

updating existing packages
finding package for Lato(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)
finding package for Lato
finding package for mktextfm
> 2 packages to install
> installing lato (1 of 2)
> installing texlive-scripts (2 of 2)
  This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  
  kpathsea: Running mktextfm Lato
  
  The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktextfm
  name = Lato, rootname = Lato, pointsize = 
  mktexmf: empty or non-existent rootfile!
  
  kpathsea: Running mktexmf Lato.mf
  
  The command name is C:\Users\dkStevens\AppData\Roaming\TinyTeX\bin\windows\mktexmf
  Cannot find Lato.mf.
  kpathsea: Appending font creation commands to missfont.log.
  
finding package for Lato(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)
finding package for Lato
finding package for mktextfm

compilation failed- package installation error
Package fontspec Error: The font "Lato" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.26   \setmonofont
                   []{Roboto} 

see FontFun.log for more information.

I am afraid I am of no help. I have not used Windows in about 15 years.

What happens if you substitute other fonts? Or maybe trp

mainfont: "Lato"
monofont: "Roboto"

YAML seems very picky to me.

Some other fonts seem to work (I do use mainfont: , monofont:) such as Calibri, Arial (I haven't tried all of them). Thanks for your efforts here - windows can be a pain. Unfortunately, this is a choice I made long ago and I'm retiring soon so it's too much to switch now.

Okay, good luck in the WWW (Weird World of Windows).

Thanks! Have a good weekend.

Hi @dkStevensNZed
Maybe you downloaded the opentype (OT) version of those fonts not the TrueType (TT) version and that's why they are not handled correctly? Some discussion on this topic here: https://superuser.com/questions/901940/problems-printing-lato-font

Update to Fonts from windows 10 ...

Thanks DavoWW - I checked and the fonts are the TrueType versions. But here's something interesting. The project I'm working on is a 'book' with 10 or so chapters, all referenced in the yaml file. If I comment out the yaml reference and compile a file as a preview (just rendered to a pdf without the book info), the Lato and Roboto fonts are available. Then if I go back and recompile the full book, I get the errors. That leads to think something's amiss in the yaml file. Here are the yaml contents so if anyone sees some clues, I'd appreciate it. This yaml worked find yesterday at 9 am. By 9:15 it no longer worked.

project:
type: book

book:
title: Pmy title
author: David K Stevens
date: "12/17/2023"
chapters:
- index.qmd
- intro.qmd
- LitReview.qmd
- Model.qmd
- MatMeth.qmd
- ResultsDiscuss.qmd
- Conclude.qmd
- Recomm.qmd
- references.qmd
- Append.qmd

include-in-header:
text:
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{ulem}
\renewcommand{\thechapter}{\Roman{chapter}}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\usepackage{tocloft}
\setlength{\cftchapnumwidth}{2em}
\setlength{\cftfignumwidth}{4em}
\setlength{\cfttabnumwidth}{4em}
\usepackage{lscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\thefigure}{\Roman{chapter}.\arabic{section}-\arabic{figure}}
\renewcommand{\thetable}{\Roman{chapter}.\arabic{section}-\arabic{table}}
\renewcommand{\theequation}{\Roman{chapter}.\arabic{section}-\arabic{equation}}
bibliography: references.bib
csl: american-society-of-civil-engineers.csl

format:
html:
theme: cosmo
pdf:
documentclass: scrbook
margin-left: 38mm
margin-right: 25mm
margin-top: 25mm
margin-bottom: 25mm
keep-tex: true
toc: true
lof: true
lot: true
number-sections: true
colorlinks: true

pdf-engine: xelatex
mainfont: Lato
monofont: Roboto
editor: visual

Had an almost identical issue (same error codes but for Roboto font) on a colleague's Windows laptop and the issue was fonts were only installed for a single user – just needed to use the right-click Install for all users option (solution from here: https://tex.stackexchange.com/questions/634103/texlive-on-windows-10-error-pointsize-mktexmf-empty-or-non-existent-rootfi).

Hopefully this helps!

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.