Linux Libertinum 不能与 XeLaTeX 一起使用吗?

Linux Libertinum 不能与 XeLaTeX 一起使用吗?

谁能告诉我,为什么在创建以下代码的 pdf 后没有使用 Linux Libertine?

\documentclass[twoside, paper=A4,11pt]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage{xltxtra}
\defaultfontfeatures{
   Mapping=tex-text,
   Numbers=OldStyle,
   Scale=MatchLowercase,
   SmallCapsFeatures={LetterSpace=20},
   Ligatures={TeX,Common},
   RawFeature=%
      +onum;% Oldstyle Figures
      +pnum;% Proportional Figures
      +cpsp;% Capital Spacing
      +kern% Kerning 
   }
\newfontfamily{\FSerifA}%
{Linux Libertine O}\DeclareTextFontCommand{%
\fSerifA}{\FSerifA}

 \renewcommand*{\rmfamily}{\fSerifA}
 \begin{document}
 \begin{quote}
 \section{main font}
 This is a font test.


\textit{This is a font test.}


\emph{This is a font test.}


\textsc{This is a font test.}


\textbf{This is a font test.}
 \section{specific font}
 \FSerifA
 This is a font test.


\textit{This is a font test.}


\emph{This is a font test.}


\textsc{This is a font test.}


\textbf{This is a font test.}


\end{quote}
\end{document}

文档首选项告诉我我将使用标准字体(lmroman10regular)...日志向我显示了以下内容:

.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O scale = 1.004661224781475.
.................................................
\g__fontspec_family_LinuxLibertineO_int=\count124
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O scale = 1.004661224781475.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O scale = 1.004661224781475.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/B scale = 0.9308850351233078.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/B scale = 0.9308850351233078.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/I scale = 1.004661224781475.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/I scale = 1.004661224781475.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/BI scale = 0.9685413665685476.
.................................................
.................................................
. fontspec info: "set-scale"
. 
. Linux Libertine O/BI scale = 0.9685413665685476.
.................................................
.................................................
. fontspec info: "defining-font"
. 
. Font family 'LinuxLibertineO(0)' created for font 'Linux Libertine O' with
. options
. [Mapping=tex-text,Numbers=OldStyle,Scale=MatchLowercase,SmallCapsFeatures={Le
tterSpace=20},Ligatures={TeX,Common},RawFeature=+onum;+pnum;+cpsp;+kern].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.: <->s*[1.004661224781475]"Linux Libertine
. O/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+liga;
+onum;+pnum;+cpsp;+kern;"
. - 'small caps'  (m/sc) with NFSS spec.: <->s*[1.004661224781475]"Linux
. Libertine
. O/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+liga;
+onum;+pnum;+cpsp;+kern;+smcp;letterspace=20;"-
. 'bold' (bx/n) with NFSS spec.: <->s*[0.9308850351233078]"Linux Libertine
. O/B/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+lig
a;+onum;+pnum;+cpsp;+kern;"
. - 'bold small caps'  (bx/sc) with NFSS spec.:
. <->s*[0.9308850351233078]"Linux Libertine
. O/B/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+lig
a;+onum;+pnum;+cpsp;+kern;+smcp;letterspace=20;"-
. 'italic' (m/it) with NFSS spec.: <->s*[1.004661224781475]"Linux Libertine
. O/I/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+lig
a;+onum;+pnum;+cpsp;+kern;"
. - 'italic small caps'  (m/itsc) with NFSS spec.:
. <->s*[1.004661224781475]"Linux Libertine
. O/I/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+lig
a;+onum;+pnum;+cpsp;+kern;+smcp;letterspace=20;"-
. 'bold italic' (bx/it) with NFSS spec.: <->s*[0.9685413665685476]"Linux
. Libertine
. O/BI/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+li
ga;+onum;+pnum;+cpsp;+kern;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.:
. <->s*[0.9685413665685476]"Linux Libertine
. O/BI/OT:script=latn;language=DFLT;mapping=tex-text;+onum;mapping=tex-text;+li
ga;+onum;+pnum;+cpsp;+kern;+smcp;letterspace=20;"
.................................................

