From 9fd41d05ec3aeb960a242af4f054e5c2d21de4e1 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 20 Nov 2020 03:01:07 +0000
Subject: CTAN sync 202011200301

---
 fonts/kpfonts-otf/tex/kpfonts-otf.sty | 164 +++++++++++++++++-----------------
 1 file changed, 80 insertions(+), 84 deletions(-)

(limited to 'fonts/kpfonts-otf/tex/kpfonts-otf.sty')

diff --git a/fonts/kpfonts-otf/tex/kpfonts-otf.sty b/fonts/kpfonts-otf/tex/kpfonts-otf.sty
index 38e42fa7b6..74e8ef19f2 100644
--- a/fonts/kpfonts-otf/tex/kpfonts-otf.sty
+++ b/fonts/kpfonts-otf/tex/kpfonts-otf.sty
@@ -1,6 +1,6 @@
 \NeedsTeXFormat{LaTeX2e}[2019/01/01]
-\def\fileversion{0.31}
-\def\filedate{2020/06/20}
+\def\fileversion{0.32}
+\def\filedate{2020/11/18}
 \ProvidesPackage{kpfonts-otf}[\filedate\space\fileversion]
 
 % Ensure luatex or xetex engine
@@ -29,6 +29,7 @@
 \newif\ifkp@calasscr
 \newif\ifkp@oldReIm
 \newif\ifkp@symbols     \kp@symbolstrue
+\newif\ifkp@tight
 %
 % Global options
 \DeclareOption{light}             {\kp@lighttexttrue\kp@lightmathtrue}
@@ -40,8 +41,8 @@
 % Text options
 \DeclareOption{lighttext}         {\kp@lighttexttrue}
 \DeclareOption{oldstylenums}      {\kp@osntrue}
-\DeclareOption{oldstyle}          {\kp@ostrue\kp@Qtailtrue}
-\DeclareOption{veryoldstyle}      {\kp@vostrue\kp@Qtailtrue}
+\DeclareOption{oldstyle}          {\kp@ostrue\kp@osntrue\kp@Qtailtrue}
+\DeclareOption{veryoldstyle}      {\kp@vostrue\kp@osntrue\kp@Qtailtrue}
 \DeclareOption{largesmallcaps}    {\kp@largesmallcapstrue}
 % Math options
 \DeclareOption{lightmath}         {\kp@lightmathtrue}
@@ -53,10 +54,18 @@
 \DeclareOption{oldstylenumsmath}  {\kp@osnmtrue}
 \DeclareOption{fancyReIm}         {\kp@oldReImtrue}
 \DeclareOption{noDcommand}        {\kp@Dcommandfalse}
+\DeclareOption{tight}             {\kp@tighttrue}
 \DeclareOption{symbols}           {\kp@textfalse\kp@sffalse\kp@ttfalse
                                    \kp@mathfalse}
 \ProcessOptions
 
