tfrupee 列印粗體符號

tfrupee 列印粗體符號

這是 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僅提供一個已從中等粗細字體調用的符號。因此,您必須按原樣接受該符號。

由於您可以使用 Xe- 或 LuaLatex,您可以只使用該符號的 unicode 以及一些適合您需求的字體。如果您在編寫僅使用某種字體的一個符號的巨集時需要幫助,請告訴我!

你想要的符號映射在unicode下U+20B9。我還添加了替代版本U+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}

在此輸入影像描述

相關內容