2

I want to set the font of the text inside a frame, and also the ones inside a block to FranklinGothic. I downloaded the .ttf files for this font, and I put them on the local path, and also installed them at /usr/share/fonts/truetype/franklingothic. Then I use the following header in the tex file

\documentclass{beamer}
\usepackage{fontspec}
\mode<presentation>
{
    \definecolor{mygreen}{cmyk}{0.82,0.11,1,0.25}
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
    \setbeamertemplate{blocks}[rounded][shadow=false]
    \setbeamercovered{transparent}
    \setbeamertemplate{frametitle}
    {
        \begin{beamercolorbox}[ht=2.9em,wd=0.8\paperwidth]{frametitle}
            \insertframetitle
        \end{beamercolorbox}
    }
    \definecolor{cool_blue}{RGB}{35,137,154}
    \definecolor{cooler_blue}{RGB}{0,72,81}
    \usefonttheme{structurebold}
    \setbeamercolor{titlecolor}{fg=cool_blue}
    \setbeamercolor{titlelike}{parent=titlecolor}
    \setbeamercolor{normal text}{fg=cooler_blue}
    \usebeamercolor[fg]{normal text}
    \setbeamerfont{frametitle}{family={\fontspec{calibri}}}
    \setbeamerfont{example text}{family={\fontspec{FranklinGothic}}}
}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\begin{document}
\begin{frame}{Background}
sample text
\end{frame}
\end{document}

Yet, I don't see the FranklinGothic font inside the frame

1 Answer 1

3

I have only the ITC FranklinGothic. Change it to your font name.

\documentclass{beamer}
\usepackage{fontspec}
\newfontfamily\Calibri{Calibri}
\newfontfamily\Gothic{FranklinGothicLT-Medium}

\definecolor{mygreen}{cmyk}{0.82,0.11,1,0.25}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{blocks}[rounded][shadow=false]
\setbeamercovered{transparent}
\definecolor{cool_blue}{RGB}{35,137,154}
\definecolor{cooler_blue}{RGB}{0,72,81}
\usefonttheme{structurebold}
\setbeamercolor{titlecolor}{fg=cool_blue}
\setbeamercolor{titlelike}{parent=titlecolor}
\setbeamercolor{normal text}{fg=cooler_blue}
\usebeamercolor[fg]{normal text}
\setbeamerfont{frametitle}{family=\Calibri}
\setbeamerfont{example text}{family=\Gothic}
\setbeamertemplate{frametitle}{%
    \begin{beamercolorbox}[ht=2.9em,wd=0.8\paperwidth]{frametitle}
        \insertframetitle
    \end{beamercolorbox}%
}
\usepackage[english]{babel}

\begin{document}
\begin{frame}{Background}
    sample text

\begin{Example}
    foo
\end{Example}
\end{frame}
\end{document}

enter image description here

the used and included fonts are:

$ pdffonts test.pdf
name                                 type             
------------------------------------ ----------------  
BCUJUB+Calibri-Bold                  CID TrueType     
BSEWJS+LMSans10-Regular-Identity-H   CID Type 0C      
BWQWZA+FranklinGothicLT-Heavy        CID TrueType     
6
  • Thank you for the answer. How did you find out the exact name of font 'FranklinGothicLT-Medium' ? I mean, how should I check the name under which it is stored in my system?
    – kksagar
    Commented May 4, 2019 at 20:40
  • There is a small program: otfinfo -I <filename with path> which shows you the internal names. However, you can use the file name instead. I prefer the symbolic names.
    – user187802
    Commented May 5, 2019 at 4:13
  • I still don't have the Gothic font. Also, I think your output too doesn't have the Gothic font, it is the default beamer font
    – kksagar
    Commented May 6, 2019 at 10:34
  • In my example Background is in Calibri, sample text in the default latin modern sans and foo as part of the Example environment in Franklin Gothic. That was what you wanted!
    – user187802
    Commented May 6, 2019 at 11:31
  • yes, that's what I wanted. But I believe the foo in your output is not Franklin Gothic, but it is the default font of beamer
    – kksagar
    Commented May 7, 2019 at 10:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .