在 Xelatex 中使用系统字体排版上标和下标

在 Xelatex 中使用系统字体排版上标和下标

我的文档需要使用一种名为 DINPro 的字体进行排版。我需要在文本中使用下标和上标。我想使用 \textsubscript 和 \textsuperscript,但是 \textsuperscript 不会更改受影响文本的缩放比例或位置。 \textsubscript 可以正确更改位置,但不会缩放。

作为替代方案,我尝试使用数学模式,如 BASE$_{SUBSCRIPT}$。它可以很好地缩放和定位,但它使用罗马/斜体。有没有办法将这两种方法中的任何一种与我的字体一起使用,以便在我所需的字体中正确缩放和定位下标/上标?MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{xltxtra}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=NoCommon, SizeFeatures = {Size=12}}
\newfontfamily\BodyFont{DINPro-Light}[SizeFeatures = {Size=11}] 
\begin{document}
\begin{tt}
{\bf Testing textsubscript and text superscript with tt font:} \newline
BASE\textsuperscript{SUPERSCRIPT} \newline
BASE\textsubscript{SUBSCRIPT} \newline
Note that the sub/superscript is smaller than the base and centered respectively with  the lower and upper edges of the base. \newline
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}
\par
\end{tt}

\begin{BodyFont}
{\bf Testing textsubscript and text superscript with DINPro-Light, Size 11, downloaded from internet:} \newline
BASE\textsuperscript{SUPERSCRIPT} \newline
BASE\textsubscript{SUBSCRIPT} \newline
1)Boldface reverts to roman font. \newline2)DINPro font  textsuperscript doesn't work at all. \newline  3)textsubscript works but the subscript font size is the same as the base. \newline Question:  Is this an issue  with the font I used?  DINPro is the required font for my document so I need to figure out how to make it work.\newline
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}
\par

{\bf Alternative question: Testing math mode subscript  andsuperscript with DINPro-Light, Size 11, downloaded from internet:} \newline
BASE$^{SUPERSCRIPT}$ \newline
BASE$_{SUBSCRIPT}$ \newline
 This looks much better, however the math mode font is roman and italic.  Is there any way to prevent transiton  roman and italic in math mode?
\end{BodyFont}
\end{document}

相关内容