Smallcaps com TeX Gyre Pagella e XeLaTeX

Smallcaps com TeX Gyre Pagella e XeLaTeX

Essa pergunta já foi feitaaqui, mas a resposta aceita reverte para pdflatex, o que não funcionará para este projeto.

Eu especifiquei originalmente a fonte Palatino com \usepackage[sc, osf]{mathpazo}, mas tenhoaprendidoque polyglossia, como preciso para vários idiomas internacionais, carrega implicitamente fontspec, estou usando \setmainfont{TeX Gyre Pagella}, uma fonte que instalei manualmente no sistema (OS X) deCTANdownload.

TeX Gyre Pagellanão parece incluir letras minúsculas, então baixei e instalei Palatino Small Caps & Old Style Figures.ttfconforme mostrado aqui:

fc-list | grep Palatino
/Users/mikekilmer/Library/Fonts/Palatino Small Caps & Old Style Figures.ttf: Palatino Small Caps & Old Style,Palatino:style=Regular,Small Caps & Old Style Figures
/System/Library/Fonts/Palatino.ttc: Palatino:style=Bold
/System/Library/Fonts/Palatino.ttc: Palatino:style=Regular
/System/Library/Fonts/Palatino.ttc: Palatino:style=Bold Italic
/System/Library/Fonts/Palatino.ttc: Palatino:style=Italic

Pelo que posso dizer pelas informações de fonte a seguir, Palatino-SC seria o nome de referência a ser usado:

otfinfo -i '~/Library/Fonts/Palatino Small Caps & Old Style Figures.ttf'
Family:              Palatino Small Caps & Old Style
Subfamily:           Regular
Full name:           Palatino-SC
PostScript name:     Palatino-SC
Version:             001.001
Unique ID:           Palatino Small Caps & Old Style Figures:1178633258
Copyright:           Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated.  All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.

Mas neste exemplo, não há letras maiúsculas exibidas:

\documentclass[a5paper,twoside,11pt]{extbook}
\usepackage{polyglossia}
\setdefaultlanguage{english} 
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Numbers=OldStyle,
SmallCapsFont={Palatino-SC},
SmallCapsFeatures={Letters=SmallCaps}
 ]{TeX Gyre Pagella}
\begin{document}
\textsc{Once upon a time} we had a story. Once upon a time.
\end{document}

O que ESTÁ funcionando é a seguinte fontspecsubstituição de família de fontes:

\newfontfamily\scshape[Letters=SmallCaps,Scale=1.15]{Palatino-SC}

Alguém pode explicar 1. Por que os setmainfontparâmetros não estão funcionando e 2. Como posso exibir OldStyleNums?

Responder1

A definição de fontes no XeLaTeX depende de como você as instalou.

Se TeX Gyre Pagella estiver disponível como fonte do sistema, então

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{english}

\setmainfont{TeX Gyre Pagella}[
  Numbers=OldStyle,
]

\begin{document}

\textsc{Once upon a time} we had a story. Once upon a time.

1234567890

\end{document}

será suficiente. Caso contrário, você precisará usar as fontes da distribuição TeX Live com um método um pouco mais complicado.

Se eu executar o exemplo com xelatex -output-driver="xdvipdfmx -vv", obtenho a seguinte saída no terminal:

DVI Comment:  XeTeX output 2017.01.29:2158
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</Library/Fonts/tex-gyre/[email protected]<NATIVE-FONTMAP:/Library/Fonts/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0>
fontmap: /Library/Fonts/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0 -> /Library/Fonts/tex-gyre/texgyrepagella-regular.otf(Identity-H)

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/Library/Fonts/tex-gyre/texgyrepagella-regular.otf".
(CID:TeXGyrePagella-Regular)
pdf_font>> Type0 font "/Library/Fonts/tex-gyre/texgyrepagella-regular.otf" cmap_id=<Identity-H,0> opened at font_id=</Library/Fonts/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0,0>.
></Library/Fonts/tex-gyre/[email protected]>]
otf_cmap>> Creating ToUnicode CMap for "/Library/Fonts/tex-gyre/texgyrepagella-regular.otf"...
(CID:/Library/Fonts/tex-gyre/texgyrepagella-regular.otf[SMRJXI+TeXGyrePagella-Regular][CIDFontType0][39 glyphs][5175 bytes])

que mostra que instalei as fontes TeX Gyre /Library/Fontse elas são usadas por xdvipdfmx.

A versão um pouco mais complicada é

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{english}

\setmainfont{texgyrepagella}[
  Extension=.otf,
  UprightFont=*-regular,
  ItalicFont=*-italic,
  BoldFont=*-bold,
  BoldItalicFont=*-bolditalic,
  Numbers=OldStyle,
]

\begin{document}

\textsc{Once upon a time} we had a story. Once upon a time.

1234567890

\end{document}

e a saída detalhada se torna

DVI Comment:  XeTeX output 2017.01.29:2202
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/[email protected]<NATIVE-FONTMAP:/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0>
fontmap: /usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0 -> /usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf(Identity-H)

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf".
(CID:TeXGyrePagella-Regular)
pdf_font>> Type0 font "/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf" cmap_id=<Identity-H,0> opened at font_id=</usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf/0/H/65536/0/0,0>.
></usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/[email protected]>]
otf_cmap>> Creating ToUnicode CMap for "/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf"...
(CID:/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyrepagella-regular.otf[KRFMAA+TeXGyrePagella-Regular][CIDFontType0][39 glyphs][5175 bytes])

mostrando que os diretórios do TeX Live são usados.

A saída é a mesma em ambos os casos.

insira a descrição da imagem aqui

Como você pode ver, versaletes são respeitados.

informação relacionada