+% This is adapted from babel to concatenate font features.
+\def\KP@addto#1#2{%
+      {\toks@\expandafter{#1,#2}%
+       \xdef#1{\the\toks@}}%
+}
+\def\KP@options{Ligatures=TeX}
+
 \ifkp@symbols  % true unless "nomath"
   \RequirePackage{unicode-math}[2019/01/01]
   % \D close integral
@@ -66,6 +75,11 @@
 \fi
 % Loading Math fonts...
 \ifkp@math
+  \ifkp@tight
+    \thinmuskip=2mu
+    \medmuskip=2.5mu plus 1mu minus 2.5mu
+    \thickmuskip=3.5mu plus 2.5mu
+  \fi
   \ifkp@lightmath
     \ifkp@calasscr
       \defaultfontfeatures+[KpMath-Light.otf]{RawFeature=+ss01}
@@ -118,99 +132,75 @@
 % Loading Text fonts...
 \ifkp@text
   \RequirePackage{fontspec}[2019/01/01]
-  \defaultfontfeatures+[\rmfamily,\KpLight]{Contextuals={WordFinal,Alternate}}
-  %Oldstylenums
+  % This needed with LuaTeX to typeset some composed chars like
+  % āēīōū ẽ ĕ ċṅṁ etc. not ready-made in the KPfonts…
+  \ifluahbtex\defaultfontfeatures{Renderer=HarfBuzz}\fi
+  % TS1 accent in Private Area
+  \DeclareUnicodeAccent{\newtie}{TU}{"E9F0}
+  % Accents not in tuenc.def
+  \DeclareUnicodeAccent{\candra}    \UnicodeEncodingName{"0310}
+  \DeclareUnicodeAccent{\ringbelow} \UnicodeEncodingName{"0325}
+  % Oldstylenums
   \ifkp@osn
-    \ifkp@sf
-      \ifkp@tt
-        \defaultfontfeatures+[\rmfamily,\KpLight,\sffamily,\ttfamily]%
-                             {Numbers=Lowercase}
-      \else
-        \defaultfontfeatures+[\rmfamily,\KpLight,\sffamily]{Numbers=Lowercase}
-      \fi
-    \else
-        \defaultfontfeatures+[\rmfamily,\KpLight]{Numbers=Lowercase}
+    \ifkp@tt
+      \defaultfontfeatures+[\ttfamily]{Numbers=Lowercase}
     \fi
+    \KP@addto\KP@options{Numbers=Lowercase}
   \fi
-  % Oldstyle
+  %% Oldstyle
   \ifkp@os
-    \ifkp@sf
-      \defaultfontfeatures+[\rmfamily,\KpLight,\sffamily]{%
-              Style=Swash,Ligatures={TeX,Rare},Numbers=Lowercase}
-    \else
-      \defaultfontfeatures+[\rmfamily,\KpLight]{%
-              Style=Swash,Ligatures={TeX,Rare},Numbers=Lowercase}
+    \ifkp@tt
+      \defaultfontfeatures+[\ttfamily]{Style=Swash}
     \fi
-    \ifkp@tt\defaultfontfeatures+[\ttfamily]{Numbers=Lowercase}\fi
+    \KP@addto\KP@options{Style=Swash,Ligatures=Rare}
   \fi
-  % Veryoldstyle
+  %% Veryoldstyle
   \ifkp@vos
-    \ifkp@sf
-      \defaultfontfeatures+[\rmfamily,\KpLight,\sffamily]{%
-              Style=Historic, Ligatures={TeX,Historic}}
-    \else
-      \defaultfontfeatures+[\rmfamily,\KpLight]{%
-              Style=Historic, Ligatures={TeX,Historic}}
+    \ifkp@tt
+      \defaultfontfeatures+[\ttfamily]{Style=Historic, Contextuals=Alternate}
     \fi
+    \KP@addto\KP@options{Style=Historic, Ligatures=Historic,
+                         Contextuals=Alternate}
   \fi
+  % Smallcaps
   \ifkp@largesmallcaps
-    \defaultfontfeatures+{SmallCapsFeatures = {Letters=SmallCaps}}
+    \KP@addto\KP@options{SmallCapsFeatures = {Letters=SmallCaps}}
   \else
-    \defaultfontfeatures+{SmallCapsFeatures = {Letters=PetiteCaps}}
+    \KP@addto\KP@options{SmallCapsFeatures = {Letters=PetiteCaps}}
   \fi
   % Text Serif fonts:
-  \setmainfont{KpRoman}[
-      Extension = .otf,
-      UprightFont =    *-Regular,
-      BoldFont =       *-Bold,
-      ItalicFont =     *-Italic,
-      BoldItalicFont = *-BoldItalic
-  ]
-  \newfontfamily\KpLight{KpRoman-Light}[
-      Extension = .otf,
-      BoldFont =       KpRoman-Semibold,
-      ItalicFont =     KpRoman-LightItalic,
-      BoldItalicFont = KpRoman-SemiboldItalic,
-      Ligatures=TeX
-  ]
-  \newfontface\Light{KpRoman-Light.otf}[Ligatures=TeX]
-  \newfontface\LightItalic {KpRoman-LightItalic.otf}[Ligatures=TeX]
-  \newfontface\Semibold{KpRoman-Semibold.otf}[Ligatures=TeX]
-  \newfontface\SemiboldItalic{KpRoman-SemiboldItalic.otf}[Ligatures=TeX]
-\fi
-% Text Sans Serif fonts:
-\ifkp@sf
-  \defaultfontfeatures+[\sffamily]{Contextuals={WordFinal,Alternate}}
-  \setsansfont{KpSans}[
-    Extension = .otf,
-    UprightFont =    *-Regular,
-    BoldFont =       *-Bold,
-    ItalicFont =     *-Italic,
-    BoldItalicFont = *-BoldItalic
-  ]
-\fi
-% Text Typewriter fonts:
-\ifkp@tt
-  \defaultfontfeatures+[\ttfamily]{Contextuals={WordFinal,Alternate}}
-  \setmonofont{KpMono}[
-    Extension = .otf,
-    UprightFont =    *-Regular,
-    BoldFont =       *-Bold,
-    ItalicFont =     *-Italic,
-    BoldItalicFont = *-BoldItalic
-  ]
-\fi
-% Light option
-\ifkp@lighttext
-  \renewcommand{\rmfamily}{\KpLight}
+  \ifkp@lighttext
+    \setmainfont{KpLight}[\KP@options]
+    \newfontface\Semibold{KpRoman-Regular.otf}[\KP@options]
+    \newfontface\SemiboldItalic{KpRoman-Italic.otf}[\KP@options]
+    \newfontface\Extrabold{KpRoman-Bold.otf}[\KP@options]
+    \newfontface\ExtraboldItalic{KpRoman-BoldItalic.otf}[\KP@options]
+    \DeclareTextFontCommand{\textsb}{\Semibold}
+    \DeclareTextFontCommand{\texteb}{\Extrabold}
+  \else
+    \setmainfont{KpRoman}[\KP@options]
+    \newfontface\Light{KpRoman-Light.otf}[\KP@options]
+    \newfontface\LightItalic {KpRoman-LightItalic.otf}[\KP@options]
+    \newfontface\Semibold{KpRoman-Semibold.otf}[\KP@options]
+    \newfontface\SemiboldItalic{KpRoman-SemiboldItalic.otf}[\KP@options]
+    \DeclareTextFontCommand{\textsb}{\Semibold}
+    \DeclareTextFontCommand{\textlt}{\Light}
+  \fi
+  % Text Sans Serif fonts:
+  \ifkp@sf
+    \setsansfont{KpSans}[\KP@options]
+  \fi
+  % Text Typewriter fonts:
+  \ifkp@tt
+    \setmonofont{KpMono}
+  \fi
+  % Large/Petites smallcaps
+  \DeclareRobustCommand\lscshape{\addfontfeatures{RawFeature=+smcp}}
+  \DeclareRobustCommand\pscshape{\addfontfeatures{RawFeature=+pcap}}
+  \DeclareRobustCommand\textlsc[1]{{\lscshape #1}}
+  \DeclareRobustCommand\textpsc[1]{{\pscshape #1}}
 \fi
 
-% Large/Petites smallcaps
-\DeclareRobustCommand\lscshape{\addfontfeatures{RawFeature=+smcp}}
-\DeclareRobustCommand\pscshape{\addfontfeatures{RawFeature=+pcap}}
-\DeclareRobustCommand\textlsc[1]{{\lscshape #1}}
-\DeclareRobustCommand\textpsc[1]{{\pscshape #1}}
-
 \ifkp@symbols
   % Style aliases
   \newopentypefeature{Style}{mathcal}{ss01}
@@ -361,8 +351,14 @@
        % <math type> : \mathord=0 \mathrel=3 ; <family>=0
        \Umathchardef\circledR =       0 0 "24C7 \relax
        \Umathchardef\circledS =       0 0 "24C8 \relax
-       \Umathchardef\npreceq =        3 0 "E096 \relax
-       \Umathchardef\nsucceq =        3 0 "E097 \relax
+       \Umathchardef\shortparallelslant =  3 0 "E092 \relax
+       \Umathchardef\nshortparallelslant = 3 0 "E093 \relax
+       \Umathchardef\lesseqslantgtr =      3 0 "E094 \relax
+       \Umathchardef\gtreqslantless =      3 0 "E095 \relax
+       \Umathchardef\lesseqqslantgtr =     3 0 "E096 \relax
+       \Umathchardef\gtreqqslantless =     3 0 "E097 \relax
+       \Umathchardef\npreceq =        3 0 "E098 \relax
+       \Umathchardef\nsucceq =        3 0 "E099 \relax
        \Umathchardef\diagup =         0 0 "E0A0 \relax
        \Umathchardef\diagdown =       0 0 "E0A1 \relax
        \Umathchardef\shortmid =       3 0 "E0A2 \relax
-- 
cgit v1.2.3

