From 2783c1b2807e488a59202f7e4605c8d5693c9ab7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 12 Feb 2017 23:33:12 +0000 Subject: fontspec (12feb17) git-svn-id: svn://tug.org/texlive/trunk@43202 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/fontspec/fontspec-doc-featset.tex | 4 +- .../source/latex/fontspec/fontspec-doc-fontsel.tex | 24 +- .../source/latex/fontspec/fontspec-doc-intro.tex | 37 ++- .../source/latex/fontspec/fontspec-doc-luatex.tex | 9 +- .../latex/fontspec/fontspec-doc-opentype.tex | 6 +- .../source/latex/fontspec/fontspec-doc-style.sty | 288 +++++++++++++++++++++ .../source/latex/fontspec/fontspec-doc-xetex.tex | 6 +- .../source/latex/fontspec/fontspec-doc.tex | 2 +- .../source/latex/fontspec/fontspec-feat-aat.dtx | 2 +- .../latex/fontspec/fontspec-feat-opentype.dtx | 13 +- .../source/latex/fontspec/fontspec-fontload.dtx | 4 +- .../source/latex/fontspec/fontspec-internal.dtx | 18 +- .../source/latex/fontspec/fontspec-keyval.dtx | 19 +- .../source/latex/fontspec/fontspec-lua.dtx | 13 - .../source/latex/fontspec/fontspec-opentype.dtx | 12 +- .../source/latex/fontspec/fontspec-patches.dtx | 158 ----------- .../source/latex/fontspec/fontspec-user.dtx | 25 +- .../source/latex/fontspec/fontspec-vars.dtx | 4 + .../source/latex/fontspec/fontspec-xfss.dtx | 266 +++++++++++++++++++ .../texmf-dist/source/latex/fontspec/fontspec.dtx | 18 +- 20 files changed, 703 insertions(+), 225 deletions(-) create mode 100644 Master/texmf-dist/source/latex/fontspec/fontspec-doc-style.sty create mode 100644 Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx (limited to 'Master/texmf-dist/source/latex/fontspec') diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex index a0e95d282e6..3a1da2019ac 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex @@ -514,9 +514,9 @@ This package redefines \LaTeX's \cmd\-\ macro such that it adjusts along with th EXAMPLE HYPHENATION% }}\qquad\qquad\null\par\bigskip} - \fontspec{Linux Libertine O}[HyphenChar=None] + \fontspec{LinLibertine_R.otf}[HyphenChar=None] \text - \fontspec{Linux Libertine O}[HyphenChar={+}] + \fontspec{LinLibertine_R.otf}[HyphenChar={+}] \text \end{Xexample} 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 110266c858a..90892939bfc 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex @@ -14,17 +14,19 @@ fonts. } These are the main font-selecting commands of this package. -The \cs{fontspec} command selects a font for one-time use; all +The \cs{fontspec} command selects a font for one-time use only; all others should be used to define the standard fonts used in a document, as shown in \exref{fontload}. Here, the scales of the fonts have been chosen to equalise their lowercase letter heights. The \feat{Scale} font feature will be discussed further in \vref{sec:font-ind-features}, including methods for automatic scaling. +Note that further options may need to be added to select appropriate bold/italic fonts, +but this shows the main idea. \begin{Lexample}{fontload}{Loading the default, sans serif, and monospaced fonts.} \setmainfont{texgyrebonum-regular.otf} \setsansfont{lmsans10-regular.otf}[Scale=MatchLowercase] - \setmonofont{Inconsolata.otf}[Scale=MatchLowercase] + \setmonofont{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase] \rmfamily Pack my box with five dozen liquor jugs\par \sffamily Pack my box with five dozen liquor jugs\par @@ -390,6 +392,24 @@ The \feat{FontFace} command also interacts properly with the \feat{SizeFeatures} \end{Verbatim} Note that if the first \feat{Font} feature is omitted then each size needs its own inner \feat{Font} declaration. +\subsubsection{An example for \cs{strong}} +\label{sec:strong-example} + +If you wanted to set up a font family to allow nesting of the \cs{strong} +to easily access increasing font weights, you might use a declaration along the following lines: +\begin{Verbatim} +\setmonofont{SourceCodePro}[ + Extension = .otf , + UprightFont = *-Light , + BoldFont = *-Regular , + FontFace = {k}{n}{*-Black} , +] +\strongfontdeclare{\bfseries,\fontseries{k}\selectfont} +\end{Verbatim} + +Further `syntactic sugar' is planned to make this process somewhat easier. + + \subsection{Math(s) fonts} When \cmd\setmainfont, \cmd\setsansfont\ and \cmd\setmonofont\ are used in the diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex index 560a68e003b..61636f44ac0 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex @@ -180,16 +180,15 @@ For example, will produce small caps within |\emph{\emph{...}}|. \DescribeMacro{\emfontdeclare} -The \pkg{fontspec} package takes this idea one step further to allow arbitrary font changes (e.g., boldness) and arbitrary levels of nesting within emphasis. +The \pkg{fontspec} package takes this idea one step further to allow arbitrary font shape changes and arbitrary levels of nesting within emphasis. This is performed using the |\emfontdeclare| command, which takes a comma-separated list of font switches corresponding to increasing levels of emphasis. -Two examples: +An example: \begin{enumerate} \item |\emfontdeclare{\itshape,\upshape\scshape,\itshape}| will lead to `italics', `small caps', then `italic small caps' as the level of emphasis increases, as long as italic small caps are defined for the font. Note that |\upshape| is required because the font changes are cascading. -\item |\emfontdeclare{\bfseries,\fontseries{h}\selectfont,\fontseries{x}\selectfont}| could lead to (if fonts are set up correctly) `bold', `heavy', and `extra bold'. \end{enumerate} -The implementation of these feature tries to be `smart' and guess what level of emphasis to use in the case of manual font changing. -This is reliable only if you use series- and/or shape- changing commands in \cs{emfontdeclare}. +The implementation of this feature tries to be `smart' and guess what level of emphasis to use in the case of manual font changing. +This is reliable only if you use shape-changing commands in \cs{emfontdeclare}. For example: \begin{Verbatim} \emfontdeclare{\itshape,\upshape\scshape,\itshape} @@ -200,3 +199,31 @@ Here, the emphasised text `hello' will be printed in italic small caps since |\e \DescribeMacro{\emreset} Finally, if you have so much nested emphasis that |\emfontdeclare| runs out of options, it will insert |\emreset| (by default just |\upshape|) and start again from the beginning. + + +\subsection{Strong emphasis} + +\DescribeMacro{\strong} +\DescribeMacro{\strongenv} +The \cs{strong} macro is used analogously to \cs{emph} but produces variations in weight. +If you need it in environment form, use |\begin{strongenv}...\end{strongenv}|. + +As with emphasis, this font-switching command is intended to move through a range +of font weights. For example, if the fonts are set up correctly it allows usage such as +|\strong{...\strong{...}}| in which each nested \cs{strong} macro increases the +weight of the font. + +\DescribeMacro{\strongfontdeclare} +Currently this feature set is somewhat experimental and there is no syntactic sugar +to easily define a range of font weights using \pkg{fontspec} commands. +Use, say, the following to define first bold and then black (|k|) font faces for \cs{strong}: +\begin{Verbatim} + \strongfontdeclare{\bfseries,\fontseries{k}\selectfont} +\end{Verbatim} + +\DescribeMacro{\strongreset} +If too many levels of \cs{strong} are reached, \cs{strongreset} is inserted. +By default this is a no-op and the font will simply remain the same. +Use \cs{renewcommand}\cs{strongreset}|{\mdseries}| to start again from the beginning if desired. + +An example for setting up a font family for use with \cs{strong} is discussed in \vref{sec:strong-example}. diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex index c2ae7daf5ad..87b95db3687 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex @@ -21,13 +21,10 @@ Please refer to the \LuaTeX/\pkg{luaotfload} documentation for more details. \directlua{ fonts.handlers.otf.addfeature { name = "oneb", - { - type = "substitution", - data = { + type = "substitution", + data = { ["1"] = "one.ss01", - }, - }, - "feature oneb for vollkorn font", + } } } \setmainfont{Vollkorn-Regular.otf}[RawFeature=+oneb] diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex index cd4ac0b5724..31923746f9d 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex @@ -280,7 +280,7 @@ will look. OpenType fonts may contain the following options: \Huge\centering \def\test#1#2{% #2 $\to$ {\addfontfeature{#1} #2}\\} - \fontspec{Linux Libertine O} + \fontspec{LinLibertine_R.otf} \test{Ligatures=Historic}{strict} \test{Ligatures=Rare}{wurtzite} \test{Ligatures=NoCommon}{firefly} @@ -324,7 +324,7 @@ in \exref{letters-uppercase}; note the raised position of the hyphen to better match the surrounding letters. \begin{Lexample}{letters-uppercase}{An example of the \opt{Uppercase} option of the \feat{Letters} feature.} - \fontspec{Linux Libertine O} + \fontspec{LinLibertine_R.otf} UPPER-CASE example \\ \addfontfeature{Letters=Uppercase} UPPER-CASE example @@ -775,7 +775,7 @@ to \texttt{Alternate=0} to access the default case. \begin{Xexample}[firstline=2]{salt}{The \feat{Alternate} feature.} \huge - \fontspec{Linux Libertine O} + \fontspec{LinLibertine_R.otf} \textsc{a} \& h \\ \addfontfeature{Alternate=0} \textsc{a} \& h diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-style.sty b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-style.sty new file mode 100644 index 00000000000..115d52a3b18 --- /dev/null +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-style.sty @@ -0,0 +1,288 @@ +\ProvidesPackage{fontspec-doc-style} + +\usepackage{fontspec,booktabs,calc,caption,color,enumitem,flafter,fancyvrb,hologo,graphicx, + ifthen,url,varioref,varwidth,microtype,tocloft,framed,xparse,docmute} + +%% Various labelling commands: +\newcommand*\name[1]{{#1}} +\newcommand*\pkg[1]{\textsf{#1}} +\newcommand*\opt[1]{\texttt{#1}} +\newcommand*\feat[1]{\texttt{#1}} + +\let\latin\textit +\def\eg{\latin{e.g.}} +\def\ie{\latin{i.e.}} +\def\Eg{\latin{E.g.}} +\def\Ie{\latin{I.e.}} +\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}} + +\newcommand\note[1]{\unskip\footnote{#1}} + +\def\MacOSX{Mac~OS~X} +\def\AAT{\textsc{aat}} +\def\ATSUI{\textsc{atsui}} + +\newcommand\NFSS{\textsc{nfss}} +\newcommand\XeTeX{\hologo{XeTeX}} +\newcommand\XeLaTeX{\hologo{XeLaTeX}} +\newcommand\LuaTeX{\hologo{LuaTeX}} +\newcommand\LuaLaTeX{\hologo{LuaLaTeX}} + +% ToC formatting: +\setlength\cftsubsecnumwidth{1.4\cftsubsecnumwidth} +%\def\@cfttocstart{\small\begin{multicols}{2}} +%\def\@cfttocfinish{\end{multicols}} + +\fvset{gobble=0} + +\captionsetup[table]{position=above} +\captionsetup[figure]{position=above} + + +%% Fonts + +\defaultfontfeatures{Numbers=OldStyle} +\IfFontExistsTF{AldusNovaPro-Book.otf} + { + \setmainfont{aldus-nova} + \setsansfont{palatino-sans-light} + } + { +\setmainfont{texgyrepagella}[ + Extension = .otf, + UprightFont = *-regular , + ItalicFont = *-italic , + BoldFont = *-bold , + BoldItalicFont = *-bolditalic , +] +\setsansfont{texgyreheros}[ + Extension = .otf, + UprightFont = *-regular , + ItalicFont = *-italic , + BoldFont = *-bold , + BoldItalicFont = *-bolditalic , +] + } +\setmonofont{lmmono10-regular.otf}[ + Numbers={Lining,SlashedZero}, + ItalicFont=lmmonoslant10-regular.otf, + BoldFont=lmmonolt10-bold.otf, + BoldItalicFont=lmmonolt10-boldoblique.otf, +] +\newfontfamily\ttcondensed{lmmonoltcond10-regular.otf} + +%% (La)TeX font-related declarations: +\linespread{1.05} % Pagella needs more space between lines +\frenchspacing % Remove ugly extra space after punctuation + +\usepackage[ + bookmarks=true, + colorlinks=true, + linkcolor=niceblue, + urlcolor=niceblue, + citecolor=niceblue, + pdftitle={The fontspec package}, + pdfsubject={Advanced font selection for XeLaTeX/LuaLaTeX}, + pdfauthor={Will Robertson}, + pdfkeywords={xetex, xelatex, luatex, lualatex, unicode, opentype, aat} + ]{hyperref} + + + +%% ToC +\def\@dotsep{1000} +\setcounter{tocdepth}{2} +\setlength\columnseprule{0.4pt} +\renewcommand\tableofcontents{\relax + \begin{multicols}{2}[\section*{\contentsname}]\relax + \@starttoc{toc}\relax + \end{multicols}} + + +%% Index +\setcounter{IndexColumns}{2} +\renewenvironment{theglossary} + {\small\list{}{} + \item\relax + \glossary@prologue\GlossaryParms + \let\item\@idxitem \ignorespaces + \def\pfill{\hspace*{\fill}}} + {\endlist} + + + +%% varioref definitions: +\labelformat{table}{Table~#1} +\labelformat{section}{Section~#1} +\labelformat{subsection}{Section~#1} + +\definecolor{niceblue}{rgb}{0.1,0.2,0.8} + + + + +%% EXAMPLES + +\newsavebox\X +\newsavebox\Y + +\newcounter{example} + +\newcommand\exref[1]{Example~\ref{ex:#1}} +\newcommand\Exref[1]{Example~\ref{ex:#1}} + +\newenvironment{Xexample}[3][] + {\VerbatimEnvironment\begin{Fexample}[#1]{#2}{#3}{X}} + {\end{Fexample}} + +\newenvironment{Lexample}[3][] + {\VerbatimEnvironment\begin{Fexample}[#1]{#2}{#3}{L}} + {\end{Fexample}} + +\newenvironment{Fexample}[4][] + {% + \def\options{#1}% + \def\filename{#2}% + \def\captiontext{#3}% + \def\prefix{#4} + \refstepcounter{example}% + \label{ex:\filename}% + \IfFileExists{zzz-\theexample-\prefix-\filename.tex}{}{% + \immediate\write18{rm -f zzz-\theexample-* ;}% + }% + \VerbatimEnvironment + \begin{VerbatimOut}{zzz-\theexample-\prefix-\filename.tex}} +% text in the environment + {\end{VerbatimOut} + \begin{figure} + \setlength\parindent{0pt}% + \edef\@tempa{[gobble=0,fontsize=\noexpand\small,\options]}% + \savebox\X{% + \expandafter\BVerbatimInput + \@tempa{zzz-\theexample-\prefix-\filename.tex}% + }% + \IfFileExists{zzz-\theexample-\prefix-\filename.pdf}{} + {% + \edef\XXcmd{% + \unexpanded{% + \RequirePackage{luatex85} + \documentclass[margin=0.2mm]{standalone} + \usepackage{booktabs,ifthen,graphicx,xcolor,varwidth} + \usepackage{fontspec} + \defaultfontfeatures{Ligatures=TeX} + \begin{document} + \begin{varwidth}{0.7\linewidth} + \input} zzz-\theexample-\prefix-\filename.tex + \unexpanded{ + \end{varwidth} + \end{document} + }% + }% + \edef\1{% + \csname prog@\prefix\endcsname "\unexpanded\expandafter{\XXcmd}"; + printf '\@percentchar s' '\unexpanded\expandafter{\XXcmd}' > zzz-\theexample-\prefix-\filename-test.tex; + }% + \immediate\write18{\unexpanded\expandafter{\1}}% + }% + \savebox\Y{% + \IfFileExists{zzz-\theexample-\prefix-\filename.pdf} + {\includegraphics{zzz-\theexample-\prefix-\filename.pdf}} + {\color{red}\itshape ---Graphic not generated---}% + } + % TYPESETTING + \rule[0.5\baselineskip]{\columnwidth}{1pt}% + \vspace{-1.2ex}% + \def\@tempa{\small\textsf{Example~\theexample:~}}% + \settowidth\@tempdima{\@tempa\captiontext}% + \par + \ifdim\@tempdima>\linewidth + \settowidth\@tempdima{\@tempa}% + \@tempa\parbox[t]{\linewidth-\@tempdima}{\small\captiontext}% + \vspace{0.4\baselineskip}% + \else + \parbox{\linewidth}{\centering\@tempa~\captiontext}% + \fi + \par\rule[0.4\baselineskip]{\columnwidth}{0.4pt}\par + \ifdim\dimexpr\wd\X+\wd\Y>\linewidth\relax + \null\hfill\makebox[0pt][r]{\usebox\Y}\usebox\X + \else + \hfill\usebox\Y\hfill\usebox\X + \fi + \par\rule[0.5\baselineskip]{\columnwidth}{1pt} + \end{figure} +} + +\def\prog@X{xelatex + -jobname=zzz-\theexample-X-\filename\space} + +\def\prog@L{lualatex + -jobname=zzz-\theexample-L-\filename\space} + +%%%%%%%%%%%%%%%%%%%%%% + +\newcommand*\setexsize[1]{\let\examplesize#1} +\newcommand*\setverbwidth[1]{\def\auxwidth{#1}} + + + +\newcounter{argument} +\g@addto@macro\endmacro{\setcounter{argument}{0}} +\newcommand*\darg[1]{% + \stepcounter{argument}% + \noindent{\ttfamily\char`\#\theargument~:~}#1\par} +\newcommand*\doarg[1]{% + \stepcounter{argument}% + \noindent{\ttfamily\makebox[0pt][r]{[}\char`\#\theargument]:~}#1\par} + +\newcommand\unichar[2]{\textsc{\MakeLowercase{u+#1: #2}}} + +\newcommand\cmdbox[1]{% + \smallskip\par\noindent + \fbox{\begin{varwidth}{\linewidth} + #1% + \end{varwidth}}% + \smallskip +} +\def\CMD#1{\texttt{\null#1\unskip}} + + +\NewDocumentCommand \otf {somm} {% + \featname & #3 & \texttt{#4} + \IfBooleanT #1 { & \textdagger } + \\ +} +\newenvironment{features}[1]{% + \def\NOTE{} + \def\thisfeatname{#1}% + \def\featname{\thisfeatname~~\texttt=~~\null\gdef\featname{}}% + \begin{table} + \caption{Options for the OpenType font feature `\thisfeatname'.} + \edef\@tempa{\noexpand\label{feat:\thisfeatname}}\@tempa + \centering + \begin{tabular}{@{}l@{}l@{\hspace{0.5\tabcolsep}}l@{\hspace{0.5\tabcolsep}}l@{}} + \toprule + Feature & Option & Tag & \\ + \midrule +}{ + \bottomrule + \end{tabular} + \par\smallskip + \footnotesize + \textdagger\ These feature options can be disabled with \texttt{..Off} variants, and reset \\ to default state (neither explicitly on nor off) with \texttt{..Reset}. + \NOTE + \end{table} +} + + +%%%%%%%%%%% + +\def \MakePrivateLetters {% + \catcode `\@ = 11 + \catcode `\_ = 11 + \catcode `\: = 11 +} + +%% for LaTeX3 csnames +\catcode `\_= 11 + +\renewcommand\partname{Part} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex index c4684d8c915..62bae7e44d1 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex @@ -18,6 +18,8 @@ selected by \pkg{fontspec}. ``!`A small amount of---text!'' \end{Xexample} +Only one mapping can be active at a time and a second call to \feat{Mapping} +will simply override the first. Using the |tex-text| mapping is also equivalent to writing |Ligatures=TeX|. The use of the latter syntax is recommended for better compatibility with \LuaTeX\ documents. @@ -53,8 +55,8 @@ select the \opt{OpenType} renderer.} Multiple Master fonts are parameterised over orthogonal font axes, allowing continuous selection along such -features as weight, width, and optical size~(see \vref{sec:mm} for -further details). Whereas an OpenType font will have only a few separate +features as weight, width, and optical size. +Whereas an OpenType font will have only a few separate optical sizes, a Multiple Master font's optical size can be specified over a continuous range. Unfortunately, this flexibility makes it harder to create an automatic interface through \LaTeX, and the diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc.tex index ccd3f1f80c5..537510a8b91 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc.tex +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc.tex @@ -19,7 +19,7 @@ \title{The \textsf{fontspec} package\\Font selection for \XeLaTeX\ and \LuaLaTeX} \author{ \textsc{Will Robertson} and \textsc{Khaled Hosny}\\ - \texttt{will.robertson@latex-project.org} + \url{http://wspr.io/fontspec/} } \date{\filedate \qquad \fileversion} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx index deda43cc049..eeabacc0742 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx @@ -39,7 +39,7 @@ { Ligatures / TeX .code:n = { - \@@_update_featstr:n { mapping = tex-text } + \tl_set:Nn \l_@@_mapping_tl { tex-text } } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx index 7bfada24d79..168f1f36d9e 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx @@ -39,7 +39,13 @@ % \end{macrocode} % Emulate CM extra ligatures. % \begin{macrocode} -%\@@_define_opentype_onreset:nnnnn {Ligatures} {TeX} {} { mapping = tex-text } {} +%<*xetexx> +\keys_define:nn {fontspec-opentype} + { + Ligatures / TeX .code:n = { \tl_set:Nn \l_@@_mapping_tl {tex-text} }, + Ligatures / TeXReset .code:n = { \tl_clear:N \l_@@_mapping_tl }, + } +% %\@@_define_opentype_onreset:nnnnn {Ligatures} {TeX} {} { +tlig } {} % \end{macrocode} % @@ -86,8 +92,9 @@ % \end{macrocode} % % \begin{macrocode} -\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} -\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} +\aliasfontfeatureoption {Numbers} {Monospaced} {Tabular} +\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} +\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} % \end{macrocode} % % |luaotload| provides a custom |anum| feature for replacing Latin diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx index 88d5d1407dd..0f0bfedb9f3 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx @@ -1,5 +1,5 @@ -% \section{expl3 interface for font loading} +% \section{expl3 interface for primitive font loading} % % \iffalse % \begin{macrocode} @@ -13,6 +13,8 @@ { \font #1 = #2 ~at~ #3 \scan_stop: } +% \end{macrocode} +% \begin{macrocode} \cs_set:Npn \@@_primitive_font_gset:Nnn #1#2#3 { \global \font #1 = #2 ~at~ #3 \scan_stop: diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx index c57f0890a92..2de5752f0df 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx @@ -247,7 +247,9 @@ % \begin{macrocode} \cs_set:Nn \@@_construct_font_call:nnnnnn { - " \@@_fontname_wrap:n { #1 #2 #3 } #4 #5 +% " \@@_fontname_wrap:n { #1 #2 #3 } +% " \@@_fontname_wrap:n { #1 #2 } #3 + #4 #5 \str_if_eq_x:nnF {#6}{} {:#6} " } % \end{macrocode} @@ -276,8 +278,7 @@ } \cs_new:Nn \@@_font_is_file: { -% \cs_set:Npn \@@_fontname_wrap:n ##1 { [ \l_@@_font_path_tl ##1 ] } -% \cs_set:Npn \@@_fontname_wrap:n ##1 { file:\l_@@_font_path_tl ##1 } + \cs_set:Npn \@@_fontname_wrap:n ##1 { [ \l_@@_font_path_tl ##1 ] } } % \end{macrocode} % \end{macro} @@ -341,19 +342,24 @@ \bool_if:NTF \l_@@_ot_bool { % \typeout{::: Setting~ keys~ for~ OpenType~ font~ features:~"\l_@@_keys_leftover_clist"} - \keys_set:nx {fontspec-opentype} {\l_@@_keys_leftover_clist} + % \tracingall + \keys_set:nV {fontspec-opentype} \l_@@_keys_leftover_clist + % \EROROR } { % \typeout{::: Setting~ keys~ for~ AAT~ font~ features:~"\l_@@_keys_leftover_clist"} \bool_if:NT \l_@@_atsui_bool - { \keys_set:nx {fontspec-aat} {\l_@@_keys_leftover_clist} } + { \keys_set:nV {fontspec-aat} \l_@@_keys_leftover_clist } } % %<*luatex> % \typeout{::: Setting~ keys~ for~ OpenType~ font~ features:~"\l_@@_keys_leftover_clist"} - \keys_set:nx {fontspec-opentype} {\l_@@_keys_leftover_clist} + \keys_set:nV {fontspec-opentype} \l_@@_keys_leftover_clist % + \tl_if_empty:NF \l_@@_mapping_tl + { \@@_update_featstr:n { mapping = \l_@@_mapping_tl } } + \str_if_eq_x:nnF { \l_@@_hexcol_tl \l_@@_opacity_tl } { \g_@@_hexcol_tl \g_@@_opacity_tl } { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } } diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx index de3a804aabe..f81e1680d5b 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx @@ -646,13 +646,18 @@ % % \paragraph{Mapping} % \begin{macrocode} -\@@_keys_define_code:nnn {fontspec} {Mapping} %<*xetexx> - { - \@@_update_featstr:n { mapping = #1 } - } +\@@_keys_define_code:nnn {fontspec-aat} {Mapping} + { + \tl_set:Nn \l_@@_mapping_tl { #1 } + } +\@@_keys_define_code:nnn {fontspec-opentype} {Mapping} + { + \tl_set:Nn \l_@@_mapping_tl { #1 } + } % %<*luatex> +\@@_keys_define_code:nnn {fontspec-opentype} {Mapping} { \str_if_eq:nnTF {#1} {tex-text} { @@ -805,7 +810,11 @@ % This allows savvy \XeTeX-ers to input font features manually if they have % already memorised the OpenType abbreviations and don't mind not having error checking. % \begin{macrocode} -\@@_keys_define_code:nnn {fontspec} {RawFeature} +\@@_keys_define_code:nnn {fontspec-opentype} {RawFeature} + { + \@@_update_featstr:n {#1} + } +\@@_keys_define_code:nnn {fontspec-aat} {RawFeature} { \@@_update_featstr:n {#1} } diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx index 20a2e97e070..269d18a4d6e 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx @@ -3,20 +3,7 @@ % \begin{macrocode} %<*lua> % \end{macrocode} -% First we define some metadata. % \begin{macrocode} -fontspec = fontspec or {} -local fontspec = fontspec -fontspec.module = { - name = "fontspec", - version = "2.5a", - date = "2016/02/01", - description = "Advanced font selection for LuaLaTeX.", - author = "Khaled Hosny, Philipp Gesang, Will Robertson", - copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", - license = "LPPL" -} - local err, warn, info, log = luatexbase.provides_module(fontspec.module) % \end{macrocode} % Some utility functions diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx index cf655be78b2..5e04573ff23 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx @@ -39,7 +39,11 @@ \@@_feat_prop_add:nn {#3} {#1\,=\,#2} \keys_define:nn {fontspec-opentype} { - #1/#2 .code:n = { \@@_make_OT_feature:nnn {#3} {#4} {#5} } + #1/#2 .code:n = + { +% \typeout{::::::::fontspec-opentype~#1/#2~=~#3/#4/#5} + \@@_make_OT_feature:nnn {#3} {#4} {#5} + } } } % \end{macrocode} @@ -119,9 +123,9 @@ % \end{macrocode} % % \begin{macrocode} -\cs_new:Nn \@@_swap_plus_minus:n { \@@_swap_plus_minus_aux:NNNNN #1 } -\cs_new:Nn \@@_swap_plus_minus_aux:NNNNN - { \str_case:nn {#1} { {+} {-#2#3#4#5} {-} {+#2#3#4#5} } } +\cs_new:Nn \@@_swap_plus_minus:n { \@@_swap_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \@@_swap_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nn {#1} { {+} {-#2} {-} {+#2} } } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx index 44d9f52fd2c..ca1ac793c29 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx @@ -4,164 +4,6 @@ %<*fontspec> % \end{macrocode} % -% -% \subsection{Italic small caps and so on} \label{sec:sishape} -% -% \begin{macro}{\sishape} -% \begin{macro}{\textsi} -% These commands for actually selecting italic small caps have been defined for many years; I'm inclined to drop them. -% They're probably used very infrequently; I personally prefer just writing -% |\textit{\textsc{...}}| instead. -% -% \begin{macrocode} -\providecommand*\itscdefault{\itdefault\scdefault} -\providecommand*\slscdefault{\sldefault\scdefault} -\DeclareRobustCommand{\sishape} - { - \not@math@alphabet\sishape\relax - \fontshape{\itscdefault}\selectfont - } -\DeclareTextFontCommand{\textsi}{\sishape} -% \end{macrocode} -% \end{macro} \end{macro} -% -% \LaTeX's `shape' font axis needs to be overloaded to support italic small caps and slanted small caps. -% These are the combinations to support: -% \begin{macrocode} -\cs_new:Nn \@@_shape_merge:nn { c_@@_shape_#1_#2_tl } -\tl_const:cn { \@@_shape_merge:nn \itdefault \scdefault } {\itscdefault} -\tl_const:cn { \@@_shape_merge:nn \sldefault \scdefault } {\slscdefault} -\tl_const:cn { \@@_shape_merge:nn \scdefault \itdefault } {\itscdefault} -\tl_const:cn { \@@_shape_merge:nn \scdefault \sldefault } {\slscdefault} -\tl_const:cn { \@@_shape_merge:nn \slscdefault \itdefault } {\itscdefault} -\tl_const:cn { \@@_shape_merge:nn \itscdefault \sldefault } {\slscdefault} -\tl_const:cn { \@@_shape_merge:nn \itscdefault \updefault } {\scdefault} -\tl_const:cn { \@@_shape_merge:nn \slscdefault \updefault } {\scdefault} -% \end{macrocode} -% -% \begin{macro}{\fontspec_merge_shape:n} -% These macros enable the overload on the |\..shape| commands. -% First, a shape `new+current' (prefix) or `current+new' (suffix) is tried. -% If not found, fall back on the `new' shape. -% \begin{macrocode} -\cs_new:Nn \fontspec_merge_shape:n - { - \@@_if_merge_shape:nTF {#1} - { \fontshape { \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } } \selectfont } - { \fontshape {#1} \selectfont } - } -% \end{macrocode} -% The following is rather specific; it only returns true if the merged shape exists, -% but more importantly also if the merged shape is defined for the current font. -% \begin{macrocode} -\prg_new_conditional:Nnn \@@_if_merge_shape:n {TF} - { - \bool_if:nTF - { - \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } && - \cs_if_exist_p:c - { - \f@encoding/\f@family/\f@series/ - \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } - } - } - \prg_return_true: \prg_return_false: - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\itshape} \begin{macro}{\scshape} \begin{macro}{\upshape} \begin{macro}{\slshape} -% The original |\..shape| commands are redefined to use the merge shape macro. -% \begin{macrocode} -\DeclareRobustCommand \itshape - { - \not@math@alphabet\itshape\mathit - \fontspec_merge_shape:n\itdefault - } -\DeclareRobustCommand \slshape - { - \not@math@alphabet\slshape\relax - \fontspec_merge_shape:n\sldefault - } -\DeclareRobustCommand \scshape - { - \not@math@alphabet\scshape\relax - \fontspec_merge_shape:n\scdefault - } -\DeclareRobustCommand \upshape - { - \not@math@alphabet\upshape\relax - \fontspec_merge_shape:n\updefault - } -% \end{macrocode} -% \end{macro} \end{macro} \end{macro} \end{macro} -% -% -% -% \subsection{Emphasis} -% -% \begin{macro}{\em} -% \begin{macro}{\emph} -% \begin{macro}{\emshape} -% \begin{macro}{\eminnershape} -% \begin{macro}{\emfontdeclare} -% Redefinition of |{\em ...}| and |\emph{...}| to allow nesting of emphases. -% -% \begin{macrocode} -\cs_new_protected:Npn \emfontdeclare #1 - { - \prop_clear:N \g_@@_em_prop - \int_zero:N \l_@@_emdef_int - \group_begin: - \normalfont - \clist_map_inline:nn {\emreset,#1} - { - ##1 - \prop_gput_if_new:NxV \g_@@_em_prop { \f@series/\f@shape } { \l_@@_emdef_int } - \prop_gput:Nxn \g_@@_em_prop { switch-\int_use:N \l_@@_emdef_int } { ##1 } - \int_incr:N \l_@@_emdef_int - } - \group_end: - } -% \end{macrocode} -% -% \begin{macrocode} -\DeclareRobustCommand \em - { - \@nomath\em - - \prop_get:NxNT \g_@@_em_prop { \f@series/\f@shape } \l_@@_em_tmp_tl - { \int_set:Nn \l_@@_em_int { \l_@@_em_tmp_tl } } - - \int_incr:N \l_@@_em_int - - \prop_get:NxNTF \g_@@_em_prop { switch-\int_use:N \l_@@_em_int } \l_@@_em_switch_tl - { \l_@@_em_switch_tl } - { - \int_zero:N \l_@@_em_int - \emreset - } - - } -% \end{macrocode} -% Document commands: -% \begin{macrocode} -\DeclareTextFontCommand{\emph}{\em} -\cs_set:Npn \emreset { \upshape } -\cs_set:Npn \emshape { \itshape } -\cs_set:Npn \eminnershape { \upshape } -\emfontdeclare{ \emshape, \eminnershape } -% \end{macrocode} -% Ensure nesting resets when necessary: -% \begin{macrocode} -\cs_set:Npn \reset@font { \normalfont \int_zero:N \l__fontspec_em_int } -% \end{macrocode} -% Programmer's interface for setting nesting level: -% \begin{macrocode} -\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l_@@_em_int {#1} } -% \end{macrocode} -% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro} -% % \subsection{\cmd\-} % % \begin{macro}{\-} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx index 7800ec00a7e..89fe42b971e 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx @@ -337,10 +337,17 @@ { \keys_if_exist:nnF { fontspec / options } {#1} { \@@_define_opentype_feature_group:n {#1} } + \keys_if_choice_exist:nnnT {fontspec} {#1} {#2} { \@@_warning:nxx {feature-option-overwrite} {#1} {#2} } - \@@_define_opentype_feature:nnn {#1}{#2}{#3} + + \exp_args:Nnnx \@@_define_opentype_feature:nnnnn {#1}{#2}{ \@@_strip_plus_minus:n {#3} }{#3}{} } + +\cs_new:Nn \@@_strip_plus_minus:n { \@@_strip_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \@@_strip_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2} } + % \end{macrocode} % \end{macro} % @@ -359,11 +366,8 @@ % \typeout{::::::::::::::::::::^^J:: aliasfontfeature{#1}{#2}} \bool_set_false:N \l_@@_alias_bool - \clist_map_inline:nn - { fontspec, fontspec-opentype, fontspec-aat, fontspec-preparse, fontspec-preparse-external, - fontspec-preparse-nested, fontspec-renderer } + \clist_map_inline:Nn \g_@@_all_keyval_modules_clist { - \keys_if_exist:nnT {##1} {#1} { % \typeout{:::: Key~exists~##1~/~#1} @@ -387,16 +391,17 @@ \clist_map_inline:Nn \g_@@_all_keyval_modules_clist { - - \keys_if_exist:nnT {##1} {#1} + \keys_if_exist:nnT { ##1 / #1 } {#2} { +% \typeout{:::: Keyval~exists~##1~/~#1~=~#2} \bool_set_true:N \l_@@_alias_bool - \keys_define:nn { ##1 / #1 } { #3 .meta:n = {#2} } + \keys_define:nn { ##1 / #1 } + { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } } } } \bool_if:NF \l_@@_alias_bool - { \@@_warning:nx {rename-feature-not-exist} {#1} } + { \@@_warning:nx {rename-feature-not-exist} {#1/#2} } } % \end{macrocode} % \end{macro} @@ -437,7 +442,7 @@ % \end{macro} -% \begin{macro}{\IfFontFeaturesTF} +% \begin{macro}{\IfFontFeatureActiveTF} % \begin{macrocode} \DeclareDocumentCommand \IfFontFeatureActiveTF {mmm} { diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx index ea35f1d3608..eb2f0e0b39c 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx @@ -53,6 +53,7 @@ \bool_new:N \l_@@_never_check_bool \bool_new:N \l_@@_defining_encoding_bool \bool_new:N \l_@@_script_exist_bool +\bool_new:N \g_@@_em_normalise_slant_bool % \end{macrocode} % % \paragraph{Counters} @@ -63,6 +64,8 @@ \int_new:N \l_@@_tmp_int \int_new:N \l_@@_em_int \int_new:N \l_@@_emdef_int +\int_new:N \l_@@_strong_int +\int_new:N \l_@@_strongdef_int % \end{macrocode} % % \paragraph{Floating point} @@ -139,6 +142,7 @@ % \end{macrocode} % % \begin{macrocode} +\tl_new:N \l_@@_mapping_tl \tl_new:N \g_@@_hexcol_tl \tl_new:N \g_@@_opacity_tl \tl_set:Nn \g_@@_hexcol_tl {000000} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx new file mode 100644 index 00000000000..e62bed49f9e --- /dev/null +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx @@ -0,0 +1,266 @@ +% \section{Changes to the NFSS} +% +% \begin{macrocode} +%<*fontspec> +% \end{macrocode} +% +% +% \subsection{Italic small caps and so on} \label{sec:sishape} +% +% \begin{macro}{\sishape} +% \begin{macro}{\textsi} +% These commands for actually selecting italic small caps have been defined for many years; I'm inclined to drop them. +% They're probably used very infrequently; I personally prefer just writing +% |\textit{\textsc{...}}| instead. +% +% \begin{macrocode} +\providecommand*\itscdefault{\itdefault\scdefault} +\providecommand*\slscdefault{\sldefault\scdefault} +\DeclareRobustCommand{\sishape} + { + \not@math@alphabet\sishape\relax + \fontshape{\itscdefault}\selectfont + } +\DeclareTextFontCommand{\textsi}{\sishape} +% \end{macrocode} +% \end{macro} \end{macro} +% +% \LaTeX's `shape' font axis needs to be overloaded to support italic small caps and slanted small caps. +% These are the combinations to support: +% \begin{macrocode} +\cs_new:Nn \@@_shape_merge:nn { c_@@_shape_#1_#2_tl } +\tl_const:cn { \@@_shape_merge:nn \itdefault \scdefault } {\itscdefault} +\tl_const:cn { \@@_shape_merge:nn \sldefault \scdefault } {\slscdefault} +\tl_const:cn { \@@_shape_merge:nn \scdefault \itdefault } {\itscdefault} +\tl_const:cn { \@@_shape_merge:nn \scdefault \sldefault } {\slscdefault} +\tl_const:cn { \@@_shape_merge:nn \slscdefault \itdefault } {\itscdefault} +\tl_const:cn { \@@_shape_merge:nn \itscdefault \sldefault } {\slscdefault} +\tl_const:cn { \@@_shape_merge:nn \itscdefault \updefault } {\scdefault} +\tl_const:cn { \@@_shape_merge:nn \slscdefault \updefault } {\scdefault} +% \end{macrocode} +% +% \begin{macro}{\fontspec_merge_shape:n} +% These macros enable the overload on the |\..shape| commands. +% First, a shape `new+current' (prefix) or `current+new' (suffix) is tried. +% If not found, fall back on the `new' shape. +% \begin{macrocode} +\cs_new:Nn \fontspec_merge_shape:n + { + \@@_if_merge_shape:nTF {#1} + { \fontshape { \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } } \selectfont } + { \fontshape {#1} \selectfont } + } +% \end{macrocode} +% The following is rather specific; it only returns true if the merged shape exists, +% but more importantly also if the merged shape is defined for the current font. +% \begin{macrocode} +\prg_new_conditional:Nnn \@@_if_merge_shape:n {TF} + { + \bool_if:nTF + { + \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } && + \cs_if_exist_p:c + { + \f@encoding/\f@family/\f@series/ + \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } + } + } + \prg_return_true: \prg_return_false: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\itshape} \begin{macro}{\scshape} \begin{macro}{\upshape} \begin{macro}{\slshape} +% The original |\..shape| commands are redefined to use the merge shape macro. +% \begin{macrocode} +\DeclareRobustCommand \itshape + { + \not@math@alphabet\itshape\mathit + \fontspec_merge_shape:n\itdefault + } +\DeclareRobustCommand \slshape + { + \not@math@alphabet\slshape\relax + \fontspec_merge_shape:n\sldefault + } +\DeclareRobustCommand \scshape + { + \not@math@alphabet\scshape\relax + \fontspec_merge_shape:n\scdefault + } +\DeclareRobustCommand \upshape + { + \not@math@alphabet\upshape\relax + \fontspec_merge_shape:n\updefault + } +% \end{macrocode} +% \end{macro} \end{macro} \end{macro} \end{macro} +% +% +% +% \subsection{Emphasis} +% +% \begin{macro}{\emfontdeclare} +% \begin{macrocode} +\cs_new_protected:Npn \emfontdeclare #1 + { + \prop_clear:N \g_@@_em_prop + \int_zero:N \l_@@_emdef_int + \bool_set_true:N \g_@@_em_normalise_slant_bool + + \tl_if_in:nnT {#1} {\slshape} + { + \tl_if_in:nnT {#1} {\itshape} + { + \bool_set_false:N \g_@@_em_normalise_slant_bool + } + } + + \group_begin: + \normalfont + \clist_map_inline:nn {\emreset,#1} + { + ##1 + \prop_gput_if_new:NxV \g_@@_em_prop { \f@shape } { \l_@@_emdef_int } + \prop_gput:Nxn \g_@@_em_prop { switch-\int_use:N \l_@@_emdef_int } { ##1 } + \int_incr:N \l_@@_emdef_int + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\em} +% \begin{macrocode} +\DeclareRobustCommand \em + { + \@nomath\em + \tl_set:Nx \l_@@_emshape_query_tl { \f@shape } + + \bool_if:NT \g_@@_em_normalise_slant_bool + { + \tl_replace_all:Nnn \l_@@_emshape_query_tl {/sl} {/it} + } + +% \typeout{Emph~ level:~\int_use:N \l_@@_em_int} + \prop_get:NxNT \g_@@_em_prop { \l_@@_emshape_query_tl } \l_@@_em_tmp_tl + { + \int_set:Nn \l_@@_em_int { \l_@@_em_tmp_tl } +% \typeout{Shape~ (\l_@@_emshape_query_tl)~ detected;~ new~ level:~\int_use:N \l_@@_em_int} + } + + \int_incr:N \l_@@_em_int + + \prop_get:NxNTF \g_@@_em_prop { switch-\int_use:N \l_@@_em_int } \l_@@_em_switch_tl + { \l_@@_em_switch_tl } + { + \int_zero:N \l_@@_em_int + \emreset + } + + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emph} +% \begin{macro}{\emshape} +% \begin{macro}{\eminnershape} +% \begin{macro}{\emreset} +% \begin{macrocode} +\DeclareTextFontCommand{\emph}{\em} +\cs_set:Npn \emreset { \upshape } +\cs_set:Npn \emshape { \itshape } +\cs_set:Npn \eminnershape { \upshape } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Strong emphasis} +% +% \begin{macro}{\strongfontdeclare} +% \begin{macrocode} +\cs_new_protected:Npn \strongfontdeclare #1 + { + \prop_clear:N \g_@@_strong_prop + \int_zero:N \l_@@_strongdef_int + + \group_begin: + \normalfont + \clist_map_inline:nn {\strongreset,#1} + { + ##1 + \prop_gput_if_new:NxV \g_@@_strong_prop { \f@series } { \l_@@_strongdef_int } + \prop_gput:Nxn \g_@@_strong_prop { switch-\int_use:N \l_@@_strongdef_int } { ##1 } + \int_incr:N \l_@@_strongdef_int + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\strongenv} +% \begin{macrocode} +\DeclareRobustCommand \strongenv + { + \@nomath\strongenv + +% \typeout{Strong~ level:~\int_use:N \l_@@_strong_int} + \prop_get:NxNT \g_@@_strong_prop { \f@series } \l_@@_strong_tmp_tl + { + \int_set:Nn \l_@@_strong_int { \l_@@_strong_tmp_tl } +% \typeout{Series~ (\f@series)~ detected;~ new~ level:~\int_use:N \l_@@_strong_int} + } + + \int_incr:N \l_@@_strong_int + + \prop_get:NxNTF \g_@@_strong_prop { switch-\int_use:N \l_@@_strong_int } \l_@@_strong_switch_tl + { \l_@@_strong_switch_tl } + { + \int_zero:N \l_@@_strong_int + \strongreset + } + + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\strong} +% \begin{macro}{\strongreset} +% \begin{macrocode} +\DeclareTextFontCommand{\strong}{\strongenv} +\cs_set:Npn \strongreset {} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\reset@font} +% Ensure nesting resets when necessary: +% \begin{macrocode} +\cs_set:Npn \reset@font + { + \normalfont + \int_zero:N \l_@@_em_int + \int_zero:N \l_@@_strong_int + } +% \end{macrocode} +% \end{macro} +% +% Programmer's interface for setting nesting levels: +% \begin{macrocode} +\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l_@@_em_int {#1} } +\cs_new:Nn \fontspec_set_strong_level:n { \int_set:Nn \l_@@_strong_int {#1} } +% \end{macrocode} +% +% Defaults: +% \begin{macrocode} +\strongfontdeclare{ \bfseries } +\emfontdeclare{ \emshape, \eminnershape } +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx index ad626585c1a..504b41c337a 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx @@ -14,7 +14,7 @@ License information appended. \endpreamble \postamble ------------------------------------------------ -Copyright 2004--2017 Will Robertson +Copyright 2004--2017 Will Robertson Copyright 2009--2013 Khaled Hosny Distributable under the LaTeX Project Public License, version 1.3c or higher. @@ -27,7 +27,7 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf. \endpostamble \askforoverwritefalse \def\MetaPrefix{-- } -\generate{\file{fontspec.lua}{\from{fontspec-lua.dtx}{lua}}} +\generate{\file{fontspec.lua}{\from{fontspec.dtx}{lua}\from{fontspec-lua.dtx}{lua}}} \let\MetaPrefix\DoubleperCent \ifx\FontspecDebug\undefined\def\FSDEBUG{}\else\def\FSDEBUG{,debug}\fi @@ -54,6 +54,7 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf. \DTX{fontspec-enc.dtx} \DTX{fontspec-math.dtx} \DTX{fontspec-closing.dtx} + \DTX{fontspec-xfss.dtx} \DTX{fontspec-patches.dtx} } @@ -78,8 +79,19 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf. %\ProvidesExplPackage{fontspec-xetex}% %\ProvidesExplPackage{fontspec-luatex}% %<*fontspec> - {2017/01/24}{2.5d}{Font selection for XeLaTeX and LuaLaTeX} + {2017/02/12}{2.6}{Font selection for XeLaTeX and LuaLaTeX} % +%fontspec = fontspec or {} +%local fontspec = fontspec +%fontspec.module = { +% name = "fontspec", +% version = "2.6", +% date = "2017/02/12", +% description = "Font selection for XeLaTeX and LuaLaTeX", +% author = "Khaled Hosny, Philipp Gesang, Will Robertson", +% copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", +% license = "LPPL" +%} % %<*driver> \ExplSyntaxOff -- cgit v1.2.3