summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex55
1 files changed, 30 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
index b290167279b..5174a421d75 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
@@ -36,15 +36,15 @@ These defaults (and further customisations possible) are discussed in \vref{sec:
\CMD{\string\newfontfamily}\meta{cmd}\marg{font}\oarg{font features}\\
\CMD{\string\setfontfamily}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}\\
\CMD{\string\renewfontfamily}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}
+ \CMD{\string\providefontfamily}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}
}
These commands define new font family commands (like \cs{rmfamily}).
The |new| command checks if \meta{cmd} has been defined, and issues an error if so.
The |renew| command checks if \meta{cmd} has been defined, and issues an error if not.
+The |provide| command checks if \meta{cmd} has been defined, and silently aborts if so.
The |set| command never checks; use at your own risk.
-\textbf{NEW:} In previous versions of \pkg{fontspec}, only \cs{newfontfamily} was provided, but it behaved
-like \cs{setfontfamily}. You'll have to update your code slightly if this now causes problems; apologies.
\bigskip
@@ -282,20 +282,15 @@ The \cs{IfFontExistsTF} command is a synonym for the programming interface funct
\section{Commands to select font families}
-\cmdbox{
- \CMD{\string\newfontfamily}\cs{\meta{font-switch}}\marg{font name}\oarg{font features} \\
- \CMD{\string\newfontface}\cs{\meta{font-switch}}\marg{font name}\oarg{font features}
-}
-
-\noindent For cases when a specific font with a specific
+For cases when a specific font with a specific
feature set is going to be re-used many times in a document, it is inefficient
to keep calling \cs{fontspec} for every use. While the \cs{fontspec} command does not define
a new font instance after the first call, the feature options must still be
parsed and processed.
-\DescribeMacro{\newfontfamily}
For this reason, new commands can be created for loading a particular font
-family with the \cmd\newfontfamily\ command, demonstrated in \exref{nff}.
+family with the \cmd\newfontfamily\ command and variants,
+outlined in \vref{sec:main-cmd} and demonstrated in \exref{nff}.
This macro should be used to create commands that would be used in
the same way as \cmd\rmfamily, for example.
If you would like to create a command that only changes the font
@@ -313,7 +308,31 @@ to delimit the scope of the font change.
\notefont This is a \emph{note}.
\end{Lexample}
-\DescribeMacro{\newfontface}
+\emph{Comment for advanced users:}
+The commands defined by \cs{newfontfamily} (and \cs{newfontface}; see next section) include
+their encoding information, so even if the document is set to use a
+legacy \TeX\ encoding, such commands will still work correctly. For example,
+\begin{Verbatim}
+\documentclass{article}
+\usepackage{fontspec}
+\newfontfamily\unicodefont{Lucida Grande}
+\usepackage{mathpazo}
+\usepackage[T1]{fontenc}
+\begin{document}
+A legacy \TeX\ font. {\unicodefont A unicode font.}
+\end{document}
+\end{Verbatim}
+
+
+\section{Commands to select single font faces}
+
+\cmdbox{%
+ \CMD{\string\newfontface}\meta{cmd}\marg{font}\oarg{font features}\\
+ \CMD{\string\setfontface}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}\\
+ \CMD{\string\renewfontface}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}
+ \CMD{\string\providefontface}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}
+}
+
Sometimes only a specific font face is desired, without accompanying italic or bold variants
being automatically selected.
This is common when selecting a fancy italic font, say, that has swash features unavailable
@@ -327,20 +346,6 @@ in \exref{nfface}, which is repeated in \vref{sec:contextuals}.
% \emph, \textbf, etc., all don't work
\end{Xexample}
-Comment for advanced users:
-The commands defined by \cs{newfontface} and \cs{newfontfamily} include
-their encoding information, so even if the document is set to use a
-legacy \TeX\ encoding, such commands will still work correctly. For example,
-\begin{Verbatim}
-\documentclass{article}
-\usepackage{fontspec}
-\newfontfamily\unicodefont{Lucida Grande}
-\usepackage{mathpazo}
-\usepackage[T1]{fontenc}
-\begin{document}
-A legacy \TeX\ font. {\unicodefont A unicode font.}
-\end{document}
-\end{Verbatim}
\subsection{More control over font shape selection}
\label{sec:bfitfonts}