(./Fonttest.aux)
\openout1 = `Fonttest.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for EU1/lmr/m/n on input line 21.
LaTeX Font Info:    ... okay on input line 21.
LaTeX Font Info:    Checking defaults for T3/cmr/m/n on input line 21.
LaTeX Font Info:    Try loading font information for T3+cmr on input line 21.
 (/usr/share/texmf/tex/latex/tipa/t3cmr.fd
File: t3cmr.fd 2001/12/31 TIPA font definitions
)
LaTeX Font Info:    ... okay on input line 21.
.................................................
. fontspec info: "setup-math"
. 
. Adjusting the maths setup (use [no-math] to avoid this).
.................................................
\symlegacymaths=\mathgroup4
LaTeX Font Info:    Overwriting symbol font `legacymaths' in version `bold'
(Font)                  OT1/cmr/m/n --> OT1/cmr/bx/n on input line 21.
LaTeX Font Info:    Redeclaring math accent \acute on input line 21.
LaTeX Font Info:    Redeclaring math accent \grave on input line 21.
LaTeX Font Info:    Redeclaring math accent \ddot on input line 21.
LaTeX Font Info:    Redeclaring math accent \tilde on input line 21.
LaTeX Font Info:    Redeclaring math accent \bar on input line 21.
LaTeX Font Info:    Redeclaring math accent \breve on input line 21.
LaTeX Font Info:    Redeclaring math accent \check on input line 21.
LaTeX Font Info:    Redeclaring math accent \hat on input line 21.
LaTeX Font Info:    Redeclaring math accent \dot on input line 21.
LaTeX Font Info:    Redeclaring math accent \mathring on input line 21.
LaTeX Font Info:    Redeclaring math symbol \colon on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Gamma on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Delta on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Theta on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Lambda on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Xi on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Pi on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Sigma on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Upsilon on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Phi on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Psi on input line 21.
LaTeX Font Info:    Redeclaring math symbol \Omega on input line 21.
LaTeX Font Info:    Redeclaring math symbol \mathdollar on input line 21.
LaTeX Font Info:    Redeclaring symbol font `operators' on input line 21.
LaTeX Font Info:    Encoding `OT1' has changed to `EU1' for symbol font
(Font)              `operators' in the math version `normal' on input line 21.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> EU1/lmr/m/n on input line 21.
LaTeX Font Info:    Encoding `OT1' has changed to `EU1' for symbol font
(Font)              `operators' in the math version `bold' on input line 21.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> EU1/lmr/m/n on input line 21.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  EU1/lmr/m/n --> EU1/lmr/m/n on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> EU1/lmr/m/it on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> EU1/lmr/bx/n on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> EU1/lmss/m/n on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> EU1/lmtt/m/n on input line 21.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  EU1/lmr/m/n --> EU1/lmr/bx/n on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> EU1/lmr/bx/it on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> EU1/lmss/bx/n on input line 21.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> EU1/lmtt/bx/n on input line 21.
 [1

] (./Fonttest.aux) )

答案1

为什么?

在开始文档时,\normalfont执行命令,该命令执行

\usefont{\encodingdefault}{\familydefault}{\seriesdefault}{\shapedefault}

是什么\familydefault意思? 它确实\rmdefault如此,这反过来又解析为lmr,因为您从未更改过它。

\rmfamily命令通常会执行非常不同的事情,并且像你这样重新定义它是非常错误的。它被使用用于选择直立字体系列的文档,例如\textrm

因此\FSerifA,除非您明确发布它,否则不会执行。

如果您想定义多个字体系列,然后选择使用哪一个,\rmfamily您可以按如下方式操作:

\newfontfamily{\linuxlibertine}{Linux Libertine O}[
  NFSSFamily=linuxlibertine,
  % other options
]

进而

\renewcommand{\rmdefault}{linuxlibertine}

例子:

\documentclass[twoside, paper=A4,11pt]{scrreprt}
\usepackage[ngerman]{babel}

\usepackage{fontspec}

\newfontfamily{\linuxlibertine}{Linux Libertine O}[
  NFSSFamily=linuxlibertine,
  % other options
]
\renewcommand*{\rmdefault}{linuxlibertine}

\begin{document}

\section{main font}

This is a font test.\par
\textit{This is a font test.}\par
\emph{This is a font test.}\par
\textsc{This is a font test.}\par
\textbf{This is a font test.}\par
\fontname\font

\end{document}

在此处输入图片描述

答案2

您添加的一些参数要么是多余的—— +onum+pnum+kern—— 要么是不需要的,因为它是默认的:Mapping=tex-textLigatures={TeX,Common} Scale=MatchLowercase(您应该将其与哪种小写字体匹配?)。我\DeclareTextFontCommand{\fSerifA}{\FSerifA}也没有看到 的任何理由。因此,这只剩下:SmallCapsFeatures={LetterSpace=20}和大写间距,可以使用 来完成Kerning=Uppercase

如果您将这些选项传递给字体,您可以非常轻松地在十几种字体之间切换。如您所见,\rmfamily并不总是等于\setmainfont

 \documentclass[twoside, paper=A4,11pt]{scrreprt}
   \usepackage{fontspec}
   \usepackage[ngerman]{babel}


   \setmainfont[Numbers=OldStyle,SmallCapsFeatures={LetterSpace=20},Kerning=Uppercase]{Linux Biolinum O}

   \newfontfamily{\libertine}{Linux Libertine O}[Numbers=OldStyle,SmallCapsFeatures={LetterSpace=20},Kerning=Uppercase]

 \renewcommand*{\rmfamily}{\libertine}

   \begin{document}

   %\rmfamily

   This is a font test. 123780 --- ``''

   \textsc{  This is a font test. 123780}

   \textit{  This is a font test. 123780}

   \bigskip

   \libertine


   This is a font test. 123780 --- ``''

   \textsc{  This is a font test. 123780}

   \textit{  This is a font test. 123780}

   \end{document}

相关内容