問題或功能:使用 \textsc 時,套件 gfsartemisia-euler 將 ú 改為 ý

問題或功能:使用 \textsc 時,套件 gfsartemisia-euler 將 ú 改為 ý

我需要使用 gfsartemisia-euler 套件將原本以 palatine 字體編寫的書的字體改為 artemisia。我的問題如下:

當我使用\textscor\scshape角色時ú被替換為

這種情況只發生在這個角色上,所有其他角色似乎都正常工作。這是一個最小的例子。

\documentclass{scrbook}
\usepackage{gfsartemisia-euler} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{tipa}

\begin{document}
\scshape 
  Os números \\ 
  
  Os n\'umeros \\
  
  Nos capítulos, nas equações...\\ 
  
  É mesmo? Então faça com as próprias mãos  

  Höla e também H\"ola. (Exige tipa)
\end{document}

編譯該檔案後,它會產生輸出

在此輸入影像描述

答案1

這確實是GFSArtemisia T1版本的一個bug。這是字體表中與拉丁小型大寫字母相對應的部分:

在此輸入影像描述

您可以看到 Ý 列出了兩次,而第一個條目應該是 Ú。應將此問題回報給維護人員,以便修復。

然而,OTF 版本來自https://ctan.org/tex-archive/fonts/greek/gfs/gfsartemisia/opentype 有小型大寫字母 ú。因此,如果您願意,可以使用相當複雜的解決方法來在 pdfLaTeX 中使用此字元。這個想法是創建一個僅包含此字元的 pdf 文件,並在 pdfLaTeX 中設定從 ú 到包含此 pdf 的映射,但僅適用於小型大寫字母(並映射到\'u所有其他字體樣式)。

獨立 ú 小寫,使用 XeLaTeX 或 LuaLaTeX 編譯。在下面的程式碼中,該檔案被稱為artemisscu.pdf.

\documentclass{standalone}
\usepackage{fontspec}
\setmainfont{GFSArtemisia.otf}
\begin{document}
\textsc{ú}
\end{document}

映射,使用小型大寫字母檢測https://tex.stackexchange.com/a/31660

\documentclass{scrbook}
\usepackage{gfsartemisia-euler} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{tipa}
\usepackage{newunicodechar}
\usepackage{graphicx}

\makeatletter
\newcommand*{\IfSmallCapsTF}{%
  \ifx\f@shape\my@test@sc
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\newcommand*{\my@test@sc}{sc}
\makeatother

\newunicodechar{ú}{\IfSmallCapsTF{\raisebox{-0.02Ex}{\includegraphics[width=1.12Ex]{artemisscu}}}{\'u}}

\begin{document}
Os números

\scshape Os números
  
\Huge Os números
  
\tiny Os números
    
\normalsize Os n\'umeros
  
Nos capítulos, nas equações...
  
É mesmo? Então faça com as próprias mãos  

Höla e também H\"ola. (Exige tipa)

\normalfont
Os números
  
\end{document}

請注意,圖形的大小和位置是以Ex單位設定的,因此它會隨著字體大小而縮放。

結果:

在此輸入影像描述

請注意,它\'u本身沒有映射,因此您需要實際的 ú 作為輸入才能使其工作。

相關內容