# Beamer caption name not changing

I am changing the font of my presentation to calibri, but the caption name under a figure (the "Figure" part) isn't changing to calibri, but stays in a serif font. The \setbeamerfont{caption name}{... doesn't seem to work

Here is a mwe but it doesn't reproduce the problem... Maybe it is because I use a style?

\documentclass[aspectratio=169,t]{beamer}
\usepackage[T1]{fontenc}
\usepackage{pgf}

\usefonttheme{professionalfonts}
\RequirePackage{fontspec}
\setmainfont{Calibri}
\setbeamerfont{caption}{family=\sffamily,size=\small}
\setbeamerfont{caption name}{family=\sffamily,size=\small}
\begin{document}

\begin{frame}
\begin{itemize}
\item list of duck items
\end{itemize}
\begin{figure}
\centering
\includegraphics[width=.3\paperwidth, keepaspectratio]{example-image-duck}
\caption{Duck example}%\label{}
\end{figure}

\end{frame}

\end{document}


EDIT: Has propose, here is the log on pastebin

• Unrelated to your problem, but you don't need \centering, figures are centred per default in beamer – user36296 Mar 22 at 16:47

Beamer uses sans serif font, so instead of setting the main font, you need to change the sans font (I replaced the font with papyrus to easier see that it is working)

And as @DavidCarlisle thankfully observed:

don't use \usepackage[T1]{fontenc} with luatex and especially not with xetex

% !TeX TS-program = xelatex

\documentclass[aspectratio=169,t]{beamer}
%\usepackage[T1]{fontenc}
\usepackage{pgf}

\usefonttheme{professionalfonts}
\RequirePackage{fontspec}
\setsansfont{Papyrus}
\setbeamerfont{caption}{family=\sffamily,size=\small}
\setbeamerfont{caption name}{family=\sffamily,size=\small}
\begin{document}

\begin{frame}
\begin{itemize}
\item list of duck items
\end{itemize}
\begin{figure}
%\centering
\includegraphics[width=.3\paperwidth, keepaspectratio]{example-image-duck}
\caption{Duck example}%\label{}
\end{figure}

\end{frame}

\end{document}


And with calibri:

 % !TeX TS-program = xelatex

\documentclass[aspectratio=169,t]{beamer}
%\usepackage[T1]{fontenc}
\usepackage{pgf}

\usefonttheme{professionalfonts}
\RequirePackage{fontspec}
\setsansfont{Calibri}
\setbeamerfont{caption}{family=\sffamily,size=\small}
\setbeamerfont{caption name}{family=\sffamily,size=\small}
\begin{document}

\begin{frame}
\begin{itemize}
\item list of duck items
\end{itemize}
\begin{figure}
%\centering
\includegraphics[width=.3\paperwidth, keepaspectratio]{example-image-duck}
\caption{Duck example}%\label{}
\end{figure}

\end{frame}

\end{document}


• From my test on my main file, using \setsansfont{Calibri} changes it to a serif font everywhere... – Simon Mar 22 at 16:51
• @Simon Can you show your .log file (if it is too long to add to the question, try pastebin.com) – user36296 Mar 22 at 16:56
• thanks, it has been added – Simon Mar 22 at 16:59
• @Simon If you look at the warnings in the log, it says that it cannot find the font LaTeX Font Info: Try loading font information for T1+Calibri(0) on input line 105. LaTeX Font Info: No file T1Calibri(0).fd. on input line 105. LaTeX Font Warning: Font shape T1/Calibri(0)/m/n' undefined (Font) using T1/cmr/m/n' instead on input line 105. – user36296 Mar 22 at 17:01
• don't use \usepackage[T1]{fontenc} with luatex and especially not with xetex – David Carlisle Mar 22 at 17:30