diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty b/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty index 238e7d67477..0b2d007a04a 100644 --- a/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty +++ b/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty @@ -13,7 +13,7 @@ %% %% \ProvidesFile{novel-FontDefaults.sty}% -[2017/03/27 v1.0.10 LaTeX file (default fonts)] +[2017/04/12 v1.1 LaTeX file (default fonts)] %% @@ -23,7 +23,7 @@ %% Most TeX installations will use Latin Modern or Computer Modern %% as default fonts. These are unsuitable for commercial fiction. %% But `novel' class uses Libertinus as defaults. -%% Change them using \SetMasterFont and other fontspec commands, in Preamble. +%% Change them using \SetParentFont and other fontspec commands, in Preamble. % Libertinus Serif has Regular, Italic, Bold, Bold Italic. % Here, Semibold over-rides Bold. % @@ -32,10 +32,10 @@ \defaultfontfeatures{} % reset % % The mono font: -\defaultfontfeatures[\ttfamily]{% mono font has no kerning or common ligatures +\defaultfontfeatures[\ttfamily]{% monofont has no kerning or common ligatures SmallCapsFeatures={Renderer=Basic},Ligatures=TeX,% }% -\ifthenelse{\equal{\ttdefault}{lmtt} \OR \equal{\ttdefault}{cmtt}}{ % over-ride: +\ifthenelse{\equal{\ttdefault}{lmtt}\OR\equal{\ttdefault}{cmtt}}{% over-ride: \IfFontExistsTF{Libertinus Mono}{ \setmonofont[% ItalicFont={},% Doesn't have these. @@ -52,13 +52,13 @@ }{} % User \setmonofont, so leave alone. %% \defaultfontfeatures{} % reset -% Main and sans fonts use kerning, ligatures, and OldStyle numbers if available: +% Main and sans fonts: kerning, ligatures, and OldStyle numbers if available: \defaultfontfeatures[\rmfamily,\sffamily]{% SmallCapsFeatures={Renderer=Basic},Kerning=On,Numbers=OldStyle,% Ligatures=Common,Ligatures=TeX,% }% % The sans font: -\ifthenelse{\equal{\sfdefault}{lmss} \OR \equal{\sfdefault}{cmss}}{ % over-ride: +\ifthenelse{\equal{\sfdefault}{lmss}\OR\equal{\sfdefault}{cmss}}{ % override: \IfFontExistsTF{Libertinus Sans}{ \setsansfont{Libertinus Sans} }{ @@ -70,30 +70,32 @@ } }{} % User \setsansfont, so leave alone. %% -% At this point, if \rmdefault is something other than lmr or cmr, it probably -% means that the user issued \setmainfont. But that's ineffective in this -% class, because it will be over-written. Use \SetMasterFont instead: -\ifthenelse{\equal{\rmdefault}{lmr} \OR \equal{\rmdefault}{cmr}}{}{% - \ClassWarning{novel}{^^JDid you use \string\setmainfont\space in Preamble?^^J% - The \string\setmainfont\space command is ineffective in `novel' class.^^J% - Use \string\SetMasterFont\space instead. This Warning may be spurious if^^J% - you have an unusual configuration for your TeX installation.^^J}% +% At this point, if \rmdefault is something other than lmr, it means +% that the user attempted to set the main font using ordinary TeX commands, +% or via fontspec's \setmainfont. But those are ineffective in this class, +% because without \SetParentFont the prior command will be over-written. +\ifthenelse{\equal{\rmdefault}{lmr}}{}{% + \ClassWarning{novel}{^^JBIG BAD WARNING:^^J% + You attempted to define the main document font using a command such as^^J% + \string\renewcommand\string\rmdefault\space or \string\usepackage{font}^^J% + or \string\setmainfont. These are incorrect in `novel' class.^^J% + Use \string\SetParentFont\space instead. See `novel' documentation.^^J}% }% -% The masterfont: -\if@masterfontset\else +% The parentfont: (from v.1.1. Known as masterfont in prior versions) +\if@parentfontset\else \IfFontExistsTF{Libertinus Serif}{ - \SetMasterFont[% + \SetParentFont[% BoldFont=libertinusserif-semibold.otf,% BoldItalicFont=libertinusserif-semibolditalic.otf,% ]{Libertinus Serif} }{ \IfFontExistsTF{Linux Libertine O}{ - \SetMasterFont[% + \SetParentFont[% BoldFont=LinLibertine_RZ.otf,% BoldItalicFont=LinLibertine_RZI.otf,% ]{Linux Libertine O} }{ - \SetMasterFont[% + \SetParentFont[% SmallCapsFont={Latin Modern Roman Caps}% ]{Latin Modern Roman}% Eeek! Only because you have it! \let\scshape\oldscshape % or small caps won't work @@ -102,7 +104,7 @@ } \fi % Now we are ready to set the main font: -\@setmainfont[\@masterfontfeatures]{\@masterfontname} +\setmainfont[\@parentfontfeatures]{\@parentfontname} % %% \defaultfontfeatures{} % reset @@ -113,18 +115,18 @@ }% %% The novel-specific fonts: \if@chapterfontset\else - \SetChapterFont[\@masterfontfeatures,Scale=1.6]{\@masterfontname} + \SetChapterFont[\@parentfontfeatures,Scale=1.6]{\@parentfontname} \fi \newfontfamily\chapterfont[\@chapterfontfeatures]{\@chapterfontname} %% \if@subchfontset\else - \SetSubchFont[\@masterfontfeatures,Scale=1.2]{\@masterfontname} + \SetSubchFont[\@parentfontfeatures,Scale=1.2]{\@parentfontname} \fi \newfontfamily\subchfont[\@subchfontfeatures]{\@subchfontname} %% \newif \if@headfontdefault \if@headfontset\else - \SetHeadFont[\@masterfontfeatures,Scale=0.92]{\@masterfontname} + \SetHeadFont[\@parentfontfeatures,Scale=0.92]{\@parentfontname} \global\@headfontdefaulttrue \fi \newfontfamily\headfont[\@headfontfeatures]{\@headfontname} @@ -144,7 +146,7 @@ %% %% Now to get the decofont activated: % Decorative glyphs, only in this font. Should not be re-set by user: -\gdef\decoglyph#1{~} % If NovelDeco not found, non-breaking space in main text. +\gdef\decoglyph#1{~}% If NovelDeco not found, nonbreaking space in main text. % \if@gotdeco % NovelDeco or a user-defined alternative was found: \newfontface\@decoglyph[% @@ -162,19 +164,19 @@ % \gdef\decoglyph#1{% Be sure to use % without preceding space: \IfBeginWith{#1}{n}{% normal weight symbol (same as regular) - \StrBehind{#1}{n}[\@tempdecoglyph]{\@decoglyph\symbol{\@tempdecoglyph}}% + \StrBehind{#1}{n}[\@tempdecoglyph]{\@decoglyph\symbol{\@tempdecoglyph}}% }{}% \IfBeginWith{#1}{r}{% regular weight symbol - \StrBehind{#1}{r}[\@tempdecoglyph]{\@decoglyph\symbol{\@tempdecoglyph}}% + \StrBehind{#1}{r}[\@tempdecoglyph]{\@decoglyph\symbol{\@tempdecoglyph}}% }{}% \IfBeginWith{#1}{l}{% light weight symbol - \StrBehind{#1}{l}[\@tempdecoglyph]{\@decoglypha\symbol{\@tempdecoglyph}}% + \StrBehind{#1}{l}[\@tempdecoglyph]{\@decoglypha\symbol{\@tempdecoglyph}}% }{}% \IfBeginWith{#1}{e}{% extra light weight symbol - \StrBehind{#1}{e}[\@tempdecoglyph]{\@decoglyphb\symbol{\@tempdecoglyph}}% + \StrBehind{#1}{e}[\@tempdecoglyph]{\@decoglyphb\symbol{\@tempdecoglyph}}% }{}% \IfBeginWith{#1}{t}{% thin weight symbol - \StrBehind{#1}{t}[\@tempdecoglyph]{\@decoglyphc\symbol{\@tempdecoglyph}}% + \StrBehind{#1}{t}[\@tempdecoglyph]{\@decoglyphc\symbol{\@tempdecoglyph}}% }{}% }% end gdef decoglyph % @@ -234,8 +236,8 @@ \setotherlanguages[\@setotherlangsopt]{\@setotherlangs} } } -%% This provides default microtype settings, allows the user to over-ride, and -% hopefully prevents the user from choosing inappropriate settings: +%% This provides default microtype settings, allows the user to over-ride, +% and hopefully prevents the user from choosing inappropriate settings: \let\microtypesetup\relax % fake command no longer needed \if@setmicrotype % user wrote \microtypesetup{} in Preamble \IfSubStr{\@mymicrotypesetup}{config}{% user specified own config file |