![Using Google fonts with XeLaTeX](https://writelatex.s3.amazonaws.com/published_ver/31226.jpeg?X-Amz-Expires=14400&X-Amz-Date=20240630T202618Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAWJBOALPNFPV7PVH5/20240630/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=0310910135625cdb84efa7ceb2ad92fb781c6f2a5447f8c72753d90261fe3a86)
Using Google fonts with XeLaTeX
Forfatter
Overleaf
Sidst opdateret
10 måneder siden
Licens
Creative Commons CC BY 4.0
Resumé
This example accompanies an Overleaf help article.
![Using Google fonts with XeLaTeX](https://writelatex.s3.amazonaws.com/published_ver/31226.jpeg?X-Amz-Expires=14400&X-Amz-Date=20240630T202618Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAWJBOALPNFPV7PVH5/20240630/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=0310910135625cdb84efa7ceb2ad92fb781c6f2a5447f8c72753d90261fe3a86)
\documentclass{article}
\usepackage{parskip}
\usepackage{hologo}% to access the XeTeX logo via \hologo{XeLaTeX}
\usepackage{fontspec}
\setsansfont{Asap}[
Path=./AsapFontFiles/,
Scale=0.9,
Extension = .ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic
]
\setmainfont{Brygada1918}[
Path=./BrygadaFontFiles/,
Extension = .ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic
]
\setmonofont{JetBrainsMono}[
Path=./JetbrainsFontFiles/,
Scale=0.85,
Extension = .ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic
]
\title{Using Google Fonts with \hologo{XeLaTeX}}
\author{Overleaf}
\date{September 2023}
\begin{document}
\maketitle
\section{Introduction}
The following lists demonstrate the various fonts we have uploaded.
{\sffamily This is the Asap sans serif font:
\begin{itemize}
\item {\itshape now in italic}
\item {\bfseries now in bold}
\item {\itshape\bfseries now in bold italic}
\end{itemize}
}
{\ttfamily This is the JetBrains Mono font:
\begin{itemize}
\item {\itshape now in italic}
\item {\bfseries now in bold}
\item {\itshape\bfseries now in bold italic}
\end{itemize}
}
{\rmfamily This is the Brygada1918 font:
\begin{itemize}
\item {\itshape now in italic}
\item {\bfseries now in bold}
\item {\itshape\bfseries now in bold italic}
\end{itemize}
}
\end{document}