设置 beamer 文本字体

设置 beamer 文本字体

我想将框架内的文本字体以及块内的文本字体设置为 FranklinGothic。我下载了.ttf此字体的文件,并将它们放在本地路径上,还将它们安装在/usr/share/fonts/truetype/franklingothic。然后我在 tex 文件中使用以下标题

\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}

但是,我没有看到框架内的 FranklinGothic 字体

答案1

我只有 ITC FranklinGothic。将其更改为您的字体名称。

\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}

在此处输入图片描述

使用和包含的字体有:

$ pdffonts test.pdf
name                                 type             
------------------------------------ ----------------  
BCUJUB+Calibri-Bold                  CID TrueType     
BSEWJS+LMSans10-Regular-Identity-H   CID Type 0C      
BWQWZA+FranklinGothicLT-Heavy        CID TrueType     

相关内容