colorlettrine はいくつかの文字のみをサポートします

colorlettrine はいくつかの文字のみをサポートします

colorlettrine パッケージを使用しようとしています。EB Garamond パッケージをインストールしましたが、すぐに、サポートされている文字がいくつかしかないことがわかりました。たとえば、S を入力すると、空のボックスが表示されます。

同様の効果を得るために試すことができる代替手段はありますか?

より多くのキャラクターを追加するためにどのような作業を実行できるか知っている人はいますか?

答え1

TeX.SE へようこそ。coloredlettrine各グリフは、前面 (文字) と背面 (装飾) の 2 つの部分から構成されているため、独特です。これにより、文字を装飾とは別の方法で色付けすることができます。ただし、ご存知のとおり、使用できる文字は A、F、G、L、N、O、Q、T のみです。

装飾的な頭文字を持つフォントは数多くあり、レターラインの作成に使用できます。TUGフォントカタログこのGoudyInパッケージを使用して、Goudy Initialen フォントにアクセスしました。

パッケージlettrineには、グラフィックを文字飾りとして使用するオプションもあります。私は、Web のどこかで拾った装飾文字でこの方法を使用しています。出典を明記しなかったことを後悔しています。

ここに画像の説明を入力してください

% Compile with xelatex or lualatex
% The two EB Garamond Initials fonts must be installed to use \coloredlettrine.
% Graphics with the file names m.jpg, n.jpg and o.jpg, or any 
% other graphic file format must be available to use \lettrine[image...
\documentclass[10pt,a4paper]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{fontspec}
%https://github.com/raphink/coloredlettrine; also on CTAN
\usepackage{coloredlettrine} %loads [svgnames]{xcolor} and {lettrine}
% Requires 2 fonts:
% EB Garamond Initials Fill1 Regular
% EB Garamond Initials Fill2 Regular
\setmainfont[RawFeature={+ss02,+cv01,+ss05,+dlig},
             ItalicFeatures={RawFeature=+cv04}]{EB Garamond}
\renewcommand{\EBLettrineBackColor}{NavyBlue}
\renewcommand{\EBLettrineFrontColor}{Maroon}

\usepackage{lettrine} 
\usepackage{GoudyIn}
\usepackage[svgnames]{xcolor}

\renewcommand\LettrineFontHook{\color{Maroon}\GoudyInfamily{}}%
\renewcommand{\LettrineTextFont}{}
\newcommand*{\mylettrine}[1]{\lettrine[lines=1,realheight=false,findent=3pt,nindent=0pt]{#1}{}}

\begin{document}

\coloredlettrine[lines=1,realheight=false,findent=3pt,nindent=0pt]{A}{apt}\linebreak
\coloredlettrine[lines=1,realheight=false,findent=3pt,nindent=0pt]{G}{apt}\linebreak
\coloredlettrine[lines=1,realheight=false,findent=3pt,nindent=0pt]{T}{apt}\linebreak

\renewcommand\LettrineFontHook{\color{Maroon}\GoudyInfamily{}}%
\renewcommand{\LettrineTextFont}{}

\mylettrine{A}{apt}
\mylettrine{B}{apt}
\mylettrine{C}{apt}

\lettrine[image,lines=1,realheight=false,findent=3pt,nindent=0pt]{M}{apt}
\lettrine[image,lines=1,realheight=false,findent=3pt,nindent=0pt]{N}{apt}
\lettrine[image,lines=1,realheight=false,findent=3pt,nindent=0pt]{O}{apt}
 
\end{document}

関連情報