
MWE は次のとおりです。
\documentclass{article}
\usepackage{tfrupee}
\begin{document}
This is a \rupee{} symbol
This is a \rupee symbol
\textbf{This is a \rupee{} symbol}
\textbf{This is a \rupee symbol}
\end{document}
pdflatex、xetex、luatex を使用してコンパイルしてみました。しかし、ルピー記号は常に太字で印刷されます。ルピー記号を「通常の」フォントで印刷するにはどうすればよいでしょうか。
答え1
公式のインド ルピー記号のみを提供するフォントではなく、さまざまなフォント バリアントに採用されたバージョンを含むフォント ファミリが必要です。
LuaTeX の例 (XeTeX も同様ですが、SourceCodePro と SourceSansPro を\fontspec
動作させるにはおそらくより複雑な設定が必要です):
\documentclass{article}
\usepackage[a4paper,vmargin=10mm]{geometry}
\usepackage{fontspec}
\tracinglostchars=2 % get a message, if glyphs are missing
\newcommand*{\rupee}{%
\begingroup
\fontspec{FreeSans}% add your font here
^^^^20b9%
\endgroup
}
% test fonts
\newcommand*{\TestString}{This is a ^^^^20b9 symbol.}
\newcommand*{\test}[1]{%
\subsubsection*{#1}
\begingroup
\fontspec{#1}%
\TestString\\
\textbf{\TestString}\\
\textit{\TestString}\\
\textbf{\itshape\TestString}\par
\endgroup
}
\begin{document}
\test{ClearSans}
\test{DejaVuSans}
\test{DejaVuSerif}
\test{FreeMono}
\test{FreeSans}
\test{FreeSerif}
\test{SourceCodePro}
\test{SourceSansPro}
\end{document}
答え2
パッケージには、tfrupee
中程度の太さのフォントから既に呼び出されている 1 つのシンボルのみが含まれています。したがって、そのシンボルをそのまま受け入れる必要があります。
Xe または LuaLatex を使用できるので、このシンボルの Unicode を、ニーズに合ったフォントと組み合わせて使用できます。特定のフォントで 1 つのシンボルだけを含むマクロを作成する際にサポートが必要な場合は、お知らせください。
必要なシンボルはUnicodeにマッピングされています20B9 ...代替バージョンも追加しました20A8 はお使いのシステムでどのフォントがそのシンボルを提供しているかを確認したい場合は、ここさらなる処理のためのSVGバージョンは以下にあります。ここ。
% arara: lualatex
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{Quivira.otf}\symbol{"20B9}\symbol{"20A8}
\setmainfont{Linux Libertine O}\symbol{"20B9}%\symbol{"20A8} % not existent
\setmainfont{Symbola.ttf}\symbol{"20B9}\symbol{"20A8}
\setmainfont{EB Garamond}\symbol{"20B9}\symbol{"20A8}
\setmainfont{DejaVuSans.ttf}\symbol{"20B9}\symbol{"20A8}
\end{document}