Linux MintにXeLaTeX用Antiquaフォントをインストールする方法は?

Linux MintにXeLaTeX用Antiquaフォントをインストールする方法は?

Linux Mintのシステムに「Book Antiqua」フォントをインストールするにはどうすればよいですか?つまり、次のLaTeXドキュメントがあります。

\documentclass[12pt]{article}
    \title{\textbf{Gummi 0.8.0}}
    \author{x}
    \date{}
    
    \addtolength{\topmargin}{-3cm}
    \addtolength{\textheight}{3cm}
\usepackage{setspace}
%\usepackage{mathpazo}
\usepackage{xurl}
\usepackage[%
    left=3cm,%
    right=3cm,%
    top=2.5cm,%3
    bottom=2.5cm,%
    headheight=33pt,%
]{geometry}%
\usepackage[finnish]{babel}
%\usepackage{newtxtext,newtxmath} % Antiqua-fontti
\usepackage{hyperref}
\usepackage{scrlayer-scrpage}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
\clearpairofpagestyles
\ohead*{\pagemark}
\begin{document}
\setlength{\footheight}{17.99445pt}
\topskip0pt
\vspace*{\fill}
\thispagestyle{empty}
\setmainfont{Book Antiqua}
\begin{center}
asijdo

dsad
\end{center}

コマンドで文書をコンパイルしようとすると、xelatex demo.tex出力は次のようになります。

Package hyperref Warning: Rerun to get /PageLabels entry.

kpathsea:make_tex: Invalid filename `Book Antiqua', contains ' '

! Package fontspec Error: The font "Book Antiqua" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.32 \begin
           {center}
? 

この問題をどのように解決できますか?

ベストアンサー1

フォントを使用するには事前に説明が必要です。多くの場合、これらの説明はパッケージとして提供され、標準パッケージがfontspec良い例です。

ドキュメントで使用できるフォント自体を含むファイルが必要で、次の定義を追加します。

\setromanfont{Font Name}[
    Path=./path_relative_to_doc_with_all_files_of_this_font/,
    Extension = .ttf,
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Italic,
    BoldItalicFont=*-BoldItalic
    ]

おすすめ記事