
XeLaTeX で Lucida Calligraphy フォントを使用すると、ダッシュが正しく機能しません。--
長いダッシュではなく、2 つの小さなダッシュが表示されます。どうすれば修復できますか?
MWE:
\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{xltxtra}
\newfontfamily\headingfont{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\end{document}
答え1
このLigatures=TeX
機能は、 、 で宣言されたフォントにのみデフォルトで追加されます\setmainfont
。で宣言されたフォントでは、追加しない限り\setsansfont
TeX 合字は有効になりません。\newfontfamily
文字を直接使用できます:
または、TeXの合字を適用するように明示的に指定することもできます。[Ligatures=TeX]
\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{fontspec}
\newfontfamily\headingfont[Ligatures=TeX]{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\section*{Hello–World}
\section*{Hello—World}
\end{